Hello all, clojure-lsp cannot show doc of core lib functions on Windows machine for me. Is this current status? Thanks.
The issue is fixed by latest release, after I delete all the .lsp
folder which is generated by old release. Thanks!
Nice!!
I did a refactor or the way lsp find the configs too, the next release should has a smarter way to get the config
Hello! It should work, could you show a little repro?
Here is the difference for macOS and Windows
Hum, indeed, probably related with windows path, I thought that was fixed recently :thinking-face:
Could you open a issue please? Following the template to help find the real issue? I can take a look soon :)
I filed an issue https://github.com/clojure-lsp/clojure-lsp/issues/326 Thanks.
Does clojure-lsp have any developer documentation? I want to build it locally but don't know how. I tried graalvm/native-unix-compile.sh but I got:
Syntax error macroexpanding at (db.clj:1:1).
Execution error (FileNotFoundException) at clojure-lsp.db/loading (db.clj:1).
Could not locate next/jdbc__init.class, next/jdbc.clj or next/jdbc.cljc on classpath.
Plz add some build docs :)
There is a Makefile
lein bin
builds
There is a build section @borkdude
LMK if missing anything
This is weird though:
$ clj
Clojure 1.10.2
user=> (require '[next.jdbc :as jdbc])
Execution error (FileNotFoundException) at user/eval1 (REPL:1).
Could not locate next/jdbc__init.class, next/jdbc.clj or next/jdbc.cljc on classpath.
Indeed :thinking_face:
the ❯ ./graalvm/native-unix-compile.sh
seems to work for me too
Does that happens with lein repl too?
I am getting the same kind of error when building with lein. Thanks for the docs. I was confused with the links on the top :)
[clojure-lsp:1061095] write: 736.84 ms, 3.48 GB
[clojure-lsp:1061095] [total]: 91,653.86 ms, 3.48 GB
Although, I am on Arch 🙂
Yeah, I was thinking in move that to a header section
yes, lein repl crashes with the same
$ lein repl
Compiling 1 source files to /Users/borkdude/Dropbox/dev/clojure/clojure-lsp/target/classes
#error {
:cause Could not locate next/jdbc__init.class, next/jdbc.clj or next/jdbc.cljc on classpath.
:via
That's weird
yeah, the dep should be there:
seancorfield/next.jdbc 1.1.613
org.clojure/java.data 1.0.78
org.clojure/tools.logging 1.1.0
:thinking_face:This does work though:
user=> (require '[medley.core :as m])
nil
What clojure version are you using locally
(never mind, 1.10.2 is in the deps.edn)
Hmm, now it works. I don't know what happened, but I removed this dep from my .m2 and messed a little bit with the deps.edn file and now it works...
Maybe some kind of caching issue
Yeah, my guess is some m2 cache issue
Tried out the newest clj-kondo with clojure-lsp locally. Completion now seems to work with set/
.
Although the invalid symbol is reported in the wrong spot :thinking_face:. I'll take a look at this...
I want to add pedantic flag to project.clj, not sure this would help fixing that kind of issue too
That's awesome!!
I intend to bump clj-kondo tonight
And make those tests
just started fiddling with clojure-lsp
but something doesn't seem to add up:
this is what I have in *Messages*
:
LSP :: Sending to process failed with the following error: Process clojure-lsp not running
LSP :: Connected to [clojure-lsp:483714 status:starting].
LSP :: clojure-lsp has exited (exited abnormally with code 127)
Server clojure-lsp:483714 status:starting exited with status exit. Do you want to restart it? (y or n) n
@skuro, probably the executable is not right, how did you installed it?
Try setting lsp-clojure-command-path in emacs
brew install clojure-lsp
Oh, brew has a super outdated version :/
We have a issue to create a custom tap to make that always updated
oh I see
My suggestion for now, is to download from GitHub releases
@andre.peric is working on that :)
roger, thanks
@ericdallo I now fixed it in clj-kondo master.
The location is alright now. The behavior of clojure-lsp is a bit inconsistent:
When I have a top level ns require and then type set/
I don't get the completions on tab
But when I then type (require '[clojure.set :as set])
and try it again, it works
Nice!
Hum, will need to take a look
it should behave the same
In the second screenshot I did not get completions. The first screenshot is the same as the first + some code added at the bottom
Alright, I can investigate that soon, I hope is some simple to fix 😛
from clj-kondo analysis, is everything correct, right?
yeah, it's a bit wobbly in lsp, when I move the cursor it suddenly starts working now
yeah, should be ok now
:thinking_face: In the issue, there was a rewrite-clj issue that was solved: https://github.com/clojure-lsp/clojure-lsp/issues/270
maybe there is some corner case where it does not work properly
How does project indexing works on clojure-lsp? Most of the time when I open an file on my project and try to go to definition it fails until I open the destination file manually. I'm using vim and coc if this is relevant information.
when starting clojure-lsp, it should call clj-kondo to analyze the whole classpath
check the /tmp/clojure-lsp.*.out
log
it should use lein classpath
, clojure -Spath
or boot
That may be related as I use neomake to run clj-kondo (it was there before clojure-lsp start using clj-kondo). Let me try to remove neomake for that.
it depends on your project type
It uses the default clj-kondo cache for the project right?
yeah, clojure-lsp already use clj-kondo under the hood for lint
yes
Thanks, I will investigate things on my side.
yeah, try to rm .clj-kondo/.cache
and .lsp/sqlite.db
Should be a .lsp/sqlite.1.db
and a .lsp/sqlite.5.db
on .lsp
?
So, after removing the files you suggested looks like everything is working. Thank you!
And I also removed neomake for clj-kondo.
yeah, those are old db, you can always safely remove them
nice, good to know it works now 🙂
@ericdallo Should clojure-lsp maybe have a command to re-index from scratch? I observed that "rm sqlite" is often recommended here, but this could maybe be supported better
not sure worth the implementation since is quite a simple rm command, but spend some time in some way to make lsp know that the sqlite is old would be really good
it's a simple command but it requires you to leave your buffer
and it's often the solution to unclear problems
anyway, not a big deal ;)
On vim you don't need to leave the buffer 😉
Vim would be a different buffer for me though!
yeah, it could be done, I don't see any problem having a command for that too 🙂
Does it always does a full index when you open an project?
Only index stale files could be an improvement if it doesn't do it already.
it does a full index the first time or when the project deps have changed
It will probably already do this using hashes
@ericdallo We have a deps.edn with deps for our front-end and deps for our backend in two different aliases. Will clojure-lsp detect this automatically? Or should I use :classpath-cmd ["clojure" "-A:frontend:backend" "-Spath"]
?
for now I did it like the latter
yeah you should use that custom classpath-cmd, otherwise clojure-lsp will use a default clojure -Spath
good to know
It was indeed a bug on clojure-lsp code related to the rewrite-clj workaround
I fixed and bumped and finally we have completion working properly 🎉
🎉 🎉 🎉