Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[built-in extensions] All files with a matching file extension should be considered to be of the relevant language #103042

Closed
NotWearingPants opened this issue Jul 21, 2020 · 0 comments · Fixed by #103044 or #103326
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@NotWearingPants
Copy link
Contributor

Some extensions only apply languages to files with an exact name by default.
They should instead include all files ending with the relevant extension, regardless of the prefix.

Examples I found are:

  • The npm extension applies the Properties language only to files named exactly .npmrc, e.g. not to john.npmrc
  • The npm extension applies the Ignore language only to files named exactly .npmignore, e.g. not to server.npmignore
  • The git extension applies the Ignore language only to files named exactly .gitignore, e.g. not client.gitignore

The built-in file icon theme recognizes these files by their extension and shows the matching icons besides them,
but some extensions don't apply the relevant language to it.

A project might include multiple files of the same type in the same folder, and configure their tools to use one or the other,
depending on the need. All of the files should have the correct language regardless of their filename, all that should matter is the file extension.

Repro: Create and open a file named server.gitignore
Expected: The language mode will be set to the "Ignore" language
Actual: The language mode is "Plain Text"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
5 participants
@joaomoreno @JacksonKearl @sandy081 @NotWearingPants and others