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

The "depth" to a content type matters when deciding the best one #310

Closed
wants to merge 1 commit into from

Conversation

jonahgraham
Copy link
Member

@jonahgraham jonahgraham commented Mar 7, 2023

Although not obviously documented, the "depth" of a content type (how many base-types there are, recursively) matters to choosing which content type to use. See the code in platform that has been like this since ~2005.

Therefore, change the definition of cxxSource to make it the same depth as the other types in CDT.

This solves the practical case where TM4E provides content types for C++ file types, but the priority there is low, but because to the lesser depth it takes priority.

platform: https://github.com/eclipse-platform/eclipse.platform/blob/9839c18f52687db6f949bdb56a59a5d20cd7c938/runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java#L43-L60
tm4e: https://github.com/eclipse/tm4e/blob/99a5df037be1e3114f7f88115f46c34b1d27a297/org.eclipse.tm4e.language_pack/plugin.xml#L69

Fixes eclipse/tm4e#499

Although not obviously documented, the "depth" of a content
type (how many base-types there are, recursively) matters to
choosing which content type to use. See the code in platform
that has been like this since ~2005.

Therefore, change the definition of cxxSource to make it the
same depth as the other types in CDT.

This solves the practical case where TM4E provides content
types for C++ file types, but the priority there is low,
but because to the lesser depth it takes priority.

platform: https://github.com/eclipse-platform/eclipse.platform/blob/9839c18f52687db6f949bdb56a59a5d20cd7c938/runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java#L43-L60
tm4e: https://github.com/eclipse/tm4e/blob/99a5df037be1e3114f7f88115f46c34b1d27a297/org.eclipse.tm4e.language_pack/plugin.xml#L69
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

Test Results

   540 files     540 suites   18m 21s ⏱️
9 657 tests 9 634 ✔️ 22 💤 1
9 679 runs  9 656 ✔️ 22 💤 1

For more details on these failures, see this check.

Results for commit 0e97cdb.

@jonahgraham
Copy link
Member Author

This change is only for CDT if eclipse/tm4e#500 is not acceptable solution

@jonahgraham jonahgraham marked this pull request as draft March 8, 2023 14:35
@jonahgraham jonahgraham added this to the 11.2.0 milestone Mar 14, 2023
@jonahgraham
Copy link
Member Author

With the fix for eclipse-platform/eclipse.platform#151 merged this is now resolved in platform.

@jonahgraham jonahgraham deleted the content-type-depth branch April 15, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TM4E language_pack definitions taking priority over CDT ones in some cases
1 participant