Closed dalanicolai closed 2 years ago
Hi Daniel, 71a2fe4313f8d95f27bad4ecd0e136e13c05234a is supposed to fix the issue, but I haven't tested it yet. Thanks for your feedback, could you try it again?
Great! Thanks, that does fix this issue. However, a little later but still very soon after connecting, the server crashes again. This time, the 'last parts of the communication' look as follows (I guess only the last block is relevant):
[Trace - 02:24:08 PM] Sending request 'textDocument/codeLens - (29)'.
Params: {
"textDocument": {
"uri": "file:///home/dalanicolai/test/wolfram/test.wls"
}
}
[Trace - 02:24:08 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///home/dalanicolai/test/wolfram/test.wls",
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 4
},
"end": {
"line": 2,
"character": 5
}
},
"severity": 1,
"source": "Wolfram",
"message": "[UnterminatedGroup] Missing closer.",
"tags": [],
"data": []
}
]
}
[Trace - 02:24:08 PM] Received response 'textDocument/codeLens - (29)' in 151ms.
Result: []
[Trace - 02:24:17 PM] Sending notification 'textDocument/didChange'.
Params: {
"textDocument": {
"uri": "file:///home/dalanicolai/test/wolfram/test.wls",
"version": 16
},
"contentChanges": [
{
"text": "#!/usr/bin/env wolframscript\n\nPlot[Cos\n"
}
]
}
And now the stderr gives:
[INFO 2022-06-12T14:22:57] Initializing Wolfram Language Server
[INFO 2022-06-12T14:23:04] Language server is connecting the client through
socket.
[INFO 2022-06-12T14:23:04] Server listening from port 43931...
WolframLanguageServer`Server`Private`NestedLookup::NotAssoc:
Null is not an association and cannot lookup for key debuggerPort.
[INFO 2022-06-12T14:23:04] The server is initialized in 9.787618 s.
[INFO 2022-06-12T14:23:04] {InitialCheck, Quantity[0.198635, "Seconds"]}
[INFO 2022-06-12T14:23:10] {JustContinue, Quantity[0.205169, "Seconds"]}
[INFO 2022-06-12T14:23:12] {JustContinue, Quantity[0.179712, "Seconds"]}
[INFO 2022-06-12T14:23:13] {JustContinue, Quantity[0.361634, "Seconds"]}
[INFO 2022-06-12T14:23:14] {ClientProcessCheck, Quantity[0.06097276681518515,
"Seconds"]}
DataType`TypeCheck::mispat:
Null doesn't match the pattern of "clientProcessId" in
WolframLanguageServer`Server`Private`WorkState.
DataType`TypeCheck::mispat:
Null doesn't match the pattern of "clientProcessId" in
WolframLanguageServer`Server`Private`WorkState.
[INFO 2022-06-12T14:23:14] Client process is no longer alive. Exiting...
[INFO 2022-06-12T14:23:14] Closing socket connection...
[INFO 2022-06-12T14:23:14] Server stopped normally.
Process lsp-wl stderr finished
[INFO 2022-06-12T14:24:00] Initializing Wolfram Language Server
[INFO 2022-06-12T14:24:07] Language server is connecting the client through
socket.
[INFO 2022-06-12T14:24:07] Server listening from port 40033...
WolframLanguageServer`Server`Private`NestedLookup::NotAssoc:
Null is not an association and cannot lookup for key debuggerPort.
[INFO 2022-06-12T14:24:08] The server is initialized in 10.496336 s.
[INFO 2022-06-12T14:24:08] {InitialCheck, Quantity[0.266789, "Seconds"]}
[INFO 2022-06-12T14:24:17] {JustContinue, Quantity[0.1054, "Seconds"]}
[INFO 2022-06-12T14:24:18] {ClientProcessCheck, Quantity[0.027395146209716614,
"Seconds"]}
DataType`TypeCheck::mispat:
Null doesn't match the pattern of "clientProcessId" in
WolframLanguageServer`Server`Private`WorkState.
DataType`TypeCheck::mispat:
Null doesn't match the pattern of "clientProcessId" in
WolframLanguageServer`Server`Private`WorkState.
[INFO 2022-06-12T14:24:18] Client process is no longer alive. Exiting...
[INFO 2022-06-12T14:24:18] Closing socket connection...
[INFO 2022-06-12T14:24:18] Server stopped normally.
Process lsp-wl stderr finished
Would be great if this could be fixed also.
Aha, seems lsp-mode or eglot (which one do you use?) doesn't send the clientProcessId. Should be fixed in https://github.com/kenkangxgwe/lsp-wl/commit/b6470221304b14bb77579e5852ccb1c88485e115, while I still haven't got a linux emacs environment to test this conveniently.
Works great! The server seems to be 'stable' again now.
One small, not so important comment; when I add a shebang line at the beginning of the buffer, then the first line of the code below it gets very much indented, while it should not get indented at all. I am not sure if this is due to LSP (which is what I am using via Spacemacs), or due to lsp-wl. But this is only a small 'cosmetic' issue, which does not bother me at all. Just wanted to inform you about it.
Again, thanks a lot for your help and your work! :+1:
Is that due to the wolfram-mode
emacs package itself? Currently, the server doesn't do any formatting.
Ah, you're right... it is! I had not really used wolfram-mode
yet, I just installed it and then focused on configuring LSP first.
I am trying to use the LSP server (again) with Emacs, however, the connection with the server is lost soon after connecting establishing it.
I have no knowledge about the LSP protocol, but it looks like it has to do with Emacs sending:
here is the stderr from the server:
I have found the following info in the LSP docs: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage.
So might this happen because the server is not ignoring this request?
Would be great if this issue could get fixed.
Anyway... thanks a lot for creating and sharing this great package!