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 method references CodeLens #5928
Conversation
let position = from_proto::file_position(&snap, doc_position.clone())?; | ||
let locations = snap | ||
.analysis | ||
.find_all_refs(position, None) |
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.
Hm, yeah, I am still not happy about factoring here -- way to many logic happens in the handlers.
But it also is non-trivial to properly factor the logic given the two-phase requests.
I think there's a better solution here, but I haven't looked in the details yet. I expect we want to use exactly the same pattern for code lenses as for assists.
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.
I just reuse existing find_all_refs method and convert the results to LSP types. And that's all.
I think there's a better solution here, but I haven't looked in the details yet.
Perhaps we can (should) utilize the fact that Code Lens Request supports partial results. But it requires a lot of work and if you do not mind I'd prefer to leave it for another PR.
Yeah, current reference search does not support all kinds of things
unfortunately.
…On Wednesday, 2 September 2020, vsrs ***@***.***> wrote:
By the way, one question. Current reference search mechanism does not
support trait implementations:
[image: image]
<https://user-images.githubusercontent.com/62505555/92008409-ce720680-ed4f-11ea-8cf3-11704586d0d5.png>
It is possible to detect such situations and do not show No references
lens. However, I decided to leave it as it is in case someday RA will
support it. Am I right or am I missing something??
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5928 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3M2XC5HBKZ2WMTFWDNTSDZVPVANCNFSM4QRXSVDA>
.
|
@vsrs I think |
r=me with #5928 (comment) addressed bors d+ |
✌️ vsrs can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
The PR adds CodeLens for methods and free-standing functions:
Relates to #5836