This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-17
Channels
- # announcements (2)
- # asami (3)
- # babashka (30)
- # beginners (23)
- # calva (28)
- # cider (3)
- # clj-kondo (16)
- # clj-on-windows (7)
- # cljs-dev (7)
- # clojure (47)
- # clojure-austin (3)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-nl (1)
- # clojure-uk (3)
- # clojurescript (54)
- # community-development (24)
- # conjure (16)
- # duct (1)
- # emacs (8)
- # events (1)
- # figwheel-main (4)
- # fulcro (13)
- # gratitude (20)
- # helix (3)
- # honeysql (8)
- # hyperfiddle (12)
- # introduce-yourself (1)
- # jobs (6)
- # lambdaisland (1)
- # lsp (35)
- # malli (1)
- # meander (27)
- # minecraft (11)
- # off-topic (12)
- # pathom (1)
- # portal (11)
- # releases (1)
- # remote-jobs (1)
- # ring (11)
- # sci (1)
- # shadow-cljs (53)
- # specter (5)
- # xtdb (20)
[solved]
Curious error message from Clojure LSP regarding Leiningen when first adding LSP to a project.
Strangely its a deps.edn
project, although I added an empty profile.clj
file for deploying to Heroku (to identify its a Clojure project).
Is there a way to tell clojure-lsp that the project is defined by deps.edn rather than project.clj, perhaps avoiding this error?
I am aware that Leiningen will generate the -Xverify:none error as I am using Java 17. Is that actually affecting the classpath clojure-LSP will use? Any useful things I can do to check?
LSP :: Connected to [clojure-lsp:1226824/starting].
LSP :: Classpath lookup failed when running `lein with-profile +dev,+test,+test,+dev classpath`. Some features may not work properly. Error: OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
LSP :: clojure-lsp:1226824 initialized successfully in folders: (/home/practicalli/projects/practicalli/banking-on-clojure-webapp)
Ah, it seems I can set up something like this. I'll test to see if this removes that message
:project-specs [{:project-path "deps.edn"
:classpath-cmd ["clojure" "-M:env/dev:env/test" "-Spath"]}]
Yes, creating .lsp/config.edn
and adding the above in a hash-map no longer generates the Classpath message
Even so, clojure-lsp will get both classpaths and merge, what was not working before that?
The error suggested the classpath hadn't loaded, but I didn't notice any specific issues. I can test by removing the LSP config I added to see if there is an actual effect other than getting rid of the message, although it sounds like there would not be.
yeah, if it was a invalid project.clj file, like missing parens or things that lein wouldn't understand, that's expected
Yes, it would be an invalid project.clj file, as it not really supposed to be used. Once I write a different deploy script I won't need the project.clj file... 😁
Can I prevent clojure-lsp from trying to read the project.clj files? In the middle of a migration from lein to Clojure tools now and it's broken 🙂
@U6T7M9DBR does the project-specs
configuration work for you?
Add the following to .lsp/config.edn
in the project currently being migrated.
:project-specs [{:project-path "deps.edn"
:classpath-cmd ["clojure" "-M:env/dev:env/test" "-Spath"]}]
If there is no way to tell Clojure LSP to ignore the project.clj
file then I suggest commenting the :deps
section of the project.clj
file as a temporary workaround. Remember to keep the project.clj
a valid clojure file, otherwise there will be errors.The way to ignore is indeed define a project-spec like @U05254DQM suggested
Great! I think the problem might be the way my project is structured. There's a git root, and that folder contains multiple other folders that each have a deps.edn, resulting in something like:
.
├── a
│ ├── deps.edn
│ └── project.clj
└── b
├── deps.edn
└── project.clj
You could have a root deps.edn file that links to all subprojects, that's how clojure-lsp project itself works
Ah, it seems like a mono-repo. Perhaps you need an .lsp/config.edn
in each project. Or alternatively add the above configuration to a user level Clojure LSP configuration, e.g. $HOME/.config/clojure-lsp/config.edn
I guess it depends if there are other leiningen projects to be worked on.
Hey, I have been facing a problem with new projects, as they don't show the docs or go-to-definition from external libraries. I have pulled out all dependencies and actually ran the project, but even though it's only working for old projects that were already in my machine. Am I missing something?
I'm going to read the troubleshooting, but it's a good tip to ensure it's updated. Thanks @UKFSJSM38 for the initial support
LSP isn't active in my current emacs buffer and i would expect it to be. As an example i try to describe a variable i get this message:
Error running timer: (error "The connected server(s) does not support method textDocument/hover.
To find out what capabilities support your server use 'M-x lsp-describe-session'
and expand the capabilities section")
lsp-describe-session opens a gui tree that doesn't list the current file/buffer.ah, it is in lsp-workspace-folders-remove. How is that different then the "blacklist"?
i assume i want to remove my folder from lsp-workspace-folders-remove.