This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-28
Channels
- # aws (1)
- # babashka (113)
- # beginners (41)
- # cider (9)
- # cljdoc (15)
- # cljs-dev (8)
- # cljsrn (5)
- # clojure (113)
- # clojure-australia (4)
- # clojure-europe (40)
- # clojure-nl (8)
- # clojure-taiwan (1)
- # clojure-uk (60)
- # clojurescript (59)
- # code-reviews (2)
- # conjure (1)
- # datahike (12)
- # events (1)
- # jobs (1)
- # kaocha (4)
- # lsp (24)
- # luminus (19)
- # malli (4)
- # off-topic (28)
- # pathom (10)
- # philosophy (1)
- # portal (6)
- # re-frame (3)
- # reagent (9)
- # remote-jobs (1)
- # shadow-cljs (31)
- # sql (24)
- # tools-deps (6)
- # xtdb (14)
Hello, inexperienced Emacs and LSP user here.
When working on a ClojureScript project, I'm able to do lsp-find-definition
on a namespaced keyword (re-frame event or subscription) on one machine, but not on the other. They are the exact same setup, the only difference is I have emacd.d/workspace/.cache
on the former machine and not on the latter. I don't really know how it got there, but it seems to make things work:) What can I do to have the same fuctionality on both machines? 🙏
Both machines are Fedora Workstation, Emacs 27.2, latest LSP.
Hello! That emacs.d cache folder should not be related, probably the classpath scan is not being ran properly
Remove the .lsp/sqlite.db and .clj-kondo/.cache and then restart the server on the second project with lsp-workspace-restart
This should make clojure-lsp re analyze the classpath, make sure everything worked checking the clojure-lsp log, you can get it via log-path
from lsp-clojure-server-info
Hi Eric, thank you for your work on LSP and the advise, but it didn't work.
You are right, the workspace/.cache dir has no effect.
The clojure-lsp log file shows no errors, only some DEBUG messages from lsp.crawler: Invalid clj-kondo analysis. Cannot find position data for ...
but it shouldn't be the problem because they also show on the working machine.
lsp-doctor is all green on both machines, so I'm running out of ideas:(
Yeah, could you try to run lsp-clojure-cursor-info
on the keyword that is the definition of the event/sub ?
It's
LSP :: {:element
{:end-row 39,
:name-end-col 53,
:name-end-row 39,
:name-row 39,
:ns dre.help.subs,
:name "help-content",
:auto-resolved true,
:filename
"/home/ondra/Development/client/dre/DocSearch/app/src-cljs/dre/help/views.cljs",
:alias subs,
:col 34,
:name-col 34,
:end-col 53,
:bucket :keywords,
:row 39},
:definition nil}
And on the healthy machine:
LSP :: {:element
{:end-row 39,
:name-end-col 53,
:name-end-row 39,
:name-row 39,
:ns dre.help.subs,
:name "help-content",
:auto-resolved true,
:filename
"/home/ondra/Development/client/dre/DocSearch/app/src-cljs/dre/help/views.cljs",
:alias subs,
:col 34,
:name-col 34,
:end-col 53,
:bucket :keywords,
:row 39},
:definition
{:end-row 27,
:name-end-col 16,
:name-end-row 27,
:name-row 27,
:ns dre.help.subs,
:name "help-content",
:auto-resolved true,
:filename
"/home/ondra/Development/client/dre/DocSearch/app/src-cljs/dre/help/subs.cljs",
:col 2,
:name-col 2,
:reg re-frame.core/reg-sub,
:end-col 16,
:bucket :keywords,
:row 27}}
Yeah, for some reason it's not indexing the definition, Do you have a .clj-kondo on the project?
Also, is there any .lsp-config.edn that is different on the machines? Like one on home dir
Haha, alright, so first let check if both machines have same .lsp/config.edn, not only on the project but on your home dir
Yeah, also check the root of your project is the same on both machines, I mean, lsp-workspace-folders-remove, select the project and the lsp
again to select the correct root
Ok, I did that, the root is the same on both machines but still the same behaviour:( No ~/.lsp
The not-working machine is older and full of cruft, I sense the problem there. The working one is brand new.