This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-27
Channels
- # adventofcode (1)
- # announcements (5)
- # babashka (11)
- # beginners (41)
- # biff (16)
- # calva (2)
- # clj-together (1)
- # clojure (9)
- # clojure-austin (8)
- # clojure-doc (1)
- # clojure-europe (45)
- # clojurescript (4)
- # clr (14)
- # datomic (13)
- # figwheel (1)
- # fulcro (11)
- # introduce-yourself (2)
- # lsp (31)
- # malli (6)
- # off-topic (3)
- # releases (2)
- # reveal (8)
- # schema (1)
- # shadow-cljs (13)
- # spacemacs (10)
- # timbre (8)
- # transit (3)
- # xtdb (5)
Hey I'm kinda stuck. Could someone help me and give me some tips on how to debug? My LSP suddenly stopped working a day or two ago. I'm using Doom Emacs, Cider and clojure-lsp. I can see the server starting up, analyzing the project, but I can't see linter errors in the UI, nor can I see lenses etc. lsp-find-references
doesn't seem to find any references anymore.
This is happening in only one of my projects. When I change to another project, things work ok in the other project.
I checked the logs (`lsp-clojure-server-log`) but didn't find anything interesting there.
Any ideas on how to debug further?
could you share the server logs so we can see if the server is really starting sucessfully?
Sure, just a sec
2022-12-27T19:09:26.559Z INFO [clojure-lsp.db:66] - [DB] Reading transit analysis cache from /Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/.lsp/.cache/db.transit.json db took 1726ms
2022-12-27T19:09:26.890Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 242ms
2022-12-27T19:09:26.916Z INFO [clojure-lsp.startup:206] - [Startup] Using cached db for project root #object[sun.nio.fs.UnixPath 0xb7f3eda "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom"]
2022-12-27T19:09:26.917Z INFO [clojure-lsp.source-paths:85] - [Startup] Using source-paths from classpath: ["/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/ext/sharetribe.jetty.qos/src" "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/dev" "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/test" "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/ext/sharetribe.jetty.qos/target/classes" "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/src" "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom/build/config"]
2022-12-27T19:09:26.917Z INFO [clojure-lsp.startup:114] - Copying kondo configs from classpath to project if any...
2022-12-27T19:09:29.637Z WARN [clojure-lsp.kondo:305] - Non-fatal error from clj-kondo: No configs copied.
2022-12-27T19:09:29.637Z INFO [clojure-lsp.startup:116] - Copied kondo configs, took 2720ms secs.
2022-12-27T19:09:29.637Z INFO [clojure-lsp.startup:238] - [Startup] Analyzing source paths for project root #object[sun.nio.fs.UnixPath 0xb7f3eda "/Users/mikko/Documents/Projects/sharetribe/sharetribe-custom"]
2022-12-27T19:09:29.638Z INFO [clojure-lsp.startup:75] - [Startup] Project only paths analyzed by clj-depend, took 0ms
2022-12-27T19:10:08.255Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 2306ms
2022-12-27T19:10:08.451Z INFO [clojure-lsp.kondo:209] - Linting whole project for unused-public-var took 6859ms
2022-12-27T19:10:08.454Z WARN [clojure-lsp.kondo:305] - Non-fatal error from clj-kondo: No configs copied.
2022-12-27T19:10:12.282Z INFO [clojure-lsp.startup:71] - [Startup] Project only paths analyzed by clj-kondo, took 42644ms
2022-12-27T19:10:12.326Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 43ms
2022-12-27T19:10:12.337Z INFO [clojure-lsp.handlers:150] - [Startup] Analyzing test paths for project root file:///Users/mikko/Documents/Projects/sharetribe/sharetribe-custom
2022-12-27T19:10:12.337Z INFO [clojure-lsp.feature.clojuredocs:21] - [Clojuredocs] Refreshing clojuredocs cache...
2022-12-27T19:10:12.338Z INFO [clojure-lsp.handlers:128] - :initialize 47507ms
2022-12-27T19:10:12.338Z INFO [clojure-lsp.feature.java-interop:270] - [Java] JDK source already present on global LSP cache dir.
2022-12-27T19:10:12.338Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.338Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.338Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.339Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.339Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.340Z INFO [clojure-lsp.server:102] - :publish-diagnostics 1ms
2022-12-27T19:10:12.341Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.341Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.341Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.342Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.342Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.343Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.387Z INFO [clojure-lsp.server:102] - :publish-diagnostics 44ms
2022-12-27T19:10:12.388Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.410Z INFO [clojure-lsp.server:508] - Initialized!
2022-12-27T19:10:12.459Z INFO [clojure-lsp.db:66] - [DB] Reading transit analysis cache from /Users/mikko/.cache/clojure-lsp/db.transit.json db took 121ms
2022-12-27T19:10:12.459Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2022-12-27T19:10:12.459Z INFO [clojure-lsp.feature.java-interop:304] - [Java] JDK source cached loaded successfully.
2022-12-27T19:10:12.706Z INFO [clojure-lsp.server:102] - :publish-diagnostics 297ms
2022-12-27T19:10:12.706Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.706Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.707Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.707Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.708Z INFO [clojure-lsp.server:102] - :publish-diagnostics 1ms
2022-12-27T19:10:12.708Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.708Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.708Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2022-12-27T19:10:12.708Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.708Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.709Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.709Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.709Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.709Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.709Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.709Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.712Z INFO [clojure-lsp.server:102] - :publish-diagnostics 2ms
2022-12-27T19:10:12.712Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.712Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.713Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.714Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.715Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.715Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.715Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.715Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.715Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.716Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.716Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.716Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.716Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.716Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.717Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.717Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.717Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.717Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.717Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.718Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.725Z WARN [clojure-lsp.kondo:305] - Non-fatal error from clj-kondo: No configs copied.
2022-12-27T19:10:12.726Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2022-12-27T19:10:12.727Z INFO [clojure-lsp.handlers:158] - :did-open 20ms
2022-12-27T19:10:12.727Z INFO [clojure-lsp.server:164] - :refreshing-test-tree 0ms
2022-12-27T19:10:12.727Z INFO [clojure-lsp.handlers:253] - :document-highlight 0ms
2022-12-27T19:10:12.727Z INFO [clojure-lsp.handlers:422] - :code-lens 0ms
2022-12-27T19:10:12.755Z INFO [clojure-lsp.handlers:410] - :code-actions 28ms
2022-12-27T19:10:12.945Z INFO [clojure-lsp.server:102] - :publish-diagnostics 228ms
2022-12-27T19:10:12.946Z INFO [clojure-lsp.handlers:253] - :document-highlight 0ms
2022-12-27T19:10:12.946Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.handlers:253] - :document-highlight 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.handlers:422] - :code-lens 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.handlers:253] - :document-highlight 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2022-12-27T19:10:12.947Z INFO [clojure-lsp.handlers:253] - :document-highlight 0ms
Looks pretty correct from server side, so maybe it's something on client side? (emacs)
All looks good after M-x lsp
. Prints LSP :: Connected to [clojure-lsp:<port>
.
On the status line I can see on the right side the "lightbulb" icon for code actions and the red/yellow/green numbers
The features don't seem to work. For example finding references doesn't work.
And e.g. renaming doesn't work. It says "Can't rename, no element found".
Yeah, pretty strange indeed. And this is project specific. If I switch to another projects, everything works fine. This started happening quite suddenly. I didn't do any config changes, emacs package updates or anything like that.
> does the same project work with vscode? Uhm, no idea, I never used vscode 🙂
A colleague of mine uses Calva and she hasn't mentioned any issues with LSP.
I tried to turn on the "io" logs. I'm not sure what to look at there, but one thing I noticed is that there are some requests that seem to get back empty responses, like:
[Trace - 09:22:53 PM] Received response 'textDocument/hover - (1010)' in 68ms.
Result: {
"contents": []
}
[Trace - 09:23:54 PM] Received response 'textDocument/references - (1011)' in 2ms.
Result: []
[Trace - 09:24:05 PM] Received response 'textDocument/documentHighlight - (1013)' in 2ms.
Result: []
Ok, I git cloned the project to another directory and opened that in Emacs, and now LSP is again working. Must be something in some local files I have...
Hum, maybe try removing .lsp/.cache
and .clj-kondo/.cache
, but that's pretty weird, I don't think cache is related to that
Ok, found out the reason 😄 In the root of the project, I had a directory with a name -
(plain dash, nothing more). Deleting that directory fixed the issue. I was able to reproduce this with the other project that was working all the time. I mkdir -
in the root of that project and indeed, LSP stoped working there also.
This -
directory wasn't checked in to version control, that's why git clone to another directory worked.
oh, pretty corner case indeed, feel free to open a issue on clojure-lsp so I can take a closer look later and check if it's something should be fixed server or client side
Ok, I'll do that. Very corner case indeed. Couple of days ago I was testing something with weird file names and directories and that's why I added the -
directory.
(And because it was an empty directory, I didn't spot it with git status
)
@UKFSJSM38 Thanks for support and maintaining the project! 🙂
The -
is typically used as a way to indicate reading from stdin. In clj-kondo this is also the case.
So if you say: clj-kondo --lint -
it won't lint the -
directory, but reads input from stdin
Ok, found out the reason 😄 In the root of the project, I had a directory with a name -
(plain dash, nothing more). Deleting that directory fixed the issue. I was able to reproduce this with the other project that was working all the time. I mkdir -
in the root of that project and indeed, LSP stoped working there also.