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

Improvement: Auto detect language mode if two extensions contribute to the same filename or file extension #233894

Open
thernstig opened this issue Nov 15, 2024 · 1 comment
Labels
feature-request Request for new features or functionality languages-guessing Language guessing issues

Comments

@thernstig
Copy link
Contributor

thernstig commented Nov 15, 2024

As an example, the Go extension contributes the following:

      {
        "id": "gotmpl",
        "extensions": [
          ".tmpl",
          ".gotmpl"
        ],
        "aliases": [
          "Go Template File"
        ]
      }

The .tmpl is used by many languages. According to microsoft/vscode-docs#2862 what VS Code does here, is to associate the .tmpl file with the extension that comes first in alphabetical order, in the case where two more more extensions associate different language ids (modes) with this extension.

My proposal is that VS code instead, if there is a clash, uses the Auto Detect feature of which language mode to use. And falls back to alphabetical if that does not work, and gives a notification about this. The notification should include:

  • Which extension contributes to the extension name (or filename)
  • The associated language id
  • Which extension was chosen to identify the language mode. And why it was chosen (auto detect or not).
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@thernstig thernstig changed the title Improvement: Auto detect language mode if two extensions contribute to the same extension name Improvement: Auto detect language mode if two extensions contribute to the same filename or file extension Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality languages-guessing Language guessing issues
Projects
None yet
Development

No branches or pull requests

3 participants