Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: --<!-- Use Help Report Issue to prefill these. --- VSCode Version: 1.52.1 (user setup) OS Version: Windows_NTx64 10.0. Steps to Reproduce: some custom languages, examples that it definitely works for are "Caddlefile Syntax", "Graphviz language", "Hjson", "Better TOML", "Svelte for VS Code". a new blank file. --Save as and expect to find it in the alphabetically sorted list (e.g. Toml from Better TOML between Swift and TypeScript) , instead find it at the bottom. It appears to be in the order 'inbuilt languages sorted alphabetically' followed by 'other languages sorted somewhat randomly'. ! <!-- Launch with to check. --Does this issue occur when all extensions are disabled?: No
They are sorted on macOS, so it maybe Windows doing something weird. But we also dont sort the list explicitly:
Up for grab, I think we should sort the languages by name. We still have to make sure that: "All Files" appears first the current language appears second and selected "No Extension" is last
If you sort "registeredLanguageFilters" that should solve the problem no? "All files" appearing first, current language appearing second and "No Extension" appearing last is handled by these lines: Still getting the hang of all this, so please correct me if I am wrong.
Can we have this discussion in a Pull Request?
Two things I notice. as with untitled files defaults to not . Save as on a file with a pre-existing extension leads to an out of order list. I.e. here's a picture of .CSS !
It is intentional that the language mode picked for a file is the second most entry in the list, we have explicit code to change the order there. As for untitled: did you have the language mode configured to ".bat"? I suggest we follow up in a new issue here as it is independent from the sorting fix. Verification: create an untitled file save it in the picker verify that the languages are sorted by name, specifically check for languages contributed by extensions such as JSONC

Discussion:
import { IHostService } from 'vs/workbench/services/host/browser/host'; import Severity from 'vs/base/common/severity'; import { coalesce, distinct } from 'vs/base/common/arrays'; <del> import { trim } from 'vs/base/common/strings'; </del> <ins> import { compareIgnoreCase, trim } from 'vs/base/common/strings'; </ins> import { IModeService } from 'vs/editor/common/services/modeService'; import { ILabelService } from 'vs/platform/label/common/label'; import { IPathService } from 'vs/workbench/services/path/common/pathService';

// Build the file filter by using our known languages const ext: string | undefined = defaultUri ? resources.extname(defaultUri) : undefined; let matchingFilter: IFilter | undefined; <del> const registeredLanguageFilters: IFilter[] = coalesce(this.modeService.getRegisteredLanguageNames().map(languageName => { </del> <ins> const registeredLanguageNames = this.modeService.getRegisteredLanguageNames().sort((a, b) => compareIgnoreCase(a, b)); const registeredLanguageFilters: IFilter[] = coalesce(registeredLanguageNames.map(languageName => { </ins> const extensions = this.modeService.getExtensions(languageName); if (!extensions || !extensions.length) { return null;