This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-26
Channels
- # asami (2)
- # babashka (1)
- # beginners (31)
- # calva (11)
- # clj-together (3)
- # clojure (43)
- # clojure-europe (6)
- # clojure-norway (1)
- # clojurescript (14)
- # core-async (3)
- # core-logic (24)
- # cryogen (6)
- # datascript (2)
- # datomic (3)
- # fulcro (35)
- # honeysql (2)
- # hyperfiddle (12)
- # kaocha (3)
- # lsp (11)
- # off-topic (10)
- # pathom (2)
- # reagent (14)
- # releases (1)
- # sci (11)
- # shadow-cljs (27)
- # tools-deps (7)
Is there a way to use clojure-lsp without files? Like in a Clojure buffer inside emacs, where there are no corresponding files.
Theorycally, LSP servers and clients should handle URI as document identifiers and don't expect to files exists on disk, but TBH it's not that easy to support that. Clojure-lsp probably work for singles files but I don't think it will work for whole projects if no file is persisted
My use is for a single buffer, I often open a new buffer and connect a REPL for one off sessions, where I never save, so there's no real file. But I could probably solve my use-case easily by having a playground project that I just erase/reuse instead, so I don't think it's a high priority.
yeah, even so, for a single buffer, it should work, I didn't test extensively though
When I follow a definition for a function, I end up in .emacs.d/local/.cache/workspace/.cache/file.clj`` , and I can't evaluate the modifications I make in that buffer. Is there a way to evaluate some snippet in the dependency (I remember doing this before, but maybe it's because I was brought in
~/.m2/...
?)
that's a good question, TBH I never thought about that kind of workflow. If you go to a definition of a external deps you end up in that file indeed and lsp mark the buffer as read only, you can toggle the read-only mode though and make any changes you want. About the eval, I'm not sure why cider don't allow evaluating that buffer, with a error of:
No linked CIDER sessions
I suspect it doesn't know that file is linked to the existing session of your project, probably because they are not under the same project root :thinking_face:I found a workaround:
• after changing the buffer, you can cider-connect
and specify the nrepl port that is up and running for your project, then eval that buffer will work
I know it's one more step but probably is not something you want to do all the time?