Hm, nope. That's unfamiliar
try this:
lsp-workspace-folder-remove
RET
choose-your-project
RET
then on your project file: lsp
then it'll ask you that question
Hm. It didn't ask me. It just said "LSP connected" in the minibuffer.
hum, ok, to check if the project root is ok, try this: lsp-clojure-server-info
Same if I just open the project file straight from a new run of emacs. initialized successfully
but it doesn't ask me anything.
and check the :project-root
The root is correct.
afk for half an hour, sorry... my family is calling me to supper. Thanks for the help. π
np, feel free to open an issue with detailed info later, good luck π
@ericdallo Where does one find the "request/response" logs mentioned in the issue template?
it depends on the editor, for lsp-mode, check the first buttlet: https://emacs-lsp.github.io/lsp-mode/page/troubleshooting/
oh sorry, it is the bullet that says to enable lsp-log-io
ok
(That's probably worth pointing to from the GitHub issue template, since I don't think I would have dug far enough to uncover that on my own and you'll probably want to stop hand-holding beginners like me at some point. π )
Yeah, I created that template today π will do that, thanks!
Nice, will check it tomorrow morning, thanks for the issue π
Of course. Thanks for all the help!
β― clojure-lsp
Exception: java.io.FileNotFoundException thrown from the UncaughtExceptionHandler in thread "main"
πOn Ubuntu Bionic
clojure-lsp 2021.02.11-12.43.06
Oh, nm. It was because I didn't own /tmp/clojure-lsp.out
Hum, probably, but that's something we could think in improve
Does that works after fixing the permission of that file?
It does. Well, I rm'ed it.
diff --git a/src/clojure_lsp/main.clj b/src/clojure_lsp/main.clj
index 3175065..07ca3fe 100644
--- a/src/clojure_lsp/main.clj
+++ b/src/clojure_lsp/main.clj
@@ -67,8 +67,9 @@
(org.eclipse.lsp4j.services LanguageServer TextDocumentService WorkspaceService LanguageClient))
(:gen-class))
+(let [log-file (str (java.io.File/createTempFile "/tmp/clojure-lsp." ".out"))]
(log/merge-config! {:appenders {:println {:enabled? false}
- :spit (log/spit-appender {:fname "/tmp/clojure-lsp.out"})}})
+ :spit (log/spit-appender {:fname log-file})}}))
(log/handle-uncaught-jvm-exceptions!)
?i think that would just be (File/createTempFile "clojure-lsp" "out")
. no need for /tmp
if you're asking for a temp file
Looks good, thanks @clojurians-slack100 and @dpsutton, will do a quick fix for that case
One of the many curses of using separate system users for work and personal stuff π
Especially when both of them love Clojure π
I think the issue with createTempFile
is that it creates a file with a random name, like /tmp/clojure-lspasd9875378701614937720out
That's why I added the dots to both parts π
yeah, I mean, is not a fixed filename, and it can make debugging for users hard since the filename is dynamic
and every restart will create a new file, it'll make debugging more complicated
True, but it's a fairly common pattern:
β― ls /tmp/sqlite-3.3*
/tmp/sqlite-3.32.3.2-83b99715-c2fa-440e-a084-8fa21c33aed6-libsqlitejdbc.so /tmp/sqlite-3.34.0-3365351e-9f50-4e3d-a939-e33fbca6b5ef-libsqlitejdbc.so /tmp/sqlite-3.34.0-95adfa61-21fc-407d-854d-38c263c85536-libsqlitejdbc.so
/tmp/sqlite-3.32.3.2-83b99715-c2fa-440e-a084-8fa21c33aed6-libsqlitejdbc.so.lck /tmp/sqlite-3.34.0-3365351e-9f50-4e3d-a939-e33fbca6b5ef-libsqlitejdbc.so.lck /tmp/sqlite-3.34.0-95adfa61-21fc-407d-854d-38c263c85536-libsqlitejdbc.so.lck
There's details in ls -l
to show which is latest, at least π
Yeah, it'd be better to use that as a fallback, not sure the best way to do it though
Pro of going with suggestion: log files don't get clobbered on successive runs
yeah, still think this will make debug not easy π
Well, I will change to something like that, probably to debug, something like tail -f /tmp/clojure-lsp.*.out
should be enough, thanks for the suggestion π
Thanks for your awesome work on clojure-lsp π
Does lsp call hierarchy (via Emacs / treemacs) have any known issues or limitations? It looks to me like the analysis is restricted to just a single namespace, and that it doesnβt detect calls from inlined defrecord protocol extensions?
Iβve just been trying out clojure-lsp and lsp-mode and have been unsuccessful with the find references / definitionβ¦ it doesnβt seem to find them
is there initial indexing that needs to be done
yes
It's sometimes not entirely clear to me when this index is triggered or how to forcefully trigger it... I hope Eric or Snoe can help you out here.
The one time where it does not do a scan is if there is no "project root", i.e., no deps.edn, project.clj or boot.clj in the "root" folder.
Those have to exist for it to kick in and do it's work.
there is a deps.edn but itβs not in the git repo root
ah, that may not cause it to trigger then.
I had this yesterday. I had a single directory with a "src/foo.clj" and no scan was done
until I learnt I had to put a deps.edn in the root
You can see that if you tail the /tmp/clojure-lsp-$date.log
file
(if you're up to date on clojuree-lsp, otherwise it's just /tmp/clojure-lsp.log
Not to be signalling too much virtue, but @ericdallo has a patreon page, and I seem to be his main supporter. That seems wrong to me π
Thank you @slipset β€οΈ
@rickmoynihan It's a experimental feature, but it should be work for references in whole project regaring that call, do you have a repro?
@tatut to find references work, the initial project classpath scan needs to happen, check /tmp/clojure-lsp.*
logs to see if there is any error/classpath scan error
Not yet, just on my machine in a large proprietary project π
canβt find any logs in /tmp (took latest graalvm build from github release page)
It should work for big projects, you can try to create a sample project and test it
@ericdallo My whole motivation for trying clojure-lsp
was the flurry of activity in this channel. Are you working on it full-time?
when clojure-lsp start, it should create a /tmp/clujre-lsp.$date.out
:thinking_face:
hahah the activity was really increased recently π but no, I work on it in my "Free time" π
@tatut could you try with the embedded jar from the releases, https://github.com/clojure-lsp/clojure-lsp/releases/download/2021.02.12-03.13.12/clojure-lsp?
sure
Wow.
nothing in /tmp now either, I verified with ps
that it is indeed the correct version running
Maybe some day, I'd really like to live from open source π
running on macOS Catalina
hum, maybe some permission issue with your /tmp? :thinking_face:
Latest release changed to use File/createTempFile
https://clojurians.slack.com/archives/CPABC1H61/p1613095375099900 but that should work
might be as this is my employers machine and has some device management stuff on it
Iβll try on my home machine later, thanks for the help
good to know!, we should fix it for those cases too, not sure the best approach here yet :thinking_face:
must say, those code actions are working suppar
select a word, change list to vector etc..
Nice π