Can we customize VS Code so that it automatically detects the language that we are writing and activates the extensions of that language only?

26 Views Asked by At

As you know when there are many extensions in VS Code then it takes more memory. Can we customize VS Code so that it can detect the language and activate the extensions for that language only? All other extensions would be deactivated, like when we write C++ code then it will activate the extensions for C++ code and will turn off all the extensions for other languages like python, java, etc. And when we write python code then it'll activate the extensions for python and will turn of all other extensions. When there is no file open in VS Code then all the programming extensions are deactivated. If we can customize the VS Code like this then how to do it?

I tried it by going to the files > preferences > settings then searching files.association then I have opened a json file where I added this line of code:

"files.associations": {
  "*.cpp": "c++",
  "*.py": "!python"
}

for like deactivating the python extensions while writing C++ code but when I write python code it is still deactivated. But, I want it to reactivate when I write python code.

0

There are 0 best solutions below