CodeLens-style reference count hint to the NetBeans Java editor. #9318
Replies: 1 comment
-
sounds good to me. First integration wouldn't have to cover all aspects (e.g LSP server) as long the implementation doesn't make future extension impossible which is probably not the case. Its good to keep scope small at first.
This would be NetBeans first inline hint which is drawn between lines I believe. I know this is popular and don't have anything against it, but I believe it would be worth considering a usage mode which does not rely on inline text too. Lets say it would work analog to the ctrl+click of the goto-declaration feature, but backwards, opening the usage popup instead. This mode would also avoid some of the performance concerns since it is lazy/on-demand. But since you already started with inline hints, its probably too late to reduce the scope to simple popup action first - which would likely be a smaller change. Lets see how the code looks we can add that later too.
popup is probably the most convenient solution here.
right, you seem to have already accounted for that. User can still chose based on preference to get the full tree view -> excellent
this is something we likely can't enable by default for now since performance wouldn't be predictable. (knowing how find usages works atm #8957). But inline hints are already off by default and mapped to a hotkey, so it would already be covered I think. feel free to open a draft PR - even if it isn't done yet. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been working on a prototype for #8230, and before opening a PR I would like to get feedback on the overall direction and scope.
Summary
The feature adds a CodeLens-style reference count hint to the NetBeans Java editor.
For Java methods and named types, the editor shows an above-line hint such as:
1 reference5 referencesClicking the hint opens a lightweight popup with grouped references, and from there the user can navigate to usages or open the full existing Find Usages results.
Scope of the current implementation
This is currently limited to the Swing Java editor only.
Implemented behavior:
Tools > Options > Editor > Inline Hints > Show reference countsMain implementation areas
The current implementation touches these areas:
Performance work done
I initially observed noticeable editor slowdown, especially on larger files.
To address that, the current implementation now:
With these changes, the feature now appears stable in my testing and no longer shows obvious scrolling or split-editor issues.
Areas where I would like feedback
Before I submit a PR, I would especially like feedback on these points:
Feature scope
UI direction
Reuse of Find Usages
Performance expectations
Current intent
If there are no major objections to the approach, I plan to open a PR for #8230 with:
I would appreciate feedback before I finalize the PR.
Beta Was this translation helpful? Give feedback.
All reactions