Skip to content

By default hpp files are not opened with CDT editor anymore if tm4e language pack is installed #151

@iloveeclipse

Description

@iloveeclipse

Initially reported at tm4e: eclipse-tm4e/tm4e#437

  1. Get 4.25 SDK
  2. Create simple project and empty hello.hpp file
  3. Install CDT SDK into it, restart
  4. Double click on hello.hpp - it is opened in default C++ editor from CDT.
  5. Right click in explorer -> "Open with" shows C++ editor in the proposed editors list
  6. Close C++ editor.
  7. Install org.eclipse.tm4e (TextMate support in Eclipse IDE, 0.5.1.202207061559) and org.eclipse.tm4e.language_pack (TextMate Language Pack, 0.1.0.202206131926)
  8. Restart Eclipse
  9. Double click on hello.hpp - it is opened in generic text editor, NOT with CDT C++ editor.
  10. Right click in explorer -> "Open with" does NOT show C++ editor in the proposed editors list

Both CDT and tm4e define content types for hpp files, CDT with high prio, tm4e with low:
https://github.com/eclipse/tm4e/blob/972061af2add6231c5667e31f83d393c102bdf9b/org.eclipse.tm4e.language_pack/plugin.xml#L69

Commenting line above in tm4e plugin.xml fixes the issue.

This seem to be a bug in the platform. CDT contribution priority is high, tm4e is low. tm4e generic editor shouldn't ever be opened by default if CDT is installed.

However, interesting fact is that cpp files can still be opened with CDT C++ editor (even if tm4e also defines the content type for them, in the same line with hpp files).

May be related code:

private final Comparator<IContentType> policyConstantGeneralIsBetter = (IContentType o1, IContentType o2) -> {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions