niksfirefly
niksfirefly

Reputation: 759

Set syntax per project for files in Visual Studio Code

Is there a way to set syntax for specific file extensions for a project in Visual Studio Code?

For example set liquid syntax for all HTML files in project A and normal HTML otherwise.

Upvotes: 2

Views: 338

Answers (1)

Gama11
Gama11

Reputation: 34138

Yes, you can remap your files using the following setting:

"files.associations": {
    "*.html": "liquid"
}

(assuming you're using this extension which uses liquid as the language ID)

To apply this only to a particular project, just put this in the workspace-specific settings.json rather than the global one (Preferences -> Settings -> Workspace Settings). More info on settings can be found here.

Upvotes: 2

Related Questions