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

Refactorings work once then fail silently (workspace/applyEdit not sent) #903

Open
pesterhazy opened this issue Apr 2, 2022 · 4 comments
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor
Projects

Comments

@pesterhazy
Copy link
Sponsor

In latest lsp-mode on Emacs, the Change Coll refactoring works once but then fails. Similar problems happen with other refactorings, like Unwind Thread.

To Reproduce

• New file with contents

(defn foo []
  [1 2 3])

• Add project to lsp
• move cursor to the beginning of [1 2 3]
• helm-lsp-code-actions
• Change coll to set
• See it change to #{1 2 3}
• helm-lsp-code-actions
• Change coll to list

Expected behavior

• See it change to (1 2 3)

Actual behavior

• Nothing happens
workspace/applyEdit isn't sent for the 2nd refactoring

More notes

By bisecting releases I was able to determine that the problem was introduced in the February release

BAD: https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.02.01-16.53.14
GOOD: https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.01.22-01.31.09

The problem was introduced after 2022.01.22-01.31.09 but before 2022.02.01-16.53.14.

Running lsp-workspace-restart makes it work again (again only once).

User details (please complete the following information):

  • OS: macOS 10.15.7, Java 18
  • Emacs and lsp-mode
  • Version: (post the result of clojure-lsp --version)

Additional context
More info in a Slack thread

@pesterhazy pesterhazy added bug Something isn't working editor Related to clojure-lsp on a text editor labels Apr 2, 2022
@pesterhazy
Copy link
Sponsor Author

The above was tested using non-graal binaries. With graal binaries, the behavior is even more striking

@ericdallo ericdallo added this to Low priority in clojure-lsp via automation Apr 3, 2022
@ericdallo
Copy link
Member

So, I took a look at the diff, and it seems the only change that may affect that is this PR.

@pesterhazy to make sure that PR is not related, could you try execute the command manually instead via code action? it should have a lsp-clojure-* where * is the refactor, example: lsp-clojure-cycle-coll

@pesterhazy
Copy link
Sponsor Author

OK so on clojure-lsp 2022.01.22-01.31.09

  • code action "covert to set" (list, map, etc) works reliably
  • lsp-clojure-cycle-coll doesn't do anything mostly (I did see it work once though but the next time it failed again)

In 2022.02.01-16.53.14, neither of them work reliably (both worked once in my test)

@ericdallo
Copy link
Member

That's too weird, I can't see anything that related to this issue, also, this is the first issue since months of this "bug", so not sure it's something to be fixed or some issue on client side or something.

So, even on 2022.01.22-01.31.09, the command is not reliable? so it could be a even more older issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor
Projects
clojure-lsp
Low priority
Development

No branches or pull requests

2 participants