Doesn't that do the opposite? Doesn't that disable LSP completion?
Oh yeah, fixed it, thanks!
ah right I remember that, but what if the remote process is simply a jar without the source code there?
not sure. haven't tried that use case. i think it only does the prefix of the path so if the jar stuff could just be mangled and chopped to match the local directory it could work
Does anyone have a working doom+lsp+rebl set up? I'm following the directions from the REBL docs, but the communication between Doom and REBL isn't working.
maybe ask too on #emacs or #doom-emacs
#emacs has way more people
Ok, thanks. I wish I could just use a clojure.main repl like in Cursive. It works without a hitch there.
@ericdallo Hello Eric, I am investigating the classpath loading failure issue. How to get the project-root value when I connect to the running nrepl? Thanks.
Hi! You can call lsp-clojure-cursor-info and check the :port
I connected to the nrepl already. How can I start debug clojure-lsp, for example, get the project-root value through repl? thanks.
(:project-root @db/db)
probably
it is nil.
did the server started correctly?
it'll persist that after the initialize
request
I suggest you compile with lein with-profile debug bin
start clojure-lsp in a sample project
and connect to the running repl, gettint the nrepl port
then you can eval things that will affect the clojure-lsp running in your sample project
maybe this can help: https://clojure-lsp.github.io/clojure-lsp/#community-development
Yes. I compiled with :debug, and running with clojure-lsp project. lsp-log-io is on, and I can get the logs now.
tip: you can use lsp-workspace-show-log
no clues today. i will continue digging the information later. Thanks.
LMK if you need help
How can I get the call hierachy in lsp-mode?
found it, lsp-treemacs. the outgoing hierarchy would also be possible to implement I think
Yes! Feel free to open a feature request issue :)
:clojure-lsp: Released clojure-lsp https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.02.24-14.23.08 :clojure-lsp:
• Add new Thread first/last all code actions 🎉
• Improve completion performance using completion/resolveItem
for documentation request
Does this also include the incremental sending of changed text?
No @borkdude I'm having a hard time making that work 😅
No problems, just curious :)
I need clojrue way to queue the changes and process them in some ms, instead of analyzing with clj-kondo at each change
I tried using clojure.async or with atom, but unsuccessfully
if you need a queue, use a queue? :) https://github.com/clj-kondo/clj-kondo/blob/148d3373966b5f52a9b1ec11ca735e0a07d196e1/src/clj_kondo/impl/core.clj#L256-L280
like, if you input 100 1
really fast (holding the key), clojure-lsp will receibe 100 didChange notifications, we should only analyze if the last didCHange took 200ms (or some configured time)
is not paralel, it just wait some time to analyze with clj-kondo the merge of all code changes one time instead of calling clj-kondo for each change
so you need debouncing
yeah 🙂
I googled that for you :)
in that PR I process with your magic replace-text function and add to async channel, I just need to process them with debouncing
Oh, maybe that could work 😄
need to test, it's something that is not clear to me yet
It fix the issue indeed @borkdude thank you again 🙂 It seems to have a issue though, or I need a different function
the debounce only happens when a second or other values are inserted in the specified time
if I just call it once, (after calling one time), it will not get the value from in
tiny sample:
(def in (chan 1))
(put! in {:bar (rand-int 100)})
(go-loop [value (<! (debounce in 1000))]
(println value)
(recur (<! (debounce in 1000))))
if I run the go-loop multiple or the first time, it works as expected, but the second time it doesn't print
and the fourth, sixty etc,
Sorry, I'm cooking dinner. Ask in #core-async or #clojure
(#clojure will possibly give more answers)
np, thanks!
It works 😄 Folks helped me https://clojurians.slack.com/archives/C05423W6H/p1614189205008800?thread_ts=1614186680.003700&cid=C05423W6H
need to make some concurrency tests yet
Very good
@borkdude if wanna give a try later: https://github.com/clojure-lsp/clojure-lsp/pull/336
I see that the show-docs-arity-on-same-line?
option has disappeared from settings https://emacs-lsp.github.io/lsp-mode/page/settings/
this is the correct clojure-lsp docs: https://clojure-lsp.github.io/clojure-lsp/
that is from emacs lsp-mode, generic settings
well it seems to be some kind of regression, because it stopped working
besides, there is probably some other problem, because after 5 minutes of work, the log is over 3mb
Any exception on the log?
Relate to that?
99% of data is Cannot find position data when analysing fn*
and yes, there is an expection
Error while looking up classpath info in /home/ribelo/code/frisco-react Cannot run program "boot" (in directory "/home/ribelo/code/frisco-react"): error=2, No such file or directory
the error is probably on the side of our repo, because we gave up boot, but the build.boot file remained.
the Cannot find position data when analysing fn*
is something to fix on clojure-lsp butis not a error just a unecessary log
the exception is indeed a error, we need to understand why is not analyzing correctly
After deleting build.boot
there is no exception, the rest is unchanged
is your project a boot one?
clojure-lsp use these default project specs: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/crawler.clj#L53-L61
if it finds the file in project-path
, it then use the classpath-cmd
to get the classpath
so if your project is a lein one, it'll use lein classpath
to get the classpath
etc
but build.boot is the third one, so it should check if the projet is a lein or deps.edn one
we previously used boot, now deps.edn
Did removing the boot file worked?
yes
I see, I'll double check the priority on the default project specs
the show-docs-arity-on-same-line?
should work now
Yes, it's working.
Is the LSP and clj-kondo integration used by flycheck in Emacs-lsp? In Spacemacs, clj-kondo is typically added via a clojure-enable-linter variable on the Clojure layer (or a setq of the same name). Just wondering if running a am duplicating code analysis that clj-kondo is doing for LSP if I also include a linter for flycheck.
@jr0cket No, if you want to use flycheck clj-kondo you should disable diagnostics
You can use both independently (which I am doing, because I'm developing it)
But for most typical usage it's recommended to use the one built-in lsp probably
☝️
However, to diagnose issues with clj-kondo, it is recommended to provide a command line repro
@ericdallo Can clojure-lsp print the clj-kondo version? This would be really nice for error reports
it's printing (string/trim (slurp (io/resource "CLJ_KONDO_VERSION")))
=> "2021.02.14-SNAPSHOT"
not the exactly version on deps.edn: 2021.02.14-20210218.170309-6
yeah, that version you cannot know before you to push to clojars
this is good enough
Ok 🙂
But you can maybe do your own version parsing from your deps.edn at compile time (beware that deps.edn isn't usually in the deployed jar)
or some script or something
I leave that as an exercise ;)
hahahaha I think I'll just use the resource file version, parsing the deps.edn looks harder/dangerous for a simple thing like that
maybe clj-kondo could has a function via JVM for that
That could be pretty common for libs using the analyzer
clj-kondo doesn't know this version itself, it's generated by clojars, like I said before. but you know this version, because you are adding it to your deps.edn
Oh, I see
For most users that just want to use lsp, the clj-kondo flychrck is not needed
Sure, this is a easy valid change
I would like clj-kondo to keep giving me joy, but dont need clj-kondo to do twice the work to give me the same joy. So it seems I can switch off the clojure-enable-linter variable and still get the same joy. Thank you 🙂
You will even get a newer clj-kondo sometimes, because Eric Dallo uses clj-kondo from master ;)
I'll add to lsp-clojure-server-info and clojure-lsp --version
Even more joy 🙂
thanks!
You can get it from the CLJ_KONDO_VERSION file on the classpath
I just merged a new linter to master. :redundant-expression
. Example:
In Doom, at least, it seems to be disabling flycheck when LSP is enabled.
Oh, that's cool!