{ "key": "ctrl+k m", "command": "workbench.action.editor.changeLanguageMode" },
Based on the aforementioned default key join, in order to release “Select Language Mode”, I assume that I should be able to pass another parameter (or refine the “command” line) in the user keybindinds.json line to force the choice of a specific language syntax file.
In SublimeText 3, my custom .json keybinding for switching to SQL syntax highlighting looked like this:
{"keys": ["alt+s"], "command": "set_file_type", "args": {"syntax": "Packages/SQL/SQL.sublime-syntax"}}
What additional parameter can I pass to force me to workbench.action.editor.changeLanguageModeselect a specific language identifier?
workbench.action.editor.changeLanguageMode
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 the file. The command workbench.action.editor.changeLanguageModedoes not accept any arguments, but instead uses a quick selector to get the language after the initial invocation of the command ( github ). Extensions also do not have the ability to manipulate this.
Here is a related issue requiring this to be shown in the API.
You can do this with the extension:
{ "key": "ctrl+shift+8", "command": "changeLanguageMode.change", "args": "sql" }
https://marketplace.visualstudio.com/items?itemName=usernamehw.change-language-mode
Source: https://habr.com/ru/post/1666738/More articles:Aligning list item numbers with surrounding paragraphs - htmlMySQL stored function malfunction, but working as a standalone query - mysqlMKMapView Center and zoom - iosJavascript function override prevention - javascriptКак получить ответ SAML от OKTA для тестирования единицы измерения/интеграции - c#UICollectionView contentOffset after device rotation - iosHow can I bind CMake and SQLite without an external script? - c ++MediaRecord could not start Android 7.1.1 emulator - javaBokeh - how to make HoverTool tooltips snap to dots on a click? - javascriptDifferent OUTPUT when using the MERGE statement? - sqlAll Articles