-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Implement codeLens/resolve
for some code lenses
#3536
Comments
It turns out that this is especially important for code lenses because of some subtlety about using stale results. HLS lets you request either accurate or possibly-stale information. The advantage of getting the stale information is that it's much faster. Using possibly-stale information when possible improves responsiveness, and this is especially important for code lenses as they appear in the buffer, and so if they take too long to compute we can observe flickering. However, for actually applying the edit from a code lens we ideally want fully up-to-date information. So the ideal thing to do is:
|
We should Particularly, I think we should use |
I think we actively don't want stale results though, right? Suppose I have e.g. a hotkey to trigger the type signature code lens, and I quickly edit a function to add a new argument and then hit the hotkey. I really don't want to get the type signature without the new argument - I'd much rather wait. |
There might be a bit of confusion here, which is understandable given that there are three rather poorly named functions here
|
In this situation, you'll get a correct edit if your code parsed succeed, or an invalid one if parsing failed. In some situations, the staled result still makes sense. This staled lens is correct even if my code can't parse temporarily. That means we have to trade off the value of the staled result. As for |
Ah I see. Then I guess |
No, Most plugins are running with |
We did this |
Same as #3534 but for code lenses. Again, ideally this would come with generic support to make it easy to add to new code lens providers.
The text was updated successfully, but these errors were encountered: