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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to