microsoft / vscode

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

File association set to `plaintext` contributed by extensions/user does not take precedence over auto detect #134571

Closed felipecrs closed 11 months ago

felipecrs commented 3 years ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

https://user-images.githubusercontent.com/29582865/136839408-80819cdc-a83c-4b3c-bc4d-dd16ea48f3a1.mp4

Even though I set .shellcheckrc to be plaintext, VS Code does not respect that.

TylerLeonhardt commented 3 years ago

@felipecrs can you check if this repros in 1.61 that was released last week? 1.60 had a race condition that was causing your issue and so I'm pretty sure it's fixed in 1.61.

Keep in mind that .shellcheckrc being set to plaintext may still cause the auto detect, but any other language shouldn't

felipecrs commented 3 years ago

It is exactly as you said. The plaintext still triggers the auto-detection but other languages not.

As realized in https://github.com/koalaman/shellcheck/issues/2355, the plaintext would probably be our proffered option for file format as of now.

I think VS Code should differentiate when plaintext is set by default (when no other format is chosen) than when it's explicitly set by either the user or contributed by the extensions.

Would you like me to open another issue for this?

TylerLeonhardt commented 3 years ago

Would you like me to open another issue for this?

No need I'll just edit this one. Can you maybe add a replacement gif?

Basically, this only seems to happen if file associations are set via settings or an extension. If you manually set the language to plaintext via the language picker, it won't switch off of it.

felipecrs commented 3 years ago

No need I'll just edit this one. Can you maybe add a replacement gif?

Done. Thank you!

TylerLeonhardt commented 11 months ago

/duplicate https://github.com/microsoft/vscode/issues/138664

vscodenpa commented 11 months ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!