This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-11
Channels
- # adventofcode (52)
- # announcements (3)
- # aws (2)
- # babashka (36)
- # babashka-sci-dev (4)
- # beginners (69)
- # biff (45)
- # calva (9)
- # cider (3)
- # clara (8)
- # clj-kondo (24)
- # clojure (20)
- # clojure-dev (12)
- # clojure-europe (12)
- # clojurescript (2)
- # conjure (1)
- # emacs (17)
- # lsp (69)
- # malli (12)
- # off-topic (32)
- # polylith (2)
- # re-frame (4)
- # releases (2)
- # scittle (6)
- # shadow-cljs (21)
- # tools-deps (10)
- # vim (11)
- # xtdb (11)
I used -
in my library name and when I try to jump to the source in that dependency LSP expects that I'll use _
in the filename.
What can I do about it? Does it mean that I can't use -
in repository names?
Sometimes it jumps to some files, but other times it expects _
in the same project. Weird.
For instance I have analyzer.clj
and core.clj
. I can jump to analyzer.clj
but not core.clj
source file.
If I use CIDER to jump into the source then it works.
I'm not aware of a bug like that, and the project-root name should not affect anything, is it possible to create a simple repro where I can try?
It's also possible that it's a bug of my nvim. I'll try to make a repro.
Try this project: https://github.com/Invertisment/reprochildproj I added a readme It's very weird but the bug is different this time. This time it doesn't load one of two namespaces.
Also please disregard the test-bb
task, it creates a JVM process and it's not correct.
I don't think so, but I always start a REPL.
Yes, I think REPL isn't related.
anyway, I get the issue form readme on emacs + cider:
Could not find namespace: com.github.invertisment.repro-parentproj.core
I confused everything.
I can't jump into the analyzer.clj
using LSP. And REPL can't load it too.
the repl is another thing, probably related with the deps not being available in bb.edn, only on deps.edn
But I can jump into core.cljc
I used bb.edn
only to launch the repl task. So the process should exist but it should not do anything
the repl issue is that: your com.github.invertisment/repro-parentproj
dep comes from deps.edn, when you start a bb repl, it won't check your deps.edn, but your bb.edn
and there is no com.github.invertisment/repro-parentproj
dep there, so bb won't know about that
the issue on the find definition of analyzer is that the code is invalid:
(ns com.github.invertisment.repro-parentproj.analyzer)
(defn hello []
(println "hey") ;; missing a ) here
I'll try to fix it and try again. I was typing too fast then.
This time it works. Not sure what's the issue with my other project then.
yeah, I'd say 50% of fixing a issue is finding a way to repro 😅 , sometimes it's hard, but without reproing is not easy to understand how to fix it or if it's indeed a issue
In my other repository the issue is that with LSP I have several namespaces in one directory and when I jump into core.cljc
then the file is blank.
And then when I jump into function's source then it also can't find it. But REPL finds it because it loads it and runs it.
But this happens only for one file in the same folder.
(ns neil-proj.gitlab-dep
(:require [io.gitlab.invertisment.____________.analyzer :as q]
[io.gitlab.invertisment.____________.core :as qq] ;; blank file when navigated via LSP
[io.gitlab.invertisment.____________.path :as qqq]
[clojure.tools.build.api :as tools-build])) ;; this one is to test that some other source project works
(defn a []
(qq/analyze-paths nil nil) ;; this code works via REPL but I can't LSP-jump there
#_(tools-build/jar))
Maybe there is a core.cljc
somewhere else, but it's full path thoughBut when I jump into analyzer
then in the bottom of the screen I see this path:
~/.gitlibs/libs/io.gitlab.invertisment/xxx-xxx/dd6aa966d5b8965400a7490c5c52c6d64d8fb232/src/io/gitlab/invertisment/xxx_xxx/analyzer.cljc
And the core
has this path:
~/.gitlibs/libs/io.gitlab.invertisment/xxx-xxx/689d541bdbc59cc6c05c8cb7f099e2a53630cf58/src/clojure/io/gitlab/invertisment/xxx_xxx/core.cljc
So for some reason the commit hash is different (initially I thought that difference between xxx_xxx and xxx-xxx is the bug but hash choice for a file probably is the actual bug)All three namespaces are different, they contain code
> ls | xargs -L 1 head -n 1
(ns io.gitlab.invertisment.------------.analyzer
(ns io.gitlab.invertisment.------------.core
(ns io.gitlab.invertisment.------------.path
Actually I can share the namespace names, there is nothing there:
(ns neil-proj.gitlab-dep
(:require [io.gitlab.invertisment.query-scopes.analyzer :as q]
[io.gitlab.invertisment.query-scopes.core :as qq] ;; blank file when navigated via LSP
[io.gitlab.invertisment.query-scopes.path :as qqq]
[clojure.tools.build.api :as tools-build]))
(defn a []
(qq/analyze-paths nil nil) ;; this code works via REPL
#_(tools-build/jar))
And the files:
[martin@qwe query_scopes HEAD]$ ls | xargs -L 1 head -n 1
(ns io.gitlab.invertisment.query-scopes.analyzer
(ns io.gitlab.invertisment.query-scopes.core
(ns io.gitlab.invertisment.query-scopes.path
[martin@qwe query_scopes HEAD]$ ls
analyzer.cljc core.cljc path.cljc
[martin@qwe query_scopes HEAD]$
I deleted project's .clj-kondo
directory and it jumps now.
Unfortunately I deleted it and I can't send it to you 😕
I think it should be something with previous commits of the project. Maybe I tried to load it while the project wasn't fully working yet. I was testing things out and moving files around.
that sounds like git branch switchs and file watch was not properly working. LSP file watch is a feature that the editor keeps listening for the project files, and when they change outside the editor the editor tells the lsp server that those files were created/changed/deleted, so the server can update analysis of the project correctly. This is mostly a feature to avoid the need of restarting your editor or lsp server to re-analyze the project, only for consistency.
But I have been restarting my editor (and with it LSP) and REPL multiple times :thinking_face: And it persisted until I deleted that directory.
Hum, weird, we don't have cache issues for a long time after we fixed some known bugs, again, if you can find a way to repro LMK, but usually is hard to repro cache issues 😔
I think for now I won't be doing a repro 😄 There is one and it could be played around to remove and add remote project's sources. And that may be enough.
I just updated my install of clojure-lsp
via the install script, and have run into an error after the update. I thought I'd check here if I was missing something obvious before filing an issue, I had a look but didn't see anything related.
robertfw@orion:~$ clojure-lsp --version
clojure-lsp 2022.05.03-12.35.40
clj-kondo 2022.04.26-SNAPSHOT
robertfw@orion:~$ sudo bash < <(curl -s )
Downloading to /tmp/tmp.IfoNRy4tk4
Moving /usr/local/bin/clojure-lsp to /usr/local/bin/clojure-lsp.old
Successfully installed clojure-lsp in /usr/local/bin
robertfw@orion:~$ clojure-lsp --version
clojure-lsp: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by clojure-lsp)
clojure-lsp: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by clojure-lsp)
@UG00LE5TN Try the static release @UKFSJSM38 I've had the same issue with clj-kondo. The issue was that the build environment used a too new version of glibc. I downgraded the build image again and this "fixed it"
@UG00LE5TN You can install the static image with --static
thanks @U04V15CAJ! @UKFSJSM38 let me know if you'd like to open an issue to track this
@U04V15CAJ Do you have the commit so I can do the same to clojure-lsp?
what's funny is that this started happening when building on github actions too. I've had the similar issue on circleci
@UKFSJSM38 I guess your issue is that you're using ubuntu-latest
The script should be fixed @UG00LE5TN LMK otherwise
@UKFSJSM38 I think you forgot that you also have linux aarch64 which doesn't have a static binary
also you should probably update the brew formula to use the static binary on amd64 (only that again)
I just did another release for this in the end since some github actions also downloaded the amd64 dynamic binary and started failing
@UG00LE5TN What does ldd --version
return on your system?
ubuntu-20.04 https://github.com/clojure-lsp/clojure-lsp/actions/runs/3670681448/jobs/6205385271 2.31, so it's safe
robertfw@orion:~$ ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.