microsoft / vscode

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

LICENSE-ANYTHINGINCAPITALS treated as Markdown #165116

Closed peter-lyons-kehl closed 1 year ago

peter-lyons-kehl commented 1 year ago

Replicable in current Insiders (currents as shipped by Manjaro Linux):

Does this issue occur when all extensions are disabled?:

Steps to Reproduce:

  1. Open any file with a name starting with LICENSE- and with capitals after the hyphen, like LICENSE-MIT
  2. The file is treated as Markdown (it activates/applies a Markdown-specific extension, see https://github.com/DavidAnson/vscode-markdownlint/issues/257). He's a VS Code extension/API expert (much more than me), so I find him credible.

On the contrary

  1. Open LICENSE
  2. The file is not treated as Markdown (it doesn't activate/apply "markdownlint").
mjbvz commented 1 year ago

I do not see this in my testing:

Screen Shot 2022-11-01 at 12 55 28 AM

Notice how the file mode is plain text

I suspect this is either coming from some extension or you've configured the files.associations setting so that LICENSE* files are treated as markdown

peter-lyons-kehl commented 1 year ago

Thank you Matt @mjbvz for showing me the file type/mode in the status bar (I usually have the status bar hidden).

To help your or others reproduce this, or to narrow it down:

Please suggest steps for me, or re-open & investigate/delegate.

mjbvz commented 1 year ago

What about the files.defaultLanguage setting?

peter-lyons-kehl commented 1 year ago

No value seems to show up for files.defaultLanguage - I don't even see any input box/checkbox/dropdown list for this setting: image

That Markdown detection somehow depends on the file name being in CAPITAL-CASE. lowercase-named-file shows up as Plain Text: image

If there is any more efficient way to get my settings to you (or to anyone else), I'm happy to ZIP up whatever needed. (I'm on Manjaro Linux, have 3 VS Code installations: Insiders, (stable) VS Code and Code - OSS.)

peter-lyons-kehl commented 1 year ago

The problem shows up only if the filename starts with LICENSE- (in CAPS). A different prefix - even if in CAPS - makes it Plain Text: image

mjbvz commented 1 year ago

This happens on no machines I've tested. You can send me your settings but tbh this isn't a priority issue