{ "key": "ctrl+k m",
"command": "workbench.action.editor.changeLanguageMode" },
Based on the above default keybinding to trigger the 'Select Language Mode' drop down, I'm assuming that I should be able to pass in another parameter (or refine the "command" string) in a custom keybindinds.json string to force the selection of a specific language's syntax file.
In SublimeText 3, my custom .json keybinding to switch to SQL syntax highlighting just looked like this:
{"keys": ["alt+s"], "command": "set_file_type",
"args": {"syntax": "Packages/SQL/SQL.sublime-syntax"}}
What additional parameter can I pass in to force workbench.action.editor.changeLanguageMode
to select a specific language identifier?
https://code.visualstudio.com/docs/languages/identifiers
https://github.com/Microsoft/vscode/blob/2e2b47a4944ad1dfc7bbc58756c91aa3188cfa04/src/vs/workbench/browser/parts/editor/editorStatus.ts
It looks like it is currently not possible to directly set the language for a file. The workbench.action.editor.changeLanguageMode
command does not take any arguments, but instead uses the quick picker to get the language after the initial command call (github). Extensions do not have a way of manipulating this either.
Here is a related issue asking for this to be exposed to the API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With