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

Closed
thernstig opened this issue Nov 15, 2024 · 5 comments
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 extensions 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
@RedCMD
Copy link
Contributor

RedCMD commented Nov 15, 2024

first in alphabetical order

other way around, last has priority
and it checks against the full extension id of {publisher_name}.{extension_name}

user extensions have priority over builtin extensions
and debugging an extension has higher priority again

Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2025
@thernstig
Copy link
Contributor Author

Understand it is hard getting through things due the bot and requirement of 20 upvotes, but this request is needed due to the ambiguity of what is chose. It is and will always create problems for users.

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

4 participants