This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-07
Channels
- # announcements (2)
- # asami (2)
- # babashka (15)
- # babashka-sci-dev (31)
- # beginners (130)
- # boot (4)
- # cider (5)
- # circleci (12)
- # clj-kondo (10)
- # cljs-dev (8)
- # clojure (7)
- # clojure-czech (14)
- # clojure-europe (19)
- # clojure-france (5)
- # clojure-uk (2)
- # clojured (23)
- # clojurescript (11)
- # conjure (8)
- # datomic (5)
- # emacs (1)
- # etaoin (8)
- # events (2)
- # fulcro (10)
- # graalvm (18)
- # gratitude (1)
- # holy-lambda (16)
- # honeysql (4)
- # introduce-yourself (1)
- # jobs (2)
- # kaocha (3)
- # london-clojurians (1)
- # lsp (53)
- # off-topic (16)
- # other-languages (2)
- # pathom (4)
- # pedestal (3)
- # podcasts-discuss (1)
- # portal (10)
- # re-frame (69)
- # reitit (2)
- # shadow-cljs (11)
- # vim (7)
- # xtdb (29)
Has anyone experienced an issue where go to definition for CLJS goes to the copy of the cljs file in the resources
directory instead of src
?
I tried using :ignore-classpath-directories true
in my config hoping it would help, but unfortunately it didn't work 😞
Someone complained about it recently and I suggested ignore-classpath-directories, if it's not working, feel free to create a issue with detailed repro project
I don't think clojure-lsp should add that to the classpath automatically. I think it might have happened because I also have project.clj
in that project, but even then
Yeah, I think the issue is, the classpath contains the target folder so clojure-lsp consider it as a source-path
This is my config:
{:ignore-classpath-directories ["target"]}
And no matter how many times I restart lsp, it keeps navigating to that damn target dirI think it's a good default to never put target on the classpath btw, I've never seen a Clojure project in which it was a source directory. But this config doesn't work
oh that's even more strange, since src
is also on the classpath, why would I want to ignore that one
could you paste your classpath here please? it's printed when clojure-lsp is starting on server logs
2022-06-09T15:45:03.903Z INFO [clojure-lsp.db:70] - [DB] Reading transit analysis cache from /Users/borkdude/dev/cli/.lsp/.cache/db.transit.json db took 185ms
2022-06-09T15:45:03.936Z INFO [clojure-lsp.crawler:160] - [Startup] Using cached db for project root /Users/borkdude/dev/cli
2022-06-09T15:45:03.938Z INFO [clojure-lsp.source-paths:209] - [Startup] Using source-paths from classpath: ["/Users/borkdude/dev/cli/dev-resources" "/Users/borkdude/dev/cli/.build" "/Users/borkdude/dev/cli/target/classes" "/Users/borkdude/dev/cli/resources" "/Users/borkdude/dev/cli/src" "/Users/borkdude/dev/cli/src" "/Users/borkdude/dev/cli/test" "/Users/borkdude/dev/cli/test"]
Alright, before that log, it should have a classpath string and the command clojure-lsp used right?
probably /Users/borkdude/dev/cli/target/classes
is on the classpath returned by lein/clojure
I suspect ignore-classpath-dirs is broken since we started using source-paths from classpath
I don't even want to use the classpath from lein btw, I just added a project.clj because I needed to deploy
Not sure it's safe to ignore the source-path just because it includes target
string
I'll take a look soon, and try to make :ignore-classpath-directories-regex ["target"]
possible, and probably with that value as default
@U06M4ST0F do you have a simple project where I can test it while implementing it?
I think my case is a bit more complicated - I have resources
in my path so I don't think ignore-classpath-directories
would work for me
if so, the suggested fix would work for you too right if you have something like :ignore-classpath-directories-regex [".*resources.*"]
alright, so something like :ignore-classpath-directories-regex ["resources/public/js/compiled.*" "target.*"]
seems to make sense as a default too
Ah, I just noticed this was fixed recently. Thank you so much! (and apologies for not getting around to setting up the repro)
https://github.com/clojure-lsp/clojure-lsp/commit/69a9a5c42fc852d46ecbd17aab28a9e6e9f5c055 didn't do the trick eh?
and I was editing a file in target
for half an hour until I noticed I was editing the wrong file :(
@UKFSJSM38 Suggestion: add to the lsp-clojure-server-info
which binary is currently being used? does it pick the one from the path automatically?