Open linpengcheng opened 2 years ago
Thank you for your interest in this plugin. May I ask you how you set up the Clojure language itself and the associated lsp?
I used the udl from here for the language and the lsp binary from here
and I do see communication from and to the clojure lsp
but I do see also exceptions from the clojure lsp like
Jun 05, 2022 3:05:53 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint logIssues
WARNING: Issue found in NotificationMessage: Message could not be parsed.
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 156 path $.params.contentChanges[0]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:225)
at org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.read(CollectionTypeAdapter.java:114)
at org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.read(CollectionTypeAdapter.java:40)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:130)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221)
at com.google.gson.Gson.fromJson(Gson.java:991)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.fromJson(MessageTypeAdapter.java:329)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.parseParams(MessageTypeAdapter.java:249)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:119)
at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:55)
at com.google.gson.Gson.fromJson(Gson.java:991)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:119)
at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:114)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:193)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 156 path $.params.contentChanges[0]
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:214)
... 22 more
So I'm not sure if I have my environment set up correctly and also, the latest code I am using is not yet published in the repo. I will push this today, at the latest tomorrow after some additional tests.
@linpengcheng the last pushes should solve some problems with the closure lsp server,
but it introduces a dirty hack because it looks like the json2 decoder has a problem decoding the double backslash inside a string.
@Ekopalypse Thank you for your reply and work, I'm looking forward to the release of v.0.0.11-alpha!
@linpengcheng - has been published. Thanks in advance for testing.
@Ekopalypse Thank you very much!
@Ekopalypse
In Windows 7 64 bit, it runs perfectly.
In Windows 10 64-bit and npp 8.4.2 x64, it only has auto-completion, others such as symbol (and reference) lists, lint hints, etc. none.
@Ekopalypse
In Windows 7 64 bit, it runs perfectly.
In Windows 10 64-bit and npp 8.4.2 x64, it only has auto-completion, others such as symbol (and reference) lists, lint hints, etc. none.
@linpengcheng
I tested it with Windows 10 from a VM and it seems to work now BUT on the very first startup it did not work. After using "Stop server for current language" followed by "Start server for current language" it worked and now it works even if I stop Notepad++ and restart. Strange. I saw similar behavior on Windows 7, but at the time I thought I was wrong about the configuration, now I'm not so sure. I'll definitely have to check this out further.
@Ekopalypse
Tested:
If Notepad++ is on the D drive, everything is fine.
If Notepad++ is on the C drive, it only has auto-completion, others such as symbol (and reference) lists, lint hints, etc. none.
@linpengcheng Strange, my test with Windows 10 was on C:. Can you restart Notepad++, do a test and then attach the output from the console? Maybe that will give us the necessary clue what is going on. The test sequence would be
Use the Console context menu to select and copy everything. The log does not contain any other potentially sensitive data, except for path and file names, and the actual code. You can make this information unrecognizable if necessary.
@Ekopalypse
The three messages received at the end are different.
(+ 1 2)
(+ 4 6)
(def x 1)
(defn f123 [x] 1)
(zip x)
(zipmap)
(flatten)
(zipmap)
starting language server: clojure
checking language server status: clojure
trying to start D:\npp\tools\clj\clojure-lsp.exe
running
checking current lexer
checking language server status: clojure
is already running
on_initialize: 9148
write_to_stdin: Content-Length: 2122
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":9148,"clientInfo":{"name":"NppLspClient","version":"0.0.1"},"rootUri":"file:///D%3A/tmp/src","initializationOptions":{},"capabilities":{"workspace":{"applyEdit":false,"workspaceEdit":{"documentChanges":false},"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":false},"configuration":false,"workspaceFolders":false},"textDocument":{"publishDiagnostics":{"relatedInformation":false},"synchronization":{"dynamicRegistration":false,"willSave":false,"willSaveWaitUntil":false,"didSave":true},"completion":{"dynamicRegistration":false,"contextSupport":false,"completionItem":{"snippetSupport":false,"commitCharactersSupport":false,"documentationFormat":["plaintext"],"deprecatedSupport":false},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":false,"contentFormat":["plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"documentationFormat":["plaintext"]}},"definition":{"dynamicRegistration":false},"references":{"dynamicRegistration":false},"documentHighlight":{"dynamicRegistration":false},"documentSymbol":{"dynamicRegistration":false,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":false},"codeLens":{"dynamicRegistration":false},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"onTypeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"documentLink":{"dynamicRegistration":false},"typeDefinition":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false},"colorProvider":{"dynamicRegistration":false},"foldingRange":{"dynamicRegistration":false,"rangeLimit":100,"lineFoldingOnly":true}}},"trace":"off","workspaceFolders":null}}
on_message_received: Content-Length: 134
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"begin","title":"clojure-lsp","percentage":0}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"begin","title":"clojure-lsp","percentage":0}'
}
on_message_received: Content-Length: 146
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Finding kondo config","percentage":5}}}Content-Length: 140
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Finding cache","percentage":10}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Finding kondo config","percentage":5}'
}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Finding cache","percentage":10}'
}
on_message_received: Content-Length: 148
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Copying kondo configs","percentage":15}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Copying kondo configs","percentage":15}'
}
on_message_received: Content-Length: 149
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Resolving config paths","percentage":15}}}Content-Length: 150
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Analyzing project files","percentage":20}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Resolving config paths","percentage":15}'
}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Analyzing project files","percentage":20}'
}
on_message_received: Content-Length: 124
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"end","message":"Project analyzed"}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"end","message":"Project analyzed"}'
}
on_message_received: Content-Length: 1887
on_message_received: {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":1,"save":{"includeText":true}},"hoverProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":[":","/"]},"signatureHelpProvider":{"triggerCharacters":[]},"definitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]},"codeLensProvider":{"resolveProvider":true},"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"renameProvider":{"prepareProvider":true},"declarationProvider":true,"executeCommandProvider":{"commands":["add-missing-libspec","add-import-to-namespace","move-coll-entry-up","cycle-privacy","create-test","drag-backward","promote-fn","change-coll","thread-last-all","drag-forward","unwind-all","move-to-let","clean-ns","suppress-diagnostic","move-coll-entry-down","thread-last","resolve-macro-as","introduce-let","add-missing-import","move-form","sort-map","unwind-thread","thread-first-all","thread-first","inline-symbol","extract-function","demote-fn","cycle-coll","expand-let","create-function","add-require-suggestion"]},"workspace":{"fileOperations":{"willRename":{"filters":[{"pattern":{"glob":"**/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}","matches":"file"},"scheme":"file"}]}}},"callHierarchyProvider":true,"linkedEditingRangeProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["namespace","type","function","macro","keyword","class","variable","method","event"],"tokenModifiers":["definition","defaultLibrary","implementation"]},"range":true,"full":true},"experimental":{"testTree":true,"cursorInfo":true,"serverInfo":true,"clojuredocs":true}}}}
initialized response received
write_to_stdin: Content-Length: 52
{"jsonrpc":"2.0","method":"initialized","params":{}}
on_file_opened:: clojure: D:\tmp\src\t.clj
on_file_opened: initialized=true
write_to_stdin: Content-Length: 258
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///D%3A/tmp/src/t.clj","languageId":"clojure","version":0,"text":"\n(+ 1 2)\n\n(+ 4 6)\n\n(def x 1)\n\n(defn f123 [x] 1)\n\n(zip x)\n\n(zipmap)\n(flatten)\n(zipmap)\n"}}}
write_to_stdin: Content-Length: 126
{"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///D%3A/tmp/src/t.clj"}}}
on_message_received: Content-Length: 241
{"jsonrpc":"2.0","id":"1","method":"client/registerCapability","params":{"registrations":[{"id":"id","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}"}]}}]}}
registerCapability: lsp.RegistrationParams{
registrations: [lsp.Registration{
id: 'id'
method: 'workspace/didChangeWatchedFiles'
register_options: '{"watchers":[{"globPattern":"**\/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}"}]}'
}]
}
write_to_stdin: Content-Length: 40
{"jsonrpc":"2.0","id":"1","result":null}
on_message_received: Content-Length: 631
on_message_received: {"jsonrpc":"2.0","id":1,"result":[{"name":"D:\\tmp\\src\\t.clj","kind":21,"range":{"start":{"line":0,"character":0},"end":{"line":999999,"character":999999}},"selectionRange":{"start":{"line":0,"character":0},"end":{"line":999999,"character":999999}},"children":[{"name":"x","kind":13,"range":{"start":{"line":5,"character":0},"end":{"line":5,"character":9}},"selectionRange":{"start":{"line":5,"character":5},"end":{"line":5,"character":6}}},{"name":"f123","kind":12,"range":{"start":{"line":7,"character":0},"end":{"line":7,"character":18}},"selectionRange":{"start":{"line":7,"character":6},"end":{"line":7,"character":10}}}]}]}
on_message_received: Content-Length: 1120
on_message_received: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///D%3A/tmp/src/t.clj","diagnostics":[{"range":{"start":{"line":7,"character":12},"end":{"line":7,"character":13}},"severity":2,"code":"unused-binding","source":"clj-kondo","message":"unused binding x","tags":[1]},{"range":{"start":{"line":9,"character":1},"end":{"line":9,"character":4}},"severity":1,"code":"unresolved-symbol","source":"clj-kondo","message":"Unresolved symbol: zip","tags":[]},{"range":{"start":{"line":11,"character":0},"end":{"line":11,"character":8}},"severity":1,"code":"invalid-arity","source":"clj-kondo","message":"clojure.core/zipmap is called with 0 args but expects 2","tags":[]},{"range":{"start":{"line":12,"character":0},"end":{"line":12,"character":9}},"severity":1,"code":"invalid-arity","source":"clj-kondo","message":"clojure.core/flatten is called with 0 args but expects 1","tags":[]},{"range":{"start":{"line":13,"character":0},"end":{"line":13,"character":8}},"severity":1,"code":"invalid-arity","source":"clj-kondo","message":"clojure.core/zipmap is called with 0 args but expects 2","tags":[]}]}}
starting language server: clojure
checking language server status: clojure
trying to start C:\dev\Notepad++\tools\clj\clojure-lsp.exe
running
checking current lexer
checking language server status: clojure
is already running
on_initialize: 12336
write_to_stdin: Content-Length: 2123
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":12336,"clientInfo":{"name":"NppLspClient","version":"0.0.1"},"rootUri":"file:///D%3A/tmp/src","initializationOptions":{},"capabilities":{"workspace":{"applyEdit":false,"workspaceEdit":{"documentChanges":false},"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":false},"configuration":false,"workspaceFolders":false},"textDocument":{"publishDiagnostics":{"relatedInformation":false},"synchronization":{"dynamicRegistration":false,"willSave":false,"willSaveWaitUntil":false,"didSave":true},"completion":{"dynamicRegistration":false,"contextSupport":false,"completionItem":{"snippetSupport":false,"commitCharactersSupport":false,"documentationFormat":["plaintext"],"deprecatedSupport":false},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":false,"contentFormat":["plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"documentationFormat":["plaintext"]}},"definition":{"dynamicRegistration":false},"references":{"dynamicRegistration":false},"documentHighlight":{"dynamicRegistration":false},"documentSymbol":{"dynamicRegistration":false,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":false},"codeLens":{"dynamicRegistration":false},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"onTypeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"documentLink":{"dynamicRegistration":false},"typeDefinition":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false},"colorProvider":{"dynamicRegistration":false},"foldingRange":{"dynamicRegistration":false,"rangeLimit":100,"lineFoldingOnly":true}}},"trace":"off","workspaceFolders":null}}
on_message_received: Content-Length: 134
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"begin","title":"clojure-lsp","percentage":0}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"begin","title":"clojure-lsp","percentage":0}'
}
on_message_received: Content-Length: 146
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Finding kondo config","percentage":5}}}Content-Length: 140
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Finding cache","percentage":10}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Finding kondo config","percentage":5}'
}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Finding cache","percentage":10}'
}
on_message_received: Content-Length: 148
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Copying kondo configs","percentage":15}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Copying kondo configs","percentage":15}'
}
on_message_received: Content-Length: 149
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Resolving config paths","percentage":15}}}Content-Length: 150
{"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"report","message":"Analyzing project files","percentage":20}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Resolving config paths","percentage":15}'
}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"report","message":"Analyzing project files","percentage":20}'
}
on_message_received: Content-Length: 124
on_message_received: {"jsonrpc":"2.0","method":"$/progress","params":{"token":"clojure-lsp","value":{"kind":"end","message":"Project analyzed"}}}Content-Length: 1887
{"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":1,"save":{"includeText":true}},"hoverProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":[":","/"]},"signatureHelpProvider":{"triggerCharacters":[]},"definitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]},"codeLensProvider":{"resolveProvider":true},"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"renameProvider":{"prepareProvider":true},"declarationProvider":true,"executeCommandProvider":{"commands":["add-missing-libspec","add-import-to-namespace","move-coll-entry-up","cycle-privacy","create-test","drag-backward","promote-fn","change-coll","thread-last-all","drag-forward","unwind-all","move-to-let","clean-ns","suppress-diagnostic","move-coll-entry-down","thread-last","resolve-macro-as","introduce-let","add-missing-import","move-form","sort-map","unwind-thread","thread-first-all","thread-first","inline-symbol","extract-function","demote-fn","cycle-coll","expand-let","create-function","add-require-suggestion"]},"workspace":{"fileOperations":{"willRename":{"filters":[{"pattern":{"glob":"**/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}","matches":"file"},"scheme":"file"}]}}},"callHierarchyProvider":true,"linkedEditingRangeProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["namespace","type","function","macro","keyword","class","variable","method","event"],"tokenModifiers":["definition","defaultLibrary","implementation"]},"range":true,"full":true},"experimental":{"testTree":true,"cursorInfo":true,"serverInfo":true,"clojuredocs":true}}}}
progress_notification: lsp.ProgressParams{
token: 'clojure-lsp'
value: '{"kind":"end","message":"Project analyzed"}'
}
initialized response received
write_to_stdin: Content-Length: 52
{"jsonrpc":"2.0","method":"initialized","params":{}}
on_file_opened:: clojure: D:\tmp\src\t.clj
on_file_opened: initialized=true
write_to_stdin: Content-Length: 258
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///D%3A/tmp/src/t.clj","languageId":"clojure","version":0,"text":"\n(+ 1 2)\n\n(+ 4 6)\n\n(def x 1)\n\n(defn f123 [x] 1)\n\n(zip x)\n\n(zipmap)\n(flatten)\n(zipmap)\n"}}}
write_to_stdin: Content-Length: 126
{"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///D%3A/tmp/src/t.clj"}}}
on_message_received: Content-Length: 241
{"jsonrpc":"2.0","id":"1","method":"client/registerCapability","params":{"registrations":[{"id":"id","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}"}]}}]}}
registerCapability: lsp.RegistrationParams{
registrations: [lsp.Registration{
id: 'id'
method: 'workspace/didChangeWatchedFiles'
register_options: '{"watchers":[{"globPattern":"**\/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}"}]}'
}]
}
write_to_stdin: Content-Length: 40
{"jsonrpc":"2.0","id":"1","result":null}
on_message_received: Content-Length: 267
on_message_received: {"jsonrpc":"2.0","id":1,"result":[{"name":"D:\\tmp\\src\\t.clj","kind":21,"range":{"start":{"line":0,"character":0},"end":{"line":999999,"character":999999}},"selectionRange":{"start":{"line":0,"character":0},"end":{"line":999999,"character":999999}},"children":[]}]}
on_message_received: Content-Length: 123
on_message_received: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///D%3A/tmp/src/t.clj","diagnostics":[]}}
@linpengcheng From the client's point of view, it works as expected because the Clojure server does not send any symbol or diagnostic information messages.
The left side comes from running from d: while the right side comes from running from c:. I've highlighted the interesting parts.
First, the client sends the didOpen notification to the Clojure server, and then it sends a documentSymbol request with id=1. On the left side, you can see that the Clojure server's response message contains information about children, while on the right side, it is empty. The same is true for the server's diagnostic message. On the left side it contains the required information, while on the right side it is, again, empty.
According to https://clojure-lsp.io/troubleshooting, the Clojure server writes a log file to the temp directory. For example, mine are named clojure-lsp.7606130629827034341.out
. Can you find a hint why C: is special in your case?
@Ekopalypse
Thank you very much!
I have this problem on both Win7 and win10 computers, I still have this problem running notepad++ with the administrator account, I can't find any hint why C: is special, I don't remember any special settings.
Fortunately, I only need to install Npp on the D disk to use it, this is not a problem.
WARN [clojure-lsp.kondo:276] - Non-fatal error from clj-kondo: No configs copied.
INFO [clojure-lsp.handlers:124] - :did-open 10ms
INFO [clojure-lsp.handlers:227] - :document-symbol 0ms
ERROR [clojure-lsp.kondo:281] - Error running clj-kondo on D:\tmp\src\t.clj
[37mcom.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine[m [32m WindowsJavaThreads.java: 138[m
[37mcom.oracle.svm.core.thread.JavaThreads.threadStartRoutine[m [32m JavaThreads.java: 596[m
[37mjava.lang.Thread.run[m [32m Thread.java: 829[m
[37mjava.util.concurrent.ThreadPoolExecutor$Worker.run[m [32m ThreadPoolExecutor.java: 628[m
[37mjava.util.concurrent.ThreadPoolExecutor.runWorker[m [32m ThreadPoolExecutor.java: 1128[m
[37mjava.util.concurrent.FutureTask.run[m [32m FutureTask.java: 264[m
[37mjava.util.concurrent.Executors$RunnableAdapter.call[m [32m Executors.java: 515[m
[37morg.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run[m [32mConcurrentMessageProcessor.java: 113[m
[37morg.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen[m [32m StreamMessageProducer.java: 94[m
[37morg.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage[m [32m StreamMessageProducer.java: 194[m
[37morg.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume[m [32m RemoteEndpoint.java: 187[m
[37morg.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification[m [32m RemoteEndpoint.java: 220[m
[37morg.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify[m [32m GenericEndpoint.java: 152[m
[37morg.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0[m [32m GenericEndpoint.java: 65[m
[37m...[m [32m [m
[33mlsp4clj.core.LSPTextDocumentService/[1;33mdidOpen[m [32m core.clj: 101[m
[33mclojure-lsp.handlers.ClojureLSPFeatureHandler/[1;33mdid-open[m [32m handlers.clj: 496[m
[33mclojure-lsp.handlers/[1;33mdid-open[m [32m handlers.clj: 128[m
[33mclojure-lsp.feature.file-management/[1;33mdid-open[m [32m file_management.clj: 38[m
[33mclojure-lsp.kondo/[1;33mrun-kondo-on-text![m [32m kondo.clj: 332[m
[33mclojure-lsp.kondo/[1;33mrun-kondo![m [32m kondo.clj: 272[m
[33mclojure-lsp.kondo/run-kondo!/[1;33mfn[m [32m kondo.clj: 274[m
[33mclj-kondo.core/[1;33mrun![m [32m core.clj: 195[m
[33mclj-kondo.impl.core/[1;33mprocess-files[m [32m core.clj: 543[m
[33mclj-kondo.impl.core/[1;33mcopied-config-paths[m [32m core.clj: 504[m
[37msun.nio.fs.WindowsPath.relativize[m [32m WindowsPath.java: 42[m
[37msun.nio.fs.WindowsPath.relativize[m [32m WindowsPath.java: 404[m
[1;31mjava.lang.IllegalArgumentException[m: [3m'other' has different root[m
INFO [clojure-lsp.handlers:124] - :did-open 46ms
INFO [clojure-lsp.handlers:227] - :document-symbol 0ms
I can replicate the issue and found the pattern when it happens
Npp C:
LSP C:
initial source is on C: ok
initial source is on D: fail
LSP D:
initial source is on C: ok
initial source is on D: fail
Npp D:
LSP C:
initial source is on C: fail
initial source is on D: ok
LSP D:
initial source is on C: fail
initial source is on D: ok
If the initial source file used to start the lsp server is on a drive other than Npp, it does not work. However, if it is on the same drive, source files from other drives can be opened afterwards. I assume the problem is in clj-kondo, a component used by the Clojure lsp server.
I've opened an issue with the clojure-lsp to get their opinion as well.
@Ekopalypse
What a very unexpected bug! Thanks!
[Help request] there is no interaction between the NppLspClient and the clojure-lsp server
first, thank you for your excellent project!
I feel that there is no interaction between the NppLspClient and the clojure-lsp server, and the lsp client cannot obtain a list of symbols, and cannot goto definitions, declarations, implementation, and find references.
notepad++ lsp config file:
lsp out console info:
clojure-lsp server is like properly working.
~/.config/clojure-lsp/config.edn
:log-path "x:/tmp/clojure-lsp.log"