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

Remember computed content type in CompareConfiguration #1294

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

iloveeclipse
Copy link
Member

Remember detected content type id in CompareConfiguration with the CONTENT_TYPE key. This value can be picked up as a hint by TextMergeViewer implementations (like GenericEditorMergeViewer) that need to know which content type was detected by compare editor.

Most TextMergeViewer implementations don't need that hint because they aren't generic and usually always know which content type they will have

  • not so for GenericEditorMergeViewer which is generic.

The hint allows GenericEditorMergeViewer to know for which content type was it actually created and so use that in cases where the content type can't be always derived from the input (like data from git revisions that don't have regular files or buffers associated to the viewer).

See eclipse-platform/eclipse.platform.ui#1747

Remember detected content type id in CompareConfiguration with the
CONTENT_TYPE key. This value can be picked up as a hint by
TextMergeViewer implementations (like GenericEditorMergeViewer) that
need to know which content type was detected by compare editor.

Most TextMergeViewer implementations don't need that hint because they
aren't generic and usually always know which content type they will have
- not so for GenericEditorMergeViewer which is generic.

The hint allows GenericEditorMergeViewer to know for which content type
was it actually created and so use that in cases where the content type
can't be always derived from the input (like data from git revisions
that don't have regular files or buffers associated to the viewer).

See eclipse-platform/eclipse.platform.ui#1747
iloveeclipse added a commit to iloveeclipse/eclipse.platform.ui that referenced this pull request Apr 8, 2024
Detected content type id could be retrieved now from the
CompareConfiguration with the CONTENT_TYPE key (see
eclipse-platform/eclipse.platform#1294).

Use this value (if available) as fallbackContentTypes in
ExtensionBasedTextViewerConfiguration.

The allows GenericEditorMergeViewer to know for which content type
was it actually created and so use that in cases where the content type
can't be derived from the input (like data from git revisions
that don't have regular files or buffers associated to the viewer).

Fixes eclipse-platform#1747
Copy link
Contributor

github-actions bot commented Apr 8, 2024

Test Results

   639 files  ±0     639 suites  ±0   40m 57s ⏱️ - 4m 59s
 3 946 tests ±0   3 924 ✅ +1   22 💤 ±0  0 ❌ ±0 
12 444 runs  ±0  12 283 ✅ +1  161 💤 ±0  0 ❌ ±0 

Results for commit 79d8df8. ± Comparison against base commit ce64a2d.

@iloveeclipse iloveeclipse merged commit de6a702 into eclipse-platform:master Apr 8, 2024
16 checks passed
@iloveeclipse iloveeclipse deleted the issue_1747 branch April 8, 2024 16:05
iloveeclipse added a commit to eclipse-platform/eclipse.platform.ui that referenced this pull request Apr 9, 2024
Detected content type id could be retrieved now from the
CompareConfiguration with the CONTENT_TYPE key (see
eclipse-platform/eclipse.platform#1294).

Use this value (if available) as fallbackContentTypes in
ExtensionBasedTextViewerConfiguration.

The allows GenericEditorMergeViewer to know for which content type
was it actually created and so use that in cases where the content type
can't be derived from the input (like data from git revisions
that don't have regular files or buffers associated to the viewer).

Fixes #1747
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.

1 participant