diff --git a/src/vs/workbench/services/suggest/browser/simpleCompletionItem.ts b/src/vs/workbench/services/suggest/browser/simpleCompletionItem.ts index b1301167f1a..d3590fbf873 100644 --- a/src/vs/workbench/services/suggest/browser/simpleCompletionItem.ts +++ b/src/vs/workbench/services/suggest/browser/simpleCompletionItem.ts @@ -101,8 +101,9 @@ export class SimpleCompletionItem { if (isWindows) { this.labelLow = this.labelLow.replaceAll('/', '\\'); } + // Don't include dotfiles as extensions when sorting const extIndex = this.labelLow.lastIndexOf('.'); - if (extIndex !== -1) { + if (extIndex > 0) { this.labelLowExcludeFileExt = this.labelLow.substring(0, extIndex); this.fileExtLow = this.labelLow.substring(extIndex + 1); } diff --git a/src/vs/workbench/services/suggest/test/browser/simpleCompletionModel.test.ts b/src/vs/workbench/services/suggest/test/browser/simpleCompletionModel.test.ts index 92a62738e08..216f8c91b78 100644 --- a/src/vs/workbench/services/suggest/test/browser/simpleCompletionModel.test.ts +++ b/src/vs/workbench/services/suggest/test/browser/simpleCompletionModel.test.ts @@ -92,8 +92,7 @@ suite('SimpleCompletionModel', function () { assertItems(createFolderItemsModel(...initial), expected); }); - // #239532 Failing on CI not locally? - test.skip('should handle many files and folders correctly', function () { + test('should handle many files and folders correctly', function () { // This is VS Code's root directory with some python items added that have special // sorting const items = [ @@ -158,8 +157,6 @@ suite('SimpleCompletionModel', function () { '.configurations', 'CONTRIBUTING.md', '.devcontainer', - '.npmrc', - '.gitignore', '.editorconfig', 'eslint.config.js', '.eslint-ignore', @@ -168,13 +165,15 @@ suite('SimpleCompletionModel', function () { '.gitattributes', '.git-blame-ignore-revs', '.github', + '.gitignore', 'gulpfile.js', 'LICENSE.txt', '.lsifrc.json', - '.nvmrc', '.mailmap', '.mention-bot', 'node_modules', + '.npmrc', + '.nvmrc', 'out', 'package.json', 'package-lock.json',