Setting the Language of a Visual Studio Code File without Saving

1 Comment

Ever use Visual Studio Code and want to set the language of a file without having to save it?

Let’s say we have copied some code from somewhere, or we are creating a new file from scratch. Below I have some JavaScript in a file, and the code is all the same color, i.e. VS Code has not recognized this file as JavaScript:

To change the language of the file, in the bottom right, select Plain Text. This will open the Select Language Mode bar:

In selecting JavaScript, the file is now recognized:

Alternatively, press ALT+SHIFT+P to bring up the Language Mode settings and do the same thing.

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

One Response to Setting the Language of a Visual Studio Code File without Saving

Leave a Reply

Your email address will not be published. Required fields are marked *