Skip to content

Support for multiple language with same file extension #1042

Description

@jensli

There doesn't seem to be a way for users to manage multiple languages, with separate grammars and language definitions, but that share a common file extension.

This is especially problematic when a user wants to add a custom language with a custom language pack, but the file extension is already used by one of the bundled languages in the language pack. In this case it seem like the bundled language always get precedence, and files are always opened using the syntax colours of the bundled language. This makes in impossible to use the a custom language which share a file extension with any of the bundled languages.

This is a Stack Overflow question about such a problem, together with a work around: https://stackoverflow.com/questions/80001887/eclipse-generic-code-editor-uses-the-wrong-textmate-grammar

Suggested solution 1

Add an editor context menu entry which allows the user the select which language that should be used in a particular editor.

Eclipse should remember the user choice and use that language for files with the same file extension in the future.

Alternative solution 2

Allow the user to remove the file extension association from bundled languages in the TextMate > Grammars settings page.

Alternative solution 3

Use the Eclipse content type framework in some way to let the user associate a file extension with a particular language. I don't know exactly how this could work.

Version

0.18.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions