Is it currently possible to associate a given language with a file extension that is not typically associated with that language?
Visual Studio for Mac v7.5. Try the new assisted IntelliSense experience by downloading our experimental extension for Visual Studio 2017 version 15.7 or higher. Visual Studio Code for Mac Developers. Introduction to Extensions. Jun 01, 2016 at 10:47PM. By Jonathan Rozenblit, Sergii Baidachnyi. Average of 5 out of 5 stars 2 ratings. PowerShell extension is a very good example of how to use powerful Code editor not just for Web development but for many different tasks including IT Professional stuff. Tag: Visual Studio Code.
Say I have a filetype *.foo, and I want to associate it with JavaScript for syntax highlighting. Does anyone know if this is currently possible with VSCode?
I am working in a language that is syntactically similar to Visual Basic, and want to associate it with that language type. I understand that you can assign a language after the file is opened, however this is cumbersome to do each time a file is opened.
In Sublime Text for example it is possible to select 'Open all with current extension as...'. Does this exist yet for VSCode?
EDIT: The Visual Studio Code team has added a proper way to add both themes and languages.
Cœur5 Answers
VSCode v1.0 officially adds the File to Language Association feature. Add the following into .vscode/settings.json
:
You may find more details in the Visual Studio Code 1.0.0 release notes “File to language association” section.
Rory O'KaneVisual Studio For Mac Os X
You can do it yourself:For this example I'll add the '.ino' files to the C++ plugin.
Navigate to the folder containing the corresponding plugin:C:UsersusernameAppDataLocalCodeapp-0.1.0resourcesapppluginsvs.language.cpp
Open the ticino.plugin.json file and edit contributes.language.extension. In this case, you go from:
to
There is an update to the answer of this question, so I wanted to update it.
The Visual Studio Code team released a proper way to add new Languages and Themes to the application using a Yeoman generator with TextMate tmBundles which is documented here:
and here:https://code.visualstudio.com/updates#_customization-adding-language-colorization-bracket-matching
[Edit: The above answer didn't work for me (strange) - but I reworked it to the following]
Visual Studio For Mac Extensions Manager
Open the file
replace
with
We're simply adding the mime-type to the array of known text mimes.
- Go to File >Preferences >Settings
- In the right tree-view, expand Text Editor and choose Files
- In the Associations section click Edit in settings.json
In the right editor, you can add your associations. Here is a sample that adds the extension .hpp