This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-04
Channels
- # announcements (30)
- # aws (7)
- # babashka (7)
- # beginners (64)
- # calva (39)
- # cherry (17)
- # cider (1)
- # clj-on-windows (6)
- # clojure (30)
- # clojure-austin (12)
- # clojure-europe (25)
- # clojure-nl (2)
- # clojure-norway (23)
- # clojure-spec (23)
- # clojure-uk (6)
- # clojurescript (20)
- # cursive (18)
- # datahike (3)
- # datalevin (12)
- # datomic (9)
- # etaoin (5)
- # graalvm (45)
- # instaparse (2)
- # interceptors (11)
- # kaocha (1)
- # lsp (102)
- # meander (6)
- # nbb (16)
- # off-topic (30)
- # pathom (83)
- # pedestal (6)
- # portal (5)
- # re-frame (12)
- # reitit (5)
- # rewrite-clj (10)
- # scittle (35)
- # shadow-cljs (49)
- # spacemacs (10)
- # vim (14)
Hello! Is there a way to tell clojure-lsp to prefer only deps.edn? I have a project with both deps.edn and project.clj but most places I develop, dont have lein installed and lsp errors out looking for it. Can I somehow say, ignore project.clj
?
it seems like only :project-path "deps.edn"
should do it, although it's not entirely clear to me, worth trying
looks promising, will try it, thanks!
Yeah, should do it, but I found this same issue on clojure-lsp project itself... There we were merging both deps.edn and bb deps, and bb had a old promesa lib and was overriding the deps.edn when clojure-lsp merge
And then find definition and other analysis things would use one of those 2 jars, which is by luck atm
i tried with
{:project-specs [{:project-path "deps.edn"}]}
errrors with
LSP classpath lookup failed when running ``. Some features may not work properly if ignored.
Error: No value supplied for key: :dir
@rahul080327 that setting is one of the oldest settings, you need to add a classpath-cmd along with it
Yeah, maybe @U04V15CAJ but sounds like a workaround yet
Yep, that setting is not ideal Imo, is a bit old, but the idea was to run that classpath-cmd command if found a project-path file
maybe we could default to ["clojure" "-Spath"]
?
yeah tried it and it works
great! thanks! will try to PR it too if its a worthy thing too!
I have this too. I have a legacy project that uses lein and deps, but lein errors out because of failing to get some artifacts, so I get a classpath error taking over my vim editor when I load up a file, asking if I want to ignore or retry (I choose ignore)
Yeah, that is suppose to happen, not sure if there is anything to improve besides what we mentioned already
LSP: I am trying to get references (s-l g r) or clock on the lens link… and I get:
cl-no-applicable-method: No applicable method: project-root, (clojure . "~/projects/althea/")
LSP :: {:final-settings
{:source-aliases #{:test :dev},
:uri-format
{:upper-case-drive-letter? false, :encode-colons-in-path? false},
:cljfmt-config-path ".cljfmt.edn",
:document-formatting? true,
:source-paths
["/Users/cue/projects/althea/src/clojure"
"/Users/cue/projects/althea/dev-resources"
"/Users/cue/projects/althea/test/clojure"],
:text-document-sync-kind nil,
:project-specs
({:project-path "project.clj",
:classpath-cmd
["/Users/cue/bin/lein" "with-profile" "+test,+dev" "classpath"]}
{:project-path "deps.edn",
:classpath-cmd ["/usr/local/bin/clojure" "-A:test:dev" "-Spath"]}
{:project-path "build.boot",
:classpath-cmd ["boot" "show" "--fake-classpath"]}
{:project-path "shadow-cljs.edn",
:classpath-cmd
["/Users/cue/.nvm/versions/node/v15.12.0/bin/npx"
"shadow-cljs"
"classpath"]}
{:project-path "bb.edn",
:classpath-cmd
["/usr/local/bin/bb" "print-deps" "--format" "classpath"]}),
:dependency-scheme "jar",
:show-docs-arity-on-same-line? true,
:document-range-formatting? true},
:classpath
#{"/Users/cue/.m2/repository/digest/digest/1.4.10/digest-1.4.10.jar"
"/Users/cue/.m2/repository/commons-io/commons-io/2.10.0/commons-io-2.10.0.jar"
"/Users/cue/.m2/repository/ring/ring-servlet/1.9.5/ring-servlet-1.9.5.jar"
"/Users/cue/.m2/repository/compojure/compojure/1.7.0/compojure-1.7.0.jar"
"/Users/cue/.m2/repository/org/nrepl/incomplete/0.1.0/incomplete-0.1.0.jar"
"/Users/cue/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar"
"/Users/cue/.m2/repository/org/clojure/java.classpath/0.3.0/java.classpath-0.3.0.jar"
"/Users/cue/.m2/repository/io/aviso/pretty/1.1.1/pretty-1.1.1.jar"
"/Users/cue/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-smile/2.13.3/jackson-dataformat-smile-2.13.3.jar"
"/Users/cue/.m2/repository/org/clojure/core.async/1.5.648/core.async-1.5.648.jar"
"/Users/cue/.m2/repository/org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar"
"/Users/cue/.m2/repository/crypto-random/crypto-random/1.2.1/crypto-random-1.2.1.jar"
"/Users/cue/.m2/repository/crypto-equality/crypto-equality/1.0.0/crypto-equality-1.0.0.jar"
"/Users/cue/.m2/repository/medley/medley/1.4.0/medley-1.4.0.jar"
"/Users/cue/.m2/repository/ring/ring-jetty-adapter/1.9.5/ring-jetty-adapter-1.9.5.jar"
"/Users/cue/.m2/repository/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar"
"/Users/cue/.m2/repository/hiccup/hiccup/1.0.5/hiccup-1.0.5.jar"
"/Users/cue/.m2/repository/cider/cider-nrepl/0.28.4/cider-nrepl-0.28.4.jar"
"/Users/cue/.m2/repository/org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar"
"/Users/cue/.m2/repository/com/taoensso/encore/3.21.0/encore-3.21.0.jar"
"/Users/cue/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar"
"/Users/cue/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar"
"/Users/cue/.m2/repository/org/eclipse/jetty/jetty-server/9.4.44.v20210927/jetty-server-9.4.44.v20210927.jar"
"/Users/cue/.m2/repository/refactor-nrepl/refactor-nrepl/3.5.2/refactor-nrepl-3.5.2.jar"
"/Users/cue/.m2/repository/commons-codec/commons-codec/1.15/commons-codec-1.15.jar"
"/Users/cue/.m2/repository/org/eclipse/jetty/jetty-io/9.4.44.v20210927/jetty-io-9.4.44.v20210927.jar"
"/Users/cue/.m2/repository/tigris/tigris/0.1.2/tigris-0.1.2.jar"
"/Users/cue/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar"
"/Users/cue/.m2/repository/ns-tracker/ns-tracker/0.4.0/ns-tracker-0.4.0.jar"
"/Users/cue/.m2/repository/org/clojure/tools.namespace/0.2.11/tools.namespace-0.2.11.jar"
"/Users/cue/.m2/repository/org/eclipse/jetty/jetty-util/9.4.44.v20210927/jetty-util-9.4.44.v20210927.jar"
"/Users/cue/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar"
"/Users/cue/.m2/repository/com/stuartsierra/component/1.1.0/component-1.1.0.jar"
"/Users/cue/.m2/repository/com/stuartsierra/dependency/1.0.0/dependency-1.0.0.jar"
"/Users/cue/.m2/repository/ring/ring-codec/1.2.0/ring-codec-1.2.0.jar"
"/Users/cue/.m2/repository/com/taoensso/truss/1.6.0/truss-1.6.0.jar"
"/Users/cue/.m2/repository/org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar"
"/Users/cue/projects/althea/src/clojure"
"/Users/cue/.m2/repository/cheshire/cheshire/5.11.0/cheshire-5.11.0.jar"
"/Users/cue/.m2/repository/ring/ring-core/1.9.5/ring-core-1.9.5.jar"
"/Users/cue/.m2/repository/aero/aero/1.1.6/aero-1.1.6.jar"
"/Users/cue/.m2/repository/ring/ring-json/0.5.1/ring-json-0.5.1.jar"
"/Users/cue/.m2/repository/environ/environ/1.2.0/environ-1.2.0.jar"
"/Users/cue/.m2/repository/nrepl/nrepl/0.9.0/nrepl-0.9.0.jar"
"/Users/cue/.m2/repository/clojure/java-time/clojure.java-time/0.3.3/clojure.java-time-0.3.3.jar"
"/Users/cue/projects/althea/resources"
"/Users/cue/.m2/repository/clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar"
"/Users/cue/.m2/repository/com/taoensso/timbre/5.2.1/timbre-5.2.1.jar"
"/Users/cue/.m2/repository/org/ow2/asm/asm/9.2/asm-9.2.jar"
"/Users/cue/.m2/repository/org/clojure/test.check/1.1.1/test.check-1.1.1.jar"
"/Users/cue/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.3/jackson-core-2.13.3.jar"
"/Users/cue/.m2/repository/instaparse/instaparse/1.4.8/instaparse-1.4.8.jar"
"/Users/cue/.m2/repository/ring/ring-devel/1.9.5/ring-devel-1.9.5.jar"
"/Users/cue/.m2/repository/clj-stacktrace/clj-stacktrace/0.2.8/clj-stacktrace-0.2.8.jar"
"/Users/cue/projects/althea/target/classes"
"/Users/cue/.m2/repository/org/clojure/data.codec/0.1.1/data.codec-0.1.1.jar"
"/Users/cue/.m2/repository/ring/ring-mock/0.4.0/ring-mock-0.4.0.jar"
"/Users/cue/projects/althea/dev-resources"
"/Users/cue/.m2/repository/org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar"
"/Users/cue/.m2/repository/clout/clout/2.2.1/clout-2.2.1.jar"
"/Users/cue/.m2/repository/org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar"
"/Users/cue/.m2/repository/org/eclipse/jetty/jetty-http/9.4.44.v20210927/jetty-http-9.4.44.v20210927.jar"
"/Users/cue/.m2/repository/ring/ring/1.9.5/ring-1.9.5.jar"
"/Users/cue/projects/althea/test/clojure"
"/Users/cue/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.13.3/jackson-dataformat-cbor-2.13.3.jar"
"/Users/cue/.m2/repository/criterium/criterium/0.4.6/criterium-0.4.6.jar"
"/Users/cue/.m2/repository/org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar"},
:cljfmt-raw "{}",
:client-settings
{:dependency-scheme "jar",
:show-docs-arity-on-same-line? true,
:text-document-sync-kind nil,
:source-paths nil,
:source-aliases nil,
:cljfmt-config-path ".cljfmt.edn",
:document-formatting? true,
:document-range-formatting? true},
:project-root-uri "file:///Users/cue/projects/althea",
:port "NREPL only available on :debug profile (`bb debug-cli`)",
:project-settings {},
:server-version "2022.10.05-16.39.51",
:clj-kondo-version "2022.10.05",
:log-path
"/var/folders/8g/3jkxw3v10b7_8885n1p1dvlc0000gn/T/clojure-lsp.5813367870490798340.out",
:classpath-settings nil}
Looks good, I'd suggest upgrading clojure-lsp to latest though, but probably not the issue
so, that error message seems a emacs one, maybe you could try toggle-debug-on-error
and repro the issue
Debugger entered--Lisp error: (cl-no-applicable-method project-root (clojure . "~/projects/althea/"))
signal(cl-no-applicable-method (project-root (clojure . "~/projects/althea/")))
cl-no-applicable-method(#s(cl--generic :name project-root :dispatches (((&context . project--within-roots-fallback) #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority 100 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba94bb2a238cfc>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xc2b528c28554d5a>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba9713a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b7bed08469105e>))) (0 #s(cl--generic-generalizer :name cl--generic-head-generalizer :priority 80 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x3a14a44564bea75>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xc2b528db576651a>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba9713a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b7bed08469105e>)))) :method-table (#s(cl--generic-method :specializers ((head vc)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (project) #<bytecode 0x6b9e8a8ac27aec5>)) #s(cl--generic-method :specializers ((head transient)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (project) #<bytecode 0x6b9e8a8ac27aec5>)) #s(cl--generic-method :specializers (t ((&context . project--within-roots-fallback) eql nil)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (project) #<bytecode 0x6a7fc5ce8bb6479>))) :options nil) (clojure . "~/projects/althea/"))
apply(cl-no-applicable-method #s(cl--generic :name project-root :dispatches (((&context . project--within-roots-fallback) #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority 100 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba94bb2a238cfc>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xc2b528c28554d5a>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba9713a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b7bed08469105e>))) (0 #s(cl--generic-generalizer :name cl--generic-head-generalizer :priority 80 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x3a14a44564bea75>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xc2b528db576651a>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba9713a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b7bed08469105e>)))) :method-table (#s(cl--generic-method :specializers ((head vc)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (project) #<bytecode 0x6b9e8a8ac27aec5>)) #s(cl--generic-method :specializers ((head transient)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (project) #<bytecode 0x6b9e8a8ac27aec5>)) #s(cl--generic-method :specializers (t ((&context . project--within-roots-fallback) eql nil)) :qualifiers nil :uses-cnm nil :function #f(compiled-function (project) #<bytecode 0x6a7fc5ce8bb6479>))) :options nil) (clojure . "~/projects/althea/"))
#f(compiled-function (&rest args) #<bytecode 0x31e900ad1d7e41f>)((clojure . "~/projects/althea/"))
apply(#f(compiled-function (&rest args) #<bytecode 0x31e900ad1d7e41f>) (clojure . "~/projects/althea/") nil)
#f(compiled-function (arg &rest args) #<bytecode 0xaa6b77541a28fae>)((clojure . "~/projects/althea/"))
apply(#f(compiled-function (arg &rest args) #<bytecode 0xaa6b77541a28fae>) (clojure . "~/projects/althea/"))
project-root((clojure . "~/projects/althea/"))
project-roots((clojure . "~/projects/althea/"))
#f(compiled-function (project) #<bytecode 0x6a7fc5ce8bb6479>)((clojure . "~/projects/althea/"))
apply(#f(compiled-function (project) #<bytecode 0x6a7fc5ce8bb6479>) (clojure . "~/projects/althea/") nil)
#f(compiled-function (arg &rest args) #<bytecode 0xa21f374c5d4bbee>)((clojure . "~/projects/althea/"))
apply(#f(compiled-function (arg &rest args) #<bytecode 0xa21f374c5d4bbee>) (clojure . "~/projects/althea/"))
project-root((clojure . "~/projects/althea/"))
xref--project-root((clojure . "~/projects/althea/"))
xref--analyze((#s(xref-item :summary #("(defn create-my-cogent" 0 1 (face (rainbow-delimiters-depth-1-face) fontified t) 1 5 (face font-lock-keyword-face fontified t) 5 6 (fontified t) 6 22 (face (font-lock-function-name-face highlight) fontified t)) :location #s(xref-file-location :file "/Users/cue/projects/althea/src/clojure/althea/app...." :line 16 :column 6)) #s(xref-item :summary #(" (component/start (reset! my-cogent (create-my-co..." 0 2 (fontified t) 2 3 (face (rainbow-delimiters-depth-2-face) fontified t) 3 12 (face font-lock-type-face fontified t) 12 19 (fontified t) 19 20 (face (rainbow-delimiters-depth-3-face) fontified t) 20 37 (fontified t) 37 38 (face (rainbow-delimiters-depth-4-face) fontified t) 38 54 (face highlight fontified t) 54 55 (face (rainbow-delimiters-depth-4-face) fontified t) 55 56 (face (rainbow-delimiters-depth-3-face) fontified t) 56 57 (face (rainbow-delimiters-depth-2-face) fontified t)) :location #s(xref-file-location :file "/Users/cue/projects/althea/src/clojure/althea/app...." :line 34 :column 38))))
xref--show-xref-buffer(#f(compiled-function (&rest _) #<bytecode 0x6a0c468a824bd24>) ((window . #<window 3 on app.clj>) (display-action)))
lsp-show-xrefs((#s(xref-item :summary #("(defn create-my-cogent" 0 1 (face (rainbow-delimiters-depth-1-face) fontified t) 1 5 (face font-lock-keyword-face fontified t) 5 6 (fontified t) 6 22 (face (font-lock-function-name-face highlight) fontified t)) :location #s(xref-file-location :file "/Users/cue/projects/althea/src/clojure/althea/app...." :line 16 :column 6)) #s(xref-item :summary #(" (component/start (reset! my-cogent (create-my-co..." 0 2 (fontified t) 2 3 (face (rainbow-delimiters-depth-2-face) fontified t) 3 12 (face font-lock-type-face fontified t) 12 19 (fontified t) 19 20 (face (rainbow-delimiters-depth-3-face) fontified t) 20 37 (fontified t) 37 38 (face (rainbow-delimiters-depth-4-face) fontified t) 38 54 (face highlight fontified t) 54 55 (face (rainbow-delimiters-depth-4-face) fontified t) 55 56 (face (rainbow-delimiters-depth-3-face) fontified t) 56 57 (face (rainbow-delimiters-depth-2-face) fontified t)) :location #s(xref-file-location :file "/Users/cue/projects/althea/src/clojure/althea/app...." :line 34 :column 38))) nil t)
lsp-clojure--show-references(#<hash-table equal 3/3 0x1fea694cbaf5>)
lsp--execute-command(#<hash-table equal 3/3 0x1fea694cbaf5>)
#f(compiled-function () (interactive nil) #<bytecode -0x1c38a4c4dc09f980>)()
funcall-interactively(#f(compiled-function () (interactive nil) #<bytecode -0x1c38a4c4dc09f980>))
call-interactively(#f(compiled-function () (interactive nil) #<bytecode -0x1c38a4c4dc09f980>) nil nil)
command-execute(#f(compiled-function () (interactive nil) #<bytecode -0x1c38a4c4dc09f980>))
right, so it's coming from lsp-clojure--show-references
a custom function I created just to support clicking on lens and finding their references
does it work if you call lsp-find-references
manually instead of clicking on the lens for that symbol?
from the stack it seems server is returning the references correctly, so maybe it's some issue on lsp-mode side/your lsp-mode installation
keeps asking me if I want to format and I say no. I am using a code block. 🤷:skin-tone-5: Hmm…
so it seems something with your emacs/lsp-mode... any function that uses xref for showing on a little buffer the results it crashes
I work from SP! I meant, how do you install packages? via doom-emacs, spacemacs, vanila with straight.el etc
In my experience, it's pretty common to have bad compilation packages... I suggest reinstalling it and make sure remove it completly before reinstall
okay so started emacs up again and got
Symbol's function definition is void: transient-define-prefix
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with...
@U06T4ATTJ Try deleting ~/.emacs.d/elpa
and restart emacs, this solved a huge problem for me a while ago
I suggest using straight.el in the future for managing your packages, it's what doomemacs and I think spacemacs use and it's pretty reliable
yes, but since I have it in git, I can always go back. not sure what solution you have haha
I was not even born 😂 I'm surprised how much time one can use the same editor, Emacs is awesome.. I hope I use for long years too
So… when I nuke elpa and fire up emacs it is going to go out and fetch a gagillion packages… Hmm…
indeed… now I am facing the cruft of 31 years….
Emacs-x86_64-10_14[26378:2071973] It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out. If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug. This will be logged only once. This may break in the future.
Warning (initialization): An error occurred while loading '/Users/cue/.emacs.d/init.el':
File is missing: Cannot open load file, No such file or directory, ns-auto-titlebar
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the '--debug-init' option to view a complete error backtrace. Disable showing Disable logging
@UKFSJSM38 you still have that basic emacs lsp config that people can try documented somewhere? this helped me tremendously when debugging an issue last time
@U06T4ATTJ hope you made a backup
well remembered, https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/#basic-configurationyou meant?
@U06T4ATTJ I tested with an empty emacs config + that linked config once to verify that clojure-lsp worked and wasn't messed up by anything else