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

client, server: "Verify with CN" code lens appears in the wrong place #158

Open
samcowger opened this issue Feb 19, 2025 · 1 comment
Open

Comments

@samcowger
Copy link
Contributor

@cpitclaudel reports an instance of the "Verify with CN" lens (introduced in #152) appearing in the wrong place:

Image

If I paste this function into a window in my own VSCode, I see the lens show up in the right place. However, if I paste it such that it begins on line 4, then move it back up to line 1, I can reproduce this issue.

I think the simplest explanation is that the server does not publish/modify lenses frequently enough, e.g. in response to a file being edited. This makes some sense; #152 only gave the server the ability to respond to lens requests, and assumed that the client would send them with appropriate frequency. Evidently, it does not. We should check to see if

  • the client can be configured to request lenses more often, and/or
  • the server can be configured to proactively publish lenses whenever it sees that a file has changed.
@samcowger samcowger changed the title server: "Verify with CN" code lens appears in the wrong place client, server: "Verify with CN" code lens appears in the wrong place Feb 19, 2025
@samcowger
Copy link
Contributor Author

Actually, I think this is really #160 in disguise. No matter how often I have the client request lenses, the server will still calculate their locations based on whatever version of the document exists on disk. Fixing this properly will probably require that the server keep track of a user's changes to a file, as mentioned in #160 (comment).

For the time being, though, I've also seen that saving a document will trigger the server to recalculate lens locations, so if someone does see a lens out of place, saving the document should put it back where it belongs. I've also opened #164 to put the name of a function in its verification lens, which should prevent a user from accidentally verifying the wrong function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant