Or is there a way to switch the current file's language to use syntax highlight feature?
For example, *.jsx
actually uses JavaScript but VS Code doesn't recognize it.
In Visual Studio Code, you can add persistent file associations for language highlighting to your settings.json
file like this:
// Place your settings in this file to overwrite the default settings
{
"some_setting": custom_value,
...
"files.associations": {
"*.thor": "ruby",
"*.jsx": "javascript",
"Jenkinsfile*": "groovy"
}
}
You can use Ctrl+Shift+p and then type settings JSON
. Choose Preferences: Open Settings (JSON) to open your settings.json
.
The Files: Associations
feature was first introduced in Visual Studio Code version 1.0 (March 2016). Check the available wildcard patterns in the release notes and the known language strings in the documentation.