eclipse-platform / eclipse-platform/eclipse.platform
Child content types without "builtInAssociations" considered matching for specific file names
- Dominant language
- Java
- Stars
- 165
- Forks
- 174
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 22
Description
Follow up on https://github.com/eclipse/tm4e/issues/703#issuecomment-1944801545.
It looks like we have a strange content type handling that results in https://github.com/eclipse/tm4e/issues/703 (as one example).
Here what was found by @sebthom:
> Ok, I could reproduce it. As I suspected, the issue is in the Eclipse Platform. When querying content types for a file, eventually [ContentTypeCatalog#selectMatchingByName](https://github.com/eclipse-platform/eclipse.platform/blob/e7069db92859e15a44852ff753b9edeec2c1d7ed/runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java#L700-L729) will be invoked.
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 no `file-extensions`, `file-patterns`, `file-names` defined. So it will return these additional content types if the language pack is installed:
- org.eclipse.tm4e.language_pack.basetype
- org.eclipse.tm4e.language_pack.markdown-math
- org.eclipse.tm4e.language_pack.markdown_latex_combined
- org.eclipse.tm4e.language_pack.cpp_embedded_latex
I don't think this behavior is correct.
_Originally posted by @sebthom in https://github.com/eclipse/tm4e/issues/703#issuecomment-1944801545_
Contributor guide
Assessment
This issue has not been assessed yet.