microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.5k stars 29.39k forks source link

Allow for disabling certain languages from auto language detection #143817

Open lramos15 opened 2 years ago

lramos15 commented 2 years ago

To help language detection be more tuned towards languages I use it would be great if I could choose a subset of languages from the possible language set to be used for auto detection.

For example I don't program in Coffeescript or Perl but they often get autodetected for other code snippets.

JacksonKearl commented 2 years ago

I actually just removed this in favor of keeping track of what files you open and which are in the workspace. Though the changes there won't impact the existing model, if that picks a language it gets used no matter what. The results are better if some languages are removed from consideration entirely rather than just weighted against, so I might add that back.

@TylerLeonhardt and I discussed having an option to always use the new model which might help here.

saramorillon commented 1 year ago

Hello, I think this would be a great feature. Are there any news about it? Thanks.

jimmy-zhening-luo commented 3 months ago

I'd like to +1 this feature. Automatic language detection is particularly problematic for new, unsaved files. For new files, 9 times out of 10, JSON(C) is interpreted as CoffeeScript or some other nonsense, a language I have never used. This includes famous examples such as:

I often hear the argument (on Stack Overflow, from bad devs), "Just save the file." This is non-sensical. If files must be saved to be usable, then VSCode should make the editor readonly for a new file until they are saved, in which case VSCode should remove the ability to add a new file from the editor (not explorer) view.

However, given VSCode, as a text editor, decided to have those features, can you please give us the ability to remove certain languages entirely from scope? PARTICULARLY COFFEESCRIPT ðŸ˜