-
Notifications
You must be signed in to change notification settings - Fork 113
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
Child content types without "builtInAssociations" considered matching for specific file names #1207
Comments
I don't know what kind of use case was behind originally implemented code, may be there is a test that would fail, let see: #1209 |
Some more infos:
With the current behaviour if I define a content type like this: <content-type
id="contenttype.example"
base-type="org.eclipse.core.runtime.text"
name="Example"
file-extensions="example" />
However if I configure the content type like this which: <content-type
id="contenttype.example"
base-type="org.eclipse.core.runtime.text"
name="Example" />
<file-association
content-type="contenttype.example"
file-extensions="example" />
I think this strongly violates the Principle of Least Surprise The big question is how can I define a content type that does not inherit its base type's file assocations without setting new file associations. I.e. if you want an intermediate content-type that has no file associations or where the content type is determined based on the content itself. The ugly workaround at the moment is <content-type
id="contenttype.example"
base-type="org.eclipse.core.runtime.text"
name="Example"
file-extensions="PUT_SOME_VALUE_THAT_HOPEFULLY_NO_ONE_ELSE_USES" /> |
Follow up on eclipse-tm4e/tm4e#703 (comment).
It looks like we have a strange content type handling that results in eclipse-tm4e/tm4e#703 (as one example).
Here what was found by @sebthom:
When this method is called with the file extension "txt" it will return the directly mapped contenttype
org.eclipse.core.runtime.text
and all child content types that have no "builtInAssociations", e.g. have nofile-extensions
,file-patterns
,file-names
defined. So it will return these additional content types if the language pack is installed:I don't think this behavior is correct.
Originally posted by @sebthom in eclipse-tm4e/tm4e#703 (comment)
The text was updated successfully, but these errors were encountered: