BetterThanTomorrow / calva

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

Stub files analyzing #2465

Open isacjunior opened 8 months ago

isacjunior commented 8 months ago

When a project is opened, the Calva is watching the stubs files path/.lsp/.cache/stubs and sending it to clojure-lsp to analyze and problems are shown on terminal. Interestingly, if the stub file noisy is opened and later close, the warning from VS Code fade away.

image

bpringe commented 8 months ago

Thanks for the issue.

Calva is watching the stubs files path/.lsp/.cache/stubs and sending it to clojure-lsp to analyze and problems are shown on terminal.

Can you clarify what you mean by "problems are shown on terminal"? Do you mean in the problems pane, like below?

image
bpringe commented 8 months ago

Adding context here from Slack from @ericdallo.

The clojure-lsp stub is a clojure-lsp feature which uses clj-easy/stub lib to generate dummy clojure files to have clj-kondo analysis, so for example one would get auto complete for datomic.api for example, a lib which is closed source

This feature spawns under the hood a clj process which exports the ns and vars, it's only enalbed if one has a :stub setting in clojure-lsp config

Slack thread: https://clojurians.slack.com/archives/CBE668G4R/p1676552690524579

isacjunior commented 8 months ago

Do you mean in the problems pane, like below?

Yes Screenshot 2024-03-26 at 09 40 13

ericdallo commented 8 months ago

@isacjunior do you opened that api.clj file at any moment? since that folder is not in the classpath, I would expect clojure-lsp to only report diagnostics if you manually open that file 🤔

isacjunior commented 7 months ago

@ericdallo no, I do not open that file. Just opening the VSCode and the problems in the terminal is shown.