diff --git a/.vscode/settings.json b/.vscode/settings.json index df71c841d7e..02813fa947e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -95,9 +95,9 @@ "git", "sash" ], - "explorer.fileNesting.patterns": { + "explorer.experimental.fileNesting.patterns": { "*.js": "$(capture).*.js", "bootstrap.js": "bootstrap-*.js" }, - "explorer.fileNesting.enabled": true + "explorer.experimental.fileNesting.enabled": true } diff --git a/src/vs/workbench/contrib/files/browser/explorerService.ts b/src/vs/workbench/contrib/files/browser/explorerService.ts index 9965ab09ae9..6c50ef135c4 100644 --- a/src/vs/workbench/contrib/files/browser/explorerService.ts +++ b/src/vs/workbench/contrib/files/browser/explorerService.ts @@ -384,7 +384,7 @@ export class ExplorerService implements IExplorerService { private async onConfigurationUpdated(configuration: IFilesConfiguration, event?: IConfigurationChangeEvent): Promise { let shouldRefresh = false; - if (event?.affectedKeys.some(x => x.startsWith('explorer.fileNesting.'))) { + if (event?.affectedKeys.some(x => x.startsWith('explorer.experimental.fileNesting.'))) { shouldRefresh = true; } diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index f56991447c7..6cb9791b786 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -907,7 +907,7 @@ export const renameHandler = async (accessor: ServicesAccessor) => { export const moveFileToTrashHandler = async (accessor: ServicesAccessor) => { const explorerService = accessor.get(IExplorerService); const configurationService = accessor.get(IConfigurationService); - const groupNests = configurationService.getValue().explorer.fileNesting.operateAsGroup; + const groupNests = configurationService.getValue().explorer.experimental.fileNesting.operateAsGroup; const stats = explorerService.getContext(true, groupNests).filter(s => !s.isRoot); if (stats.length) { await deleteFiles(accessor.get(IExplorerService), accessor.get(IWorkingCopyFileService), accessor.get(IDialogService), accessor.get(IConfigurationService), stats, true); @@ -917,7 +917,7 @@ export const moveFileToTrashHandler = async (accessor: ServicesAccessor) => { export const deleteFileHandler = async (accessor: ServicesAccessor) => { const explorerService = accessor.get(IExplorerService); const configurationService = accessor.get(IConfigurationService); - const groupNests = configurationService.getValue().explorer.fileNesting.operateAsGroup; + const groupNests = configurationService.getValue().explorer.experimental.fileNesting.operateAsGroup; const stats = explorerService.getContext(true, groupNests).filter(s => !s.isRoot); if (stats.length) { @@ -929,7 +929,7 @@ let pasteShouldMove = false; export const copyFileHandler = async (accessor: ServicesAccessor) => { const explorerService = accessor.get(IExplorerService); const configurationService = accessor.get(IConfigurationService); - const groupNests = configurationService.getValue().explorer.fileNesting.operateAsGroup; + const groupNests = configurationService.getValue().explorer.experimental.fileNesting.operateAsGroup; const stats = explorerService.getContext(true, groupNests); if (stats.length > 0) { await explorerService.setToCopy(stats, false); @@ -940,7 +940,7 @@ export const copyFileHandler = async (accessor: ServicesAccessor) => { export const cutFileHandler = async (accessor: ServicesAccessor) => { const explorerService = accessor.get(IExplorerService); const configurationService = accessor.get(IConfigurationService); - const groupNests = configurationService.getValue().explorer.fileNesting.operateAsGroup; + const groupNests = configurationService.getValue().explorer.experimental.fileNesting.operateAsGroup; const stats = explorerService.getContext(true, groupNests); if (stats.length > 0) { await explorerService.setToCopy(stats, true); diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts index 706fc028bd4..496b1936d9f 100644 --- a/src/vs/workbench/contrib/files/browser/files.contribution.ts +++ b/src/vs/workbench/contrib/files/browser/files.contribution.ts @@ -461,38 +461,26 @@ configurationRegistry.registerConfiguration({ 'default': 'auto' }, 'explorer.experimental.fileNesting.enabled': { - deprecationMessage: nls.localize('deprecated', "Deprecated, use non-experimental setting names.") - }, - 'explorer.experimental.fileNesting.expand': { - deprecationMessage: nls.localize('deprecated', "Deprecated, use non-experimental setting names.") - }, - 'explorer.experimental.fileNesting.operateAsGroup': { - deprecationMessage: nls.localize('deprecated', "Deprecated, use non-experimental setting names.") - }, - 'explorer.experimental.fileNesting.patterns': { - deprecationMessage: nls.localize('deprecated', "Deprecated, use non-experimental setting names.") - }, - 'explorer.fileNesting.enabled': { 'type': 'boolean', - 'markdownDescription': nls.localize('fileNestingEnabled', "Controls whether file nesting is enabled in the explorer. File nesting allows for related files in a directory to be visually grouped together under a single parent file."), + 'markdownDescription': nls.localize('fileNestingEnabled', "Experimental. Controls whether file nesting is enabled in the explorer. File nesting allows for related files in a directory to be visually grouped together under a single parent file."), 'default': false, }, - 'explorer.fileNesting.expand': { + 'explorer.experimental.fileNesting.expand': { 'type': 'boolean', - 'markdownDescription': nls.localize('fileNestingExpand', "Controls whether file nests are automatically expanded."), + 'markdownDescription': nls.localize('fileNestingExpand', "Experimental. Controls whether file nests are automatically expanded. `#explorer.experimental.fileNesting.enabled#` must be set for this to take effect."), 'default': true, }, - 'explorer.fileNesting.operateAsGroup': { + 'explorer.experimental.fileNesting.operateAsGroup': { 'type': 'boolean', 'markdownDescription': nls.localize('operateAsGroup', "Controls whether file nests are treated as a group for clipboard operations, file deletions, and during drag and drop."), 'default': false, }, - 'explorer.fileNesting.patterns': { + 'explorer.experimental.fileNesting.patterns': { 'type': 'object', 'markdownDescription': nls.localize('fileNestingPatterns', "Controls nesting of files in the explorer. Each __Item__ represents a parent pattern and may contain a single `*` character that matches any string. Each __Value__ represents a comma separated list of the child patterns that should be shown nested under a given parent. Child patterns may contain several special tokens:\n- `$\u200b(capture)`: Matches the resolved value of the `*` from the parent pattern\n- `$\u200b(basename)`: Matches the parent file's basename, the `file` in `file.ts`\n- `$\u200b(extname)`: Matches the parent file's extension, the `ts` in `file.ts`\n- `$\u200b(dirname)`: Matches the parent file's directory name, the `src` in `src/file.ts`\n- `*`: Matches any string, may only be used once per child pattern"), patternProperties: { '^[^*]*\\*?[^*]*$': { - markdownDescription: nls.localize('fileNesting.description', "Each key pattern may contain several special sequences: \n- `$\u200b(capture)`: Matches the resolved value of the `*` from the parent pattern\n- `$\u200b(basename)`: Matches the parent file's basename, the `file` in `file.ts`\n- `$\u200b(extname)`: Matches the parent file's extension, the `ts` in `file.ts`\n- `$\u200b(dirname)`: Matches the parent file's directory name, the `src` in `src/file.ts`\n- `*`: Matches any string, may only be used once per child pattern"), + markdownDescription: nls.localize('fileNesting.description', "Each key pattern may contain a single `*` character which will match any string."), type: 'string', pattern: '^([^,*]*\\*?[^,*]*)(, ?[^,*]*\\*?[^,*]*)*$', } diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index d01cde745a6..c109d5648b8 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -384,7 +384,7 @@ export class ExplorerView extends ViewPane implements IExplorerView { const isCompressionEnabled = () => this.configurationService.getValue('explorer.compactFolders'); - const getFileNestingSettings = () => this.configurationService.getValue().explorer.fileNesting; + const getFileNestingSettings = () => this.configurationService.getValue().explorer.experimental.fileNesting; this.tree = >this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'FileExplorer', container, new ExplorerDelegate(), new ExplorerCompressionDelegate(), [this.renderer], this.instantiationService.createInstance(ExplorerDataSource), { @@ -625,7 +625,7 @@ export class ExplorerView extends ViewPane implements IExplorerView { } const toRefresh = item || this.tree.getInput(); - if (this.configurationService.getValue().explorer.fileNesting.enabled) { + if (this.configurationService.getValue()?.explorer?.experimental?.fileNesting?.enabled) { return (async () => { try { await this.tree.updateChildren(toRefresh, recursive, false, { diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index bb78117e40c..f6c758e1256 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -418,7 +418,7 @@ export class FilesRenderer implements ICompressibleTreeRenderer setResourceData())); elementDisposables.add(this.configurationService.onDidChangeConfiguration((e) => - e.affectsConfiguration('explorer.fileNesting.hideIconsToMatchFolders') && setResourceData())); + e.affectsConfiguration('explorer.experimental.fileNesting.hideIconsToMatchFolders') && setResourceData())); setResourceData(); @@ -1085,7 +1085,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { const elementsData = FileDragAndDrop.getStatsFromDragAndDropData(data); const items = distinctParents(elementsData, s => s.resource); - if (this.configurationService.getValue().explorer.fileNesting.operateAsGroup) { + if (this.configurationService.getValue().explorer.experimental.fileNesting.operateAsGroup) { for (const item of items) { const nestedChildren = item.nestedChildren; if (nestedChildren) { diff --git a/src/vs/workbench/contrib/files/common/explorerModel.ts b/src/vs/workbench/contrib/files/common/explorerModel.ts index 6efd1a976eb..5a72303f914 100644 --- a/src/vs/workbench/contrib/files/common/explorerModel.ts +++ b/src/vs/workbench/contrib/files/common/explorerModel.ts @@ -298,7 +298,7 @@ export class ExplorerItem { } fetchChildren(sortOrder: SortOrder): ExplorerItem[] | Promise { - const nestingConfig = this.configService.getValue().explorer.fileNesting; + const nestingConfig = this.configService.getValue().explorer.experimental.fileNesting; // fast path when the children can be resolved sync if (nestingConfig.enabled && this.nestedChildren) { return this.nestedChildren; } @@ -367,7 +367,7 @@ export class ExplorerItem { private _fileNester: ExplorerFileNestingTrie | undefined; private get fileNester(): ExplorerFileNestingTrie { if (!this.root._fileNester) { - const nestingConfig = this.configService.getValue({ resource: this.root.resource }).explorer.fileNesting; + const nestingConfig = this.configService.getValue({ resource: this.root.resource }).explorer.experimental.fileNesting; const patterns = Object.entries(nestingConfig.patterns) .filter(entry => typeof (entry[0]) === 'string' && typeof (entry[1]) === 'string' && entry[0] && entry[1]) diff --git a/src/vs/workbench/contrib/files/common/files.ts b/src/vs/workbench/contrib/files/common/files.ts index b5f86c1ea49..988a6e4cef0 100644 --- a/src/vs/workbench/contrib/files/common/files.ts +++ b/src/vs/workbench/contrib/files/common/files.ts @@ -98,12 +98,14 @@ export interface IFilesConfiguration extends PlatformIFilesConfiguration, IWorkb badges: boolean; }; incrementalNaming: 'simple' | 'smart'; - fileNesting: { - enabled: boolean; - operateAsGroup: boolean; - expand: boolean; - hideIconsToMatchFolders: boolean; - patterns: { [parent: string]: string }; + experimental: { + fileNesting: { + enabled: boolean; + operateAsGroup: boolean; + expand: boolean; + hideIconsToMatchFolders: boolean; + patterns: { [parent: string]: string }; + }; }; }; editor: IEditorOptions;