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

Adding new MarkerField via markerSupport extension point to problems view seems impossible #2193

Open
1 task done
travkin79 opened this issue Aug 14, 2024 · 7 comments · May be fixed by #2207
Open
1 task done

Adding new MarkerField via markerSupport extension point to problems view seems impossible #2193

travkin79 opened this issue Aug 14, 2024 · 7 comments · May be fixed by #2207
Labels
bug Something isn't working

Comments

@travkin79
Copy link

I tried adding a new MarkerField to the problems view using the markerSupport extension point. That seems not to be possible with the latest org.eclipse.ui.ide bundle. I was not able to select the new MarkerField in the problems (or markers) view's "Configure Columns..." dialog.

Using the markerSupport extension point I added a new markerContentGenerator and a markerContentGeneratorExtension for the problem view's marker content generator (id=org.eclipse.ui.ide.problemsGenerator). While debugging the code, I found out that my marker content generator was initialized and used the new MarkerField, but the ContentGeneratorDescriptor did not pick up the new MarkerField.

I guess, the method ContentGeneratorDescriptor#getAllFields() is not correct. I think, the ContentGeneratorDescriptor has to collect all MarkerFields provided by the corresponding marker content generator as well as MarkerFields provided by the marker content generator extensions. Instead, ContentGeneratorDescriptor#getAllFields() ignores the registered extensions. It seems, the only place, where marker content generator extensions are considered, is the method ContentGeneratorDescriptor#getFilterReferences().

Did I misunderstand something or do we have to handle marker content generator extensions in most of the ContentGeneratorDescriptor's methods?

Details

My marker support extension looked like that:

   <extension
         point="org.eclipse.ui.ide.markerSupport">
      <markerField
            class="org.eclipse.lsp4e.ui.CustomMarkerField"
            id="org.eclipse.lsp4e.markerField.custom"
            name="Custom">
      </markerField>
      <markerContentGeneratorExtension
            generatorId="org.eclipse.ui.ide.problemsGenerator"
            id="org.eclipse.lsp4e.markerContentGenerator">
      </markerContentGeneratorExtension>
      <markerContentGenerator
            id="org.eclipse.lsp4e.markerContentGenerator"
            name="LSP4E MarkerContentGenerator">
         <markerFieldReference
               id="org.eclipse.lsp4e.markerField.custom">
         </markerFieldReference>
         <markerTypeReference
               id="diagnostic">
         </markerTypeReference>
      </markerContentGenerator>
   </extension>

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
@travkin79 travkin79 added the bug Something isn't working label Aug 14, 2024
@jukzi
Copy link
Contributor

jukzi commented Aug 15, 2024

Feel free to suggest a PR including a testcase showing the benefit.

travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 15, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 15, 2024
@travkin79
Copy link
Author

Hi @jukzi,
I'm working on it, but I have a few problems with compiling the unmodified bundles from master branch.

It seems, one compile error is related to one of your last commits. In my environment the method IFile#readNBytes() is not found. What do I have to change in my environment? Is there a target definition file, I can use? Does the dependency to org.eclipse.core.resources bundle use an obsolete version? My environment has version 3.20.200.v20240513-1323, while the MANIFEST.MF in org.eclipse.search.core demands version [3.1.4.0, 4.0.0).

I have a similar issue with the bundle org.eclipse.ui.workbench where Display#isRescalingAtRuntime() is not found (relates to another commit).

@merks
Copy link
Contributor

merks commented Aug 16, 2024

It's generally easiest to use the automated Oomph setup:

https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#creating-an-eclipse-development-environment

It clones a lot more repos than you need, but it's less error prone than try to set up a single repository.

Minimally you should use the installer's advanced mode and choose the Platform's own SDK product:

image

And select the Platform UI project:

image


My build had an error like this when I tested my own instructions above:

image

But it seems to have recovered from that:

image

@travkin79
Copy link
Author

Thank you very much, @merks. That helps a lot.
I had the same NPE during Oomph installation, but now the projects compile and I can go on.

@jukzi
Copy link
Contributor

jukzi commented Aug 16, 2024

please create an issue at https://github.com/eclipse-jdt/eclipse.jdt.core/issues with the stacktrace in text form

@travkin79
Copy link
Author

please create an issue at https://github.com/eclipse-jdt/eclipse.jdt.core/issues with the stacktrace in text form

Done: eclipse-jdt/eclipse.jdt.core#2828

travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
…ically eclipse-platform#2193

Since extensions can be added and removed and have to be considered when collecting marker fields, marker types, and marker groups,
we cannot create the collections once, we have to create them on demand.
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 16, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
…ically eclipse-platform#2193

Since extensions can be added and removed and have to be considered when collecting marker fields, marker types, and marker groups,
we cannot create the collections once, we have to create them on demand.
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
@travkin79
Copy link
Author

I prepared a pull request for this issue: PR #2207.

travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Aug 19, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker content generator extensions.
By loading marker fields, marker types, and groups from marker content generator extensions that will be possible.
This way, the problems view and markers view can be extended with new columns like, for example, an issue ID and URL to a detailed problem description.

Fixes eclipse-platform#2193
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Sep 9, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker content generator extensions.
By loading marker fields, marker types, and groups from marker content generator extensions that will be possible.
This way, the problems view and markers view can be extended with new columns like, for example, an issue ID and URL to a detailed problem description.

Fixes eclipse-platform#2193
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Sep 11, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker content generator extensions.
By loading marker fields, marker types, and groups from marker content generator extensions that will be possible.
This way, the problems view and markers view can be extended with new columns like, for example, an issue ID and URL to a detailed problem description.

Fixes eclipse-platform#2193
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Sep 18, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker content generator extensions.
By loading marker fields, marker types, and groups from marker content generator extensions that will be possible.
This way, the problems view and markers view can be extended with new columns like, for example, an issue ID and URL to a detailed problem description.

Fixes eclipse-platform#2193
travkin79 added a commit to travkin79/eclipse.platform.ui that referenced this issue Sep 18, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker content generator extensions.
By loading marker fields, marker types, and groups from marker content generator extensions that will be possible.
This way, the problems view and markers view can be extended with new columns like, for example, an issue ID and URL to a detailed problem description.

Fixes eclipse-platform#2193
trancexpress pushed a commit to travkin79/eclipse.platform.ui that referenced this issue Oct 8, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker
content generator extensions.
By loading marker fields, marker types, and groups from marker content
generator extensions that will be possible.
This way, the problems view and markers view can be extended with new
columns. For example, an issue ID and URL to a detailed problem
description.

Fixes: eclipse-platform#2193
trancexpress pushed a commit to travkin79/eclipse.platform.ui that referenced this issue Oct 8, 2024
…m#2193

It was not possible to add new columns to MarkerSupportViews via marker
content generator extensions.
By loading marker fields, marker types, and groups from marker content
generator extensions that will be possible.
This way, the problems view and markers view can be extended with new
columns. For example, an issue ID and URL to a detailed problem
description.

Fixes: eclipse-platform#2193
trancexpress pushed a commit to travkin79/eclipse.platform.ui that referenced this issue Oct 8, 2024
…m#2193

This change adds missing functionality for the extension
'markerContentGeneratorExtension'. So far, ContentGeneratorDescriptor
supports this extension with only getFilterReferences().
I.e. ContentGeneratorDescriptor only lists filter references
of extensions, on top of its own filter references.

With this change, getAllFields(), getInitialVisible() and getMarkerTypes()
are also aggregating values for ContentGeneratorDescriptor
and its extensions.

As a result, e.g. the problems view and markers view can be extended
with new columns. For example, an issue ID and URL to a detailed problem
description.

Fixes: eclipse-platform#2193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants