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

Add CodeLens for references #5836

Closed
lunacookies opened this issue Aug 21, 2020 · 1 comment · Fixed by #7409
Closed

Add CodeLens for references #5836

lunacookies opened this issue Aug 21, 2020 · 1 comment · Fixed by #7409
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@lunacookies
Copy link
Contributor

Currently, the only CodeLenses that rust-analyzer shows are Run above fn main(), Run Test | Debug above tests, and n implementations above struct, enum, union and trait definitions. A useful addition to this would be a CodeLens of the form n references above definitions where this makes sense. When clicked, this CodeLens would show all the references to the symbol the definition defines.

Here’s a list of some possible definitions above which the references CodeLens could be shown:

  • structs
  • enums
  • unions
  • traits
  • free functions
  • functions in impl blocks
  • functions in trait definitions

It might be a good idea to show the CodeLens above enum variant definitions as well as struct and union field definitions, but that might be a bit much.

@vsrs
Copy link
Contributor

vsrs commented Sep 1, 2020

I'm working on it.

bors bot added a commit that referenced this issue Sep 29, 2020
5928: Add method references CodeLens r=vsrs a=vsrs

The PR adds CodeLens for methods and  free-standing functions:

![method_refs](https://user-images.githubusercontent.com/62505555/91858244-95fbfb00-ec71-11ea-90c7-5b3ee067e305.png)

Relates to #5836

Co-authored-by: vsrs <vit@conrlab.com>
@flodiebold flodiebold added the S-actionable Someone could pick this issue up and work on it right now label Dec 21, 2020
@bors bors bot closed this as completed in 83231dd Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants