Add new "files.defaultLanguage" configuration setting#23220
Add new "files.defaultLanguage" configuration setting#23220bpasero merged 3 commits intomicrosoft:masterfrom
Conversation
|
Happy to add or change anything you like! |
There was a problem hiding this comment.
I suggest to not add this to the action but actually to the place where untitled editors are being created. There can be other ways how untitled buffers open (e.g. from extensions) and I think a configured default language would also apply there.
I am thinking somewhere inside https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/services/untitled/common/untitledEditorService.ts#L177 to use the configuration if the modeId parameter is undefined.
There was a problem hiding this comment.
We do have an extension running that provides intellisense inside settings. For this setting I would like to see the list of language Ids when the user wants to quickly select a known language. The place to add this is here: https://github.com/Microsoft/vscode/blob/master/extensions/configuration-editing/src/settingsDocumentHelper.ts#L26
This change adds a new configuration setting that sets the default language mode of new untitled files created with Ctrl+N (workbench.action.files.newUntitledFile). This activates the user's desired language mode when a new untitled file is created. Fixes microsoft#8729.
39afece to
dfa42af
Compare
| return Promise.resolve([]); | ||
| } | ||
|
|
||
| private provideDefaultLanguageCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> { |
There was a problem hiding this comment.
Can we make this method reused between the two clients calling vscode.languages.getLanguages here, it seems there is quite a bit of overlap
|
Hey Ben, I'm having a little trouble getting the 0e19b7e#diff-f8147d00dccdef1240768b7b2812a1c9R145 Because no languages have been registered with the |
|
Sweet, thanks a lot! |
|
Thank you for this nifty feature - really appreciated! |

This change adds a new configuration setting that sets the default
language mode of new untitled files created with Ctrl+N
(workbench.action.files.newUntitledFile). This activates the user's
desired language mode when a new untitled file is created.
Fixes #8729.