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

Is "version" in lsp response used to assure file consistency (e.g. for renames)? #3498

Closed
codygman opened this issue Feb 17, 2023 · 5 comments
Assignees
Labels
component: lsp type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@codygman
Copy link

The context is mostly from joaotavora/eglot#1051 (comment) which says:

Probably sending the :version isn't even necessary and Eglot will not perform the check if it isn't present. But if you are the server are going to send one, Eglot assumes its purpose is to assure file consistency and will refuse to perform the edit.

In response to an issue where the user tries to execute a rename and nothing seems to change in emacs with eglot.

@codygman codygman added status: needs triage type: support User support tickets, questions, help with setup etc. labels Feb 17, 2023
@codygman codygman changed the title Is "version" in lsp response used to assure file consistency (e.g. for renames) Is "version" in lsp response used to assure file consistency (e.g. for renames)? Feb 17, 2023
@michaelpj
Copy link
Collaborator

This is unclear. It's handled in lsp mostly, to be honest I'm not 100% sure how it works, so someone would need to take a look.

@michaelpj michaelpj added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. and removed type: support User support tickets, questions, help with setup etc. labels Mar 22, 2023
@July541 July541 self-assigned this Apr 16, 2023
@jameschensmith
Copy link

jameschensmith commented Apr 19, 2023

I believe the issue is at Ide.PluginUtils#L173 ((Just 0) in (J.VersionedTextDocumentIdentifier f (Just 0))). This is my first time going through Haskell code, but by going through Ide.Plugin.Rename I was able to arrive at Ide.PluginUtils. It looks like version is either always 0, or it defaults to 0 if there is no version passed by the client. Hope this helps!

@July541
Copy link
Collaborator

July541 commented Apr 20, 2023

@jameschensmith Thanks for pointing it out! I agree with you, and there is an ongoing pr for both this and #3547.

@maralorn
Copy link
Contributor

This should be fixed by the just merged #3643, maybe you can test this with master or the next hls release, when that happens.

@michaelpj
Copy link
Collaborator

I'm going to tentatively mark this as fixed, please reopen if it recurs after the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: lsp type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

6 participants