mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 09:10:30 -04:00
Merge from vscode 8aa90d444f5d051984e8055f547c4252d53479b3 (#5587)
* Merge from vscode 8aa90d444f5d051984e8055f547c4252d53479b3 * pipeline errors * fix build
This commit is contained in:
@@ -196,7 +196,7 @@ export const tocData: ITOCEntry = {
|
||||
]
|
||||
};
|
||||
|
||||
export const knownAcronyms = new Set();
|
||||
export const knownAcronyms = new Set<string>();
|
||||
[
|
||||
'css',
|
||||
'html',
|
||||
@@ -209,3 +209,7 @@ export const knownAcronyms = new Set();
|
||||
'id',
|
||||
'php',
|
||||
].forEach(str => knownAcronyms.add(str));
|
||||
|
||||
export const knownTermMappings = new Map<string, string>();
|
||||
knownTermMappings.set('power shell', 'PowerShell');
|
||||
knownTermMappings.set('powershell', 'PowerShell');
|
||||
|
||||
@@ -11,7 +11,7 @@ import { localize } from 'vs/nls';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { SettingsTarget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets';
|
||||
import { ITOCEntry, knownAcronyms } from 'vs/workbench/contrib/preferences/browser/settingsLayout';
|
||||
import { ITOCEntry, knownAcronyms, knownTermMappings } from 'vs/workbench/contrib/preferences/browser/settingsLayout';
|
||||
import { MODIFIED_SETTING_TAG } from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
import { IExtensionSetting, ISearchResult, ISetting, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
|
||||
|
||||
@@ -404,8 +404,8 @@ export function settingKeyToDisplayFormat(key: string, groupId = ''): { category
|
||||
}
|
||||
|
||||
function wordifyKey(key: string): string {
|
||||
return key
|
||||
.replace(/\.([a-z0-9])/g, (match, p1) => ` › ${p1.toUpperCase()}`) // Replace dot with spaced '>'
|
||||
key = key
|
||||
.replace(/\.([a-z0-9])/g, (_, p1) => ` › ${p1.toUpperCase()}`) // Replace dot with spaced '>'
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1 $2') // Camel case to spacing, fooBar => foo Bar
|
||||
.replace(/^[a-z]/g, match => match.toUpperCase()) // Upper casing all first letters, foo => Foo
|
||||
.replace(/\b\w+\b/g, match => { // Upper casing known acronyms
|
||||
@@ -413,6 +413,12 @@ function wordifyKey(key: string): string {
|
||||
match.toUpperCase() :
|
||||
match;
|
||||
});
|
||||
|
||||
for (let [k, v] of knownTermMappings) {
|
||||
key = key.replace(new RegExp(`\\b${k}\\b`, 'gi'), v);
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
function trimCategoryForGroup(category: string, groupId: string): string {
|
||||
|
||||
Reference in New Issue
Block a user