Fork me on GitHub
#calva
<
2021-10-03
>
paulbutcher09:10:57

How do Calva/clj-kondo/clojure-lsp work out which files to lint? From my experiments, for my deps.edn project, it seems as though it looks at the directories specified within :paths but not any of those specified within :extra-paths? Do I understand that correctly? Why am I looking at this? I’m working on a Clojurescript application built with Figwheel Main. I have to put the generated target directory on the classpath so that it can be served to the browser, but if I do so by adding it to :paths, I get literally thousands of warnings in Calva for those generated files. If I add it to :extra-paths then I don’t?

borkdude10:10:39

@paulbutcher This is a clojure-lsp setting.

borkdude10:10:13

So you want to exclude files right?

paulbutcher10:10:53

Right now, I just want to understand what is and what is not included by default. But yes, ultimately I want to stop it from linting generated files.

paulbutcher10:10:03

Is there any documentation which describes how project files are treated for linting?

borkdude10:10:03

you can check the settings here: https://clojure-lsp.io/settings/

paulbutcher10:10:12

Ah cool - exactly what I was looking for - thanks! I haven’t yet entirely grokked the relationship between clj-kondo and clojure-lsp and for some reason I was hunting for this in the clj-kondo documentation and didn’t think to look in clojure-lsp (blush).

borkdude10:10:06

they are very much related. clj-kondo does the analysis of the clojure code and then passes that information to clojure-lsp, so clojure-lsp can provide features based on that

pez10:10:16

I think that what you want to do is set ignore-classpath-directories to true in the Clojure LSP settings.

paulbutcher10:10:34

So I’m reading that documentation right now and I admit I’m not entirely sure I understand the relationship between :source-aliases and :ignore-classpath-directories? As I understand it :paths and :extra-paths add directories to the classpath? So if I set :ignore-classpath-directories which directories will clojure-lsp lint?

paulbutcher12:10:54

I’ve been doing some experiments, and I’m definitely confused. :ignore-classpath-directories seems to have no effect at all that I can see (I’m still getting warnings from the generated code when it’s set to true, and clojure-lsp is still parsing everything that’s in :paths). Can someone help me understand what it actually does?

pez12:10:14

I really thought it would do the trick. Maybe you have better luck asking in #lsp.

paulbutcher13:10:11

I definitely don’t have an accurate mental model of what’s going on here. I will see if I can get some clarity in #lsp Thanks!

pez19:10:15

Dear Calva friends: Here’s a VSIX for you to test. It adds babashka and nbb jack-in support. I haven’t tested on Windows yet and suspect problems there of course. But who knows, maybe it will just work? https://14932-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.214-1001-bb-jack-in-8340d2a5.vsix

Bob B20:10:05

at a superficial level (a toy project with some basic scripts), the bb repl appears to work on Windows (for me)

🙏 1