Skip to content

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

@SnirBroshi

Description

@SnirBroshi

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"

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issuesinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions