Closed jacobemcken closed 2 years ago
Thanks for reporting!
Pinging @ericdallo. It might be something we need to tell clojure-lsp when that file closes.
As for workarounds. A slightly less dramatic (depending on your usage of VS Code) way is to only reload the current window. One way to do so is to use the command Developer: Reload Window. You can even make the REPL survive this by starting it yourself and use Calva Connect instead of Jack-in. VS Code terminals survive window reloads. (Sadly this doesn't go for the Jack-in terminal yet.)
Clear Document Diagnostics
doesn't seem to work on "outside files".
TIL. I didn't know about this command. Have been needing it! Anyway, this indicates that it might be a VS Code problem. We'll see.
I think it makes sense to count the errors while the file is opened but I agree that after receiving a didClose
on server we should check if it's inside the project and update the diagnostics if not, please open a ticket on clojure-lsp
Fixed on clojure-lsp master, please test the nightly build
I might not understand something, but using a "nightly" does not seem to have fixed the problem.
~/Private/Projects/my-project/
in VS Code/Calva with an initial "Problem count" of 2.~/Private/Projects/mongo-driver-3/src/mongo_driver_3/operator.clj
(cloned from Mongo Driver 3)Expectation: The "Problem count" would fall to 2 which it was initially.
@PEZ is that related to Calva not downloading nightly properly?
@ericdallo It might be related. @jacobemcken A new version of Calva was released since your last comment that fixed an issue with the nightly build download. I would try it again and see if the problem persists.
Tried again this morning using Calva version [2.0.304] - 2022-09-20.
Same problem (as in: the problem count goes somewhat down, but only around half... see screenshots about for example)
@ericdallo do you want me to create an issue over at https://github.com/clojure-lsp/clojure-lsp ?
or is the bug somewhere else?... the nightly did reduce the number of warnings (see above screenshots).
@jacobemcken is there any repro I can try? The fix I made should fix cases like that
Thanks for your patience @ericdallo The bug is fixed.
The reason why only some linting warnings would disappear once I closed the external file, was because I also had the clj-kondo VS Code extension installed. I don't know how many months I've been running double linting checks :scream:
Now that I've uninstalled that clj-kondo, I can verify that nightly
fixes the issue for me.
:pray:
Good, I think that 's more common that you think. Maybe we should present some warning when both are installed c/c @PEZ
It appears I thought it was a good idea to remove that warning in the past 😅: https://github.com/BetterThanTomorrow/calva/issues/1091. Sorry @jacobemcken! I think we should add that back...
I find the following behavior in Calva (lsp?) a bit annoying:
Expected behavior: The "problem" count goes back down, when the file is closed.
Actual behavior: The problems from the "external" file lingers and now drown my "real" problems.
Workaround: Restart VS Code.
Also worth noting:
Clear Document Diagnostics
doesn't seem to work on "outside files". I reopen the problematic outside file in the hope that I can "clear diagnostics" and then quickly close it again before the problems are picked up.