BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.63k stars 213 forks source link

Refactorings don't seem to work over live share #957

Open svdo opened 3 years ago

svdo commented 3 years ago

I can't tell you how happy I am with the fact that Calva supports refactoring now! 😍

Today I tried using one over live share (I was connected to my co-worker's machine), and it didn't work. I tried "extract function". Calva asked me to provide the name of the function, and then nothing happened. On my co-worker's machine it did work.

Calva 2.0.151

bpringe commented 3 years ago

In settings if you enable trace logging by setting Clojure > Trace:Server to verbose, then you'll have an output channel called "Clojure Language Client." You can then perform this action and see the request and response for the refactoring, and paste that here. It may help to clear the output beforehand to limit the noise.

svdo commented 3 years ago

This is what I get from that:

[Trace - 1:57:23 PM] Sending request 'workspace/executeCommand - (2)'.
Params: {
    "command": "extract-function",
    "arguments": [
        "vsls:///projects/<redacted>/order_test.clj",
        15,
        5,
        "xx"
    ]
}

[Trace - 1:57:23 PM] Received response 'workspace/executeCommand - (2)' in 1ms.
No result returned.
bpringe commented 3 years ago

My first thought is that maybe is has something to do with the vsls uri scheme. I doubt clojure-lsp has indexed the file as such. This can be verified with some work when I have time. I should have asked you to report what you saw in /tmp/clojure-lsp.out. No need to go out of your way, but if you're in a situation to easily cause this again, then check that file for any related warnings/errors, it may help.