diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index 186a5462686..4bf36e114d0 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -964,7 +964,7 @@ export class SettingsEditor2 extends EditorPane { const groups = this.defaultSettingsEditorModel.settingsGroups.slice(1); // Without commonlyUsed const dividedGroups = collections.groupBy(groups, g => g.extensionInfo ? 'extension' : 'core'); - const settingsResult = resolveSettingsTree(tocData, dividedGroups.core); + const settingsResult = resolveSettingsTree(tocData, dividedGroups.core, this.logService); const resolvedSettingsRoot = settingsResult.tree; // Warn for settings not included in layout @@ -978,7 +978,7 @@ export class SettingsEditor2 extends EditorPane { this.hasWarnedMissingSettings = true; } - const commonlyUsed = resolveSettingsTree(commonlyUsedData, dividedGroups.core); + const commonlyUsed = resolveSettingsTree(commonlyUsedData, dividedGroups.core, this.logService); resolvedSettingsRoot.children!.unshift(commonlyUsed.tree); resolvedSettingsRoot.children!.push(resolveExtensionsSettings(dividedGroups.extension || [])); diff --git a/src/vs/workbench/contrib/preferences/browser/settingsLayout.ts b/src/vs/workbench/contrib/preferences/browser/settingsLayout.ts index b7d75df6e59..10e7706cba3 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsLayout.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsLayout.ts @@ -17,7 +17,7 @@ export interface ITOCEntry { export const commonlyUsedData: ITOCEntry = { id: 'commonlyUsed', label: localize('commonlyUsed', "Commonly Used"), - settings: ['files.autoSave', 'editor.fontSize', 'editor.fontSizeDelay', 'editor.fontFamily', 'editor.tabSize', 'editor.renderWhitespace', 'editor.cursorStyle', 'editor.multiCursorModifier', 'editor.insertSpaces', 'editor.wordWrap', 'files.exclude', 'files.associations', 'workbench.editor.enablePreview'] + settings: ['files.autoSave', 'files.autoSaveDelay', 'editor.fontSize', 'editor.fontFamily', 'editor.tabSize', 'editor.renderWhitespace', 'editor.cursorStyle', 'editor.multiCursorModifier', 'editor.insertSpaces', 'editor.wordWrap', 'files.exclude', 'files.associations', 'workbench.editor.enablePreview'] }; export const tocData: ITOCEntry = { diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index f0b519e3288..e267dceb043 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -55,6 +55,7 @@ import { IList } from 'vs/base/browser/ui/tree/indexTreeModel'; import { IListService, WorkbenchObjectTree } from 'vs/platform/list/browser/listService'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; +import { ILogService } from 'vs/platform/log/common/log'; const $ = DOM.$; @@ -257,10 +258,10 @@ function getListDisplayValue(element: SettingsTreeSettingElement): IListDataItem }); } -export function resolveSettingsTree(tocData: ITOCEntry, coreSettingsGroups: ISettingsGroup[]): { tree: ITOCEntry, leftoverSettings: Set } { +export function resolveSettingsTree(tocData: ITOCEntry, coreSettingsGroups: ISettingsGroup[], logService: ILogService): { tree: ITOCEntry, leftoverSettings: Set } { const allSettings = getFlatSettings(coreSettingsGroups); return { - tree: _resolveSettingsTree(tocData, allSettings), + tree: _resolveSettingsTree(tocData, allSettings, logService), leftoverSettings: allSettings }; } @@ -288,17 +289,17 @@ export function resolveExtensionsSettings(groups: ISettingsGroup[]): ITOCEntry { }; } -function _resolveSettingsTree(tocData: ITOCEntry, allSettings: Set): ITOCEntry { +function _resolveSettingsTree(tocData: ITOCEntry, allSettings: Set, logService: ILogService): ITOCEntry { let children: ITOCEntry[] | undefined; if (tocData.children) { children = tocData.children - .map(child => _resolveSettingsTree(child, allSettings)) + .map(child => _resolveSettingsTree(child, allSettings, logService)) .filter(child => (child.children && child.children.length) || (child.settings && child.settings.length)); } let settings: ISetting[] | undefined; if (tocData.settings) { - settings = arrays.flatten(tocData.settings.map(pattern => getMatchingSettings(allSettings, pattern))); + settings = arrays.flatten(tocData.settings.map(pattern => getMatchingSettings(allSettings, pattern, logService))); } if (!children && !settings) { @@ -313,7 +314,7 @@ function _resolveSettingsTree(tocData: ITOCEntry, allSettings: Set): I }; } -function getMatchingSettings(allSettings: Set, pattern: string): ISetting[] { +function getMatchingSettings(allSettings: Set, pattern: string, logService: ILogService): ISetting[] { const result: ISetting[] = []; allSettings.forEach(s => { @@ -323,6 +324,9 @@ function getMatchingSettings(allSettings: Set, pattern: string): ISett } }); + if (!result.length) { + logService.warn(`Settings pattern "${pattern}" doesn't match any settings`); + } return result.sort((a, b) => a.key.localeCompare(b.key)); }