-
Notifications
You must be signed in to change notification settings - Fork 231
Ensure code minings are rendered when editor is initially opened #3689
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
Ensure code minings are rendered when editor is initially opened #3689
Conversation
Test Results 2 854 files - 164 2 854 suites - 164 2h 14m 12s ⏱️ - 15m 42s Results for commit c3bcdf0. ± Comparison against base commit 62f3974. This pull request skips 3 tests.♻️ This comment has been updated with latest results. |
|
Should viewer in the constructor maybe also assigned to fViewer? Without knowing to much about the code, it looks weird to me that viewer is passed to the constructor but ignored. Could that result in another NPE? Suggested fix: |
Steps to reproduce? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a NullPointerException that prevents code minings from being displayed when an editor is initially opened. The issue occurs when isInVisibleLines() is called before the support field has been initialized via setSupport().
Changes:
- Added null checks for the
supportfield in both overloadedisInVisibleLines()methods - Returns
trueoptimistically when support is not yet available, allowing annotations to be rendered during editor initialization
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Here the steps to reproduce the problem. Lars has already shown it in eclipse-jdt/eclipse.jdt.ui#2698 (comment).
2. Open a Java editor with a source where the code minings should be visible. The code minings are initially not visible. They become visible when the source is modified. Here a screencast showing the problem scenario:
code_mining_in_java_editor.mp4Following exception is thrown but not logged when opening the Java editor which stops the code mining to be rendered. |
You are right, this looks weird but is not the reason for the problem. Should I anyhow add the assignment |
a81721f to
1c3ad70
Compare
No, this deserves extra fix, as the change will be much bigger. Note: similar to the checks you've added for "support", similar checks must be added for the |
1c3ad70 to
15cbafc
Compare
Ok @iloveeclipse , done with the latest push ([15cbafc]). |
....eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
Outdated
Show resolved
Hide resolved
15cbafc to
06851d8
Compare
|
@iloveeclipse FYI - Gemini code review is in my opinion really good and free, it only needs to be enabled for a repo by the admin. If you start using AI code review you may want to have a look at it (for example by enabling it for your fork) |
....eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java
Show resolved
Hide resolved
|
Could you please add this patch on top |
Add a null check for the `support` field in the `AbstractInlinedAnnotation` class to prevent `NullPointerException` when the `isInVisibleLines` method is called. This issue occurs because `support` may not be initialized when the editor is first opened, causing code minings to not render initially.
06851d8 to
c3bcdf0
Compare
|
@tobiasmelcher : thanks. |

This PR fixes a NullPointerException that currently interrupts the code‑mining rendering pipeline. Due to this exception being thrown during editor initialization, no code minings are displayed when the editor is opened.
The problem is fixed by adding a null check for the
supportfield in method callAbstractInlinedAnnotation.isInVisibleLines().