Fork me on GitHub
#lsp
<
2021-06-29
>
Sigve07:06:56

Upgrading to the latest version from 2021.02.26-13.58.48 seems to break the ignore-classpath-directoriesfeature in clojurescript. For example finding references to functions now also returns results from my targetdirectory

borkdude08:06:41

I have a similar issue where I see results from .emacs.d/....

ericdallo12:06:10

I can take a look soon, Do you have a sample repro ?

Sigve14:06:30

I cant seem to reproduce it in a smaller repo.. i have to investigate further

ericdallo14:06:27

Hum, this doesn't happen on deps.edn clojurescript projects?

Sigve07:06:56

The problem seems to have been solved by removing the .lsp folder for the project

ericdallo12:06:27

:thinking_face:

Sigve07:07:36

Hmm, this problem reappears in my huge production repo. But i cannot seem to reproduce it in a small example repo. Anything else i could do to provide some information?

ericdallo12:07:15

Hum, could you try removing .clj-kondo/.cache and .lsp/sqlite.db?

ericdallo12:07:36

A repro would be perfect, but not sure if that is possible for you

Sigve13:07:32

Sorry but i'm not able to reproduce it.. cleaning the cache and db does not seem to work. However adding source-paths explicitly, seems to solve the problem - while this was not necessary to not include the targetdirectory in the 2021.02.26-13.58.48 version. Mabye something was changed related to this

ericdallo13:07:53

We improved the way we scan for source-paths, with this changed you don't need to include source-paths for most projects, but we didn't change anything related with the ignore-classpath-directories

Sigve14:07:08

Now i finally noticed that my project actually includes the target dir in :paths. clojure-lsp using this setting seems to have been added after the February edition i was using previously, so it makes sense now

Sigve14:07:30

Figwheel seems to require that the "target" directory is on the classpath:

[Figwheel:WARNING] Attempting to dynamically add "target" to classpath!
[Figwheel:WARNING] Target directory "target" is not on the classpath
[Figwheel:WARNING] Please fix this by adding "target" to your classpath
 I.E.
 For Clojure CLI Tools in your deps.edn file:
    ensure "target" is in your :paths key
so other clojurescript users might run into this problem

ericdallo14:07:04

oh, yeah, that makes sense now

ericdallo14:07:22

we had a update where clojure-lsp resolve the source-paths checking the deps.edn

ericdallo14:07:52

anyway, I think this is correct, right?

Sigve14:07:18

Yes it makes sense, it is just a gotcha when using clojurescript. Including the target directory will mess up finding references to and from functions since they are duplicated there

ericdallo14:07:11

hum, it'd be good to fix that somehow

ericdallo14:07:13

just not sure how

ericdallo14:07:04

maybe ignore-classpath-directories could be the truth even if the directory is on source-paths?

ericdallo14:07:28

this way user could have the target on classpath, and tell clojure-lsp to really ignore the target

Sigve14:07:12

If that is possible it would be good yes

ericdallo14:07:32

yeah, I'll take a look if that is possible

🎉 3