reddit / emacs

LSP-Mode: Clojure

jghobbies · 2022-11-21 16:43
Not sure whether to ask this in the clojure sub-reddit or here so trying here first: I use LSP Mode with the clojure lsp server. No problems generally. However, I suddenly have one project that refuses to work with lsp. What I've looked at/tried: * other projects with similar deps.edn work just fine * lsp describe session looks identical for the working projects and the one that doesn't * nothing looks untoward in the lsp-io-log, though I don't know the protocol well I could be missing something, no errors though * I've blown away my projectile and lsp caches to start from scratch, same issue * if I manually add my src dir and restart the lsp workspace lsp starts working (of course only down the src dir) * clojure -Spath shows "src" as an element in the classpath both before and after I manually add the src path\ * lsp claims to initialize successfully and lsp-describe-sessions shows a visited clj file as a buffer under the root of the project * after manually adding the src dir and restarting the workspace I wind up with two versions of that project in lsp-describe-sessions: one with "/src" and one without. The visited buffer now exists under the new root but not the original I'd prefer not to spend the day digging into lsp-mode/the lsp server, so if anyone has any insights I'd appreciate it.
yyoncho · 2022-11-21 18:29
It is best to use lsp-mode's discord (linked from the readme). > after manually adding the src dir and restarting the workspace I wind up with two versions of that project in lsp-describe-sessions: one with "/src" and one without. The visited buffer now exists under the new root but not the original I dont think you need the src folder. Usually, you need only the folder containing the project build files. I am cc-ing u/ericdallo. He is clojure-lsp and lsp-mode co-maintainer.
ericdallo · 2022-11-21 19:36
As yyoncho mentioned, you only need to import the project root, not any src folder unless you have a crazy project structure which I doubt. Any possibility to create a sample project with the same project structure that I can try? Since this is probably more related to clojure-lsp, for faster feedback, I suggest you ask on Clojurians Slack #lsp channel: https://clojurians.slack.com/archives/CPABC1H61
jghobbies · 2022-11-21 19:56
Ty, and yeah for all of my other projects I don't need src specifically.
jghobbies · 2022-11-21 19:59
>As yyoncho mentioned, you only need to import the project root, not any src folder unless you have a crazy project structure which I doubt. >Any possibility to create a sample project with the same project structure that I can try? > > >Since this is probably more related to clojure-lsp, for faster feedback, I suggest you ask on Clojurians Slack #lsp channel: https://clojurians.slack.com/archives/CPABC1H61 I can try to reproduce the issue, though creating a brand new project worked without a problem. I'll see if I can reproduce, dig in a little more, then ask in slack if I can't get anywhere.
jghobbies · 2022-11-28 21:20
Just an update... I copied the directory and the problem went away. I kept the original so I can come back to it when I get a chance and track down the issue. My guess is that projectile was confused about the root of the project or something similar outside of lsp-mode.