You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "harshaindunil (via GitHub)" <gi...@apache.org> on 2025/02/11 06:46:01 UTC

[I] CodeLens-style Reference Count in NetBeans Java Editor [netbeans]

harshaindunil opened a new issue, #8230:
URL: https://github.com/apache/netbeans/issues/8230

   ### Description
   
   ![Image](https://github.com/user-attachments/assets/e0c3e9cf-f2b3-4d81-ae21-bf6c5b3fb02e)
   
   **Summary**
   I would like to request a CodeLens-style feature in the NetBeans Java Editor that displays reference counts above methods and classes, similar to Visual Studio. This feature would integrate with the existing Find Usages functionality in NetBeans, allowing users to see and navigate to method/class references efficiently.
   
   **Feature Description**
   This feature would analyze Java source code using the Java Source API and dynamically update a reference count for each method and class. The reference count would be displayed inline above the method/class definition in the editor. Clicking on the reference count should open the existing Find Usages UI, listing all references and allowing users to navigate to each occurrence.
   
   **Key Features & Functionality**
   
   **Display Reference Count Above Methods and Classes**
   - Show how many times a method or class is referenced in the project.
   - Update dynamically when the file or project is modified.
   
   **Integration with Existing "Find Usages" Feature**
   
   - Clicking on the reference count should trigger Find Usages.
   - Display results using the existing "Find Usages" UI, ensuring consistency with NetBeans’ workflow.
   
   **Non-intrusive UI Design**
   
   - Display the reference count inline above the method/class, not in the gutter.
   - Allow enabling/disabling the feature via settings.
   
   **Efficient and Performant**
   
   - Perform the analysis in the background using NetBeans Java Source API.
   - Optimize for large projects by leveraging Find Usages indexing instead of scanning files manually.
   
   **Why This Feature is Important?**
   
   - Boosts productivity by eliminating the need to manually run "Find Usages" for frequently used methods.
   - Improves code readability by instantly showing usage counts.
   - Enhances navigation by providing quick access to usages through a familiar UI.
   
   **Implementation Approach**
   
   1. Use Java Source API to analyze method and class references.
   2. Display reference count annotations above methods/classes in the editor.
   3. On clicking the reference count, invoke the existing Find Usages UI to display results.
   
   **Additional Notes**
   This feature would modernize the NetBeans Java Editor by providing a lightweight but powerful way to navigate code references. Since NetBeans already has a strong Find Usages implementation, this proposal focuses on seamless integration rather than reinventing functionality.
   
   Would love to hear thoughts from the NetBeans team and community!
   Thanks for considering this feature request.
   
   ### Use case/motivation
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] CodeLens-style Reference Count in NetBeans Java Editor [netbeans]

Posted by "dasTanmoy0096 (via GitHub)" <gi...@apache.org>.
dasTanmoy0096 commented on issue #8230:
URL: https://github.com/apache/netbeans/issues/8230#issuecomment-3690569593

   Would love to see this implemented in the LSP Serve


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] CodeLens-style Reference Count in NetBeans Java Editor [netbeans]

Posted by "Chris2011 (via GitHub)" <gi...@apache.org>.
Chris2011 commented on issue #8230:
URL: https://github.com/apache/netbeans/issues/8230#issuecomment-2652077124

   It should be possible by adding this with the virtual text that @jlahoda introduce a while ago. I also wanted to have a look and this is defintely a nice and handy feature, not only for the java editor.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists