-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: Add code lenses with '# of references' (server side) #272
Conversation
This just provides a lens with something like '4 references' next to a header. Clicking on the lens won't actually do anything yet because command handling needs to be implemented by every client.
… cap as otherwise helix wont start
What do you intend to do about that? I believe delegating this to the client is the only option really. At least until LSP spec adds something for that. |
@rchl yes, it is client specific. If some clients really want custom bits to invoke 'find reference' when clicking on a lens, I'm open to adding the required functionality. But otherwise, just having the lens there gives me 90% of the value and I don't mind triggering 'find references' manually with a key binding. |
Currently it feels broken because a command is provided and editors make it look like it's possible to execute it but invoking it fails (differently in different editors I guess). I suggest just expose the missing data (the references) and let the clients handle it. |
Yes, it is different in different editors. VSCode actually shows an error banner which is really annoying. This is why I added whatever data VSCode needs to implement the command on the client side in #284 (+ relevant client-side code here). You'd need to pass |
Yes, that works for me, thanks. |
If it's cheap to provide them right away then IMO it wouldn't be necessary to provide resolve functionality. Unless maybe the data size would be an issue but it's hard to imagine that it would (unless in some pathological cases). |
This just provides a lens with something like '4 references' next to a header.
Clicking on the lens won't actually do anything yet because command handling needs to be implemented by every client.
This (partially) addresses #28
NOTE: after #269 references are resolved incrementally based on document symbols rather than CSTs; which makes 'find references' requests practically free and lenses very cheap. Before #269 a code lens with references would be very expensive.
TODO: