This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-15
Channels
- # aleph (1)
- # announcements (7)
- # beginners (6)
- # calva (24)
- # cider (18)
- # clj-otel (1)
- # clojars (8)
- # clojure (22)
- # clojure-dev (11)
- # clojure-europe (52)
- # clojure-finland (12)
- # clojure-nl (1)
- # clojure-norway (28)
- # clojure-uk (7)
- # clojured (1)
- # cursive (6)
- # datomic (1)
- # events (1)
- # humbleui (41)
- # hyperfiddle (75)
- # lsp (46)
- # malli (34)
- # matrix (1)
- # off-topic (16)
- # releases (1)
- # shadow-cljs (12)
- # squint (11)
- # timbre (1)
- # tools-deps (24)
Hey friends, I just implemented a new custom feature on clojure-lsp's master which I think would be nice add to Calva :) LMK if need any help https://github.com/clojure-lsp/clojure-lsp/issues/1752#issuecomment-1892042702
Thanks for headsup! Looks awesome. I’d like som pointers on how to add it to Calva. Is it something included in the LSP spec or how is it supposed to be implemented by a client. I see this outline for project files, maybe that’s where it should show up?
it's completly custom feature not support by the spec but since lsp4clj
has all the hard stuff, it was easy to create a new clojure/workspace/projectTree/nodes
request, @U0ETXRFEW you can check the integration documentation https://clojure-lsp.io/capabilities/#project-tree
@U0ETXRFEW I was insipired by java vscode and intellij plugin, the create a specific window for that
Great with that custom command too, I think might be something a #joyride script can make use of. Especially https://github.com/PEZ/backseat-driver I am currently playing with. 😃
I think would be nice to support in Calva OOTB without any extra config BTW the original issue user was asking that feature to be used on Calva
Indeed. The support for the project tree outline should be Calva OOTB. The command is for Joyriders to have fun with.
Also, this is not the first custom feature on clojure-lsp, we have the https://clojure-lsp.io/features/#test-tree as well which may be similar to implement :)
Yes, when I followed your first link, I saw that test tree. It is very interesting. We are already using clojure-lsp to populate our Test Explorer integration, and maybe this test tree is a better way to do it than we currently do. (Not that I remember how we do it right now, but anyway.)
yeah, I'm not sure how it's done, but would be nice to clojure-lsp clients delegate these things to a single place like clojure-lsp if possible
I updated to the latest version of Calva and I do not know if I messed with a setting or something but I have the correct workspace root chosen but when I go to run "Go To Definition" it always tries to append app/
to the beginning of the path even though the code is in src/
so the file does not open.
Example:
Tries to open src/my/namespace
for the symbol my-func
It tries to open app/src/my/namespace
instead.
I cannot see what settings would affect this but I feel like it has something to do with my workspace root? Any help or tips would be appreciated 😄
These are my Calva options if it helps
"calva.highlight.enableBracketColors": true,
"calva.autoOpenREPLWindow": true,
"calva.highlight.rainbowIndentGuides": true,
"calva.fmt.newIndentEngine": true,
"calva.evalOnSave": true,
"calva.showDocstringInParameterHelp": true,
"calva.paredit.defaultKeyMap": "strict",
"calva.prettyPrintingOptions": {
"printEngine": "pprint",
"enabled": true,
"width": 120,
"maxLength": 50
},
clojure-lsp is running just fine in the project root as wellIts a deps.edn
project
It actually looks like its trying to open
Where is that coming from
That’s generally when looking up things in library code. Can you share your deps.edn? Or at least the parts of it having to do with classpath and such.
The only time I set paths are at the root
:paths ["src" "resources"]
And in a :dev
alias
:extra-paths ["dev/src" "dev/resources"]
And for testing in a :test
alias
:extra-paths ["test"]
If it works for you, we can have a quick huddle and look at the project together. It’s more effective than me blindly guessing async like this. 😃
I would have to redact some things but let me figure that out... The Clojure LSP classpath is actually fine. The problem is when I connect the REPL. When the REPL is connected look up by definitions does not work. When the REPL is not connected look up by definitions works....