Force VS Code to open new files as the same type as current file open

Viewed 30

I could have sworn this was added as a feature a while back, but has now been removed with a recent update? Example, if I have my_file.ts open, and I go to new => file, I want it to create Untitled-1.ts as a TS file instead of plain text. I can't find it in the settings and I don't even know what to search for really. I'm sure it's in the settings somewhere.

1 Answers

Found it. It's files.defaultLanguage. If you set it as ${activeEditorLanguage} it will do what you've described. I wouldn't aware of this option before :)

screenshot of settings

Reference

Related