Closed CSchoel closed 3 years ago
We think this would be really great! Especially since this would allow us to check if we return the Errors and Completions the right way. So that they are correctly interpreted by a working LSP client.
On it. :+1:
Yesterday evening I used a bit of my spare time after work to implement a diagnostic server in MopeSWTP-SS21/LSP4J-test-CS, which logs all the messages it receives from the client.
The client itself is still in the "Hello World"-stage and I therefore have not published it yet, but I think I will be able to do so tomorrow.
Side note and question to all of you who might be more familiar with the LSP protocol than me: Do you know what happens, when I add a folder to my workspace on the client side of LSP? Currently, this is an operation that crashes my client - I guess because the server does not implement some relevant message type or answers with a null result where it shouldn't. I suspect it could have something to do with the ServerCapabilities
object. Unfortunately there is no clear error message and the only message I see from the client is the shutdown message.
I am not sure what actually happens during workspace changes.
But i think the Idea is that the Client sends a didChangeWorkspaceFolders Notification to the Server so the server might load the files of the new workspace (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWorkspaceFolders)
From my understanding this notification should only be sent if the server specified that in ServerCapabilities
, which needs to be returned in the InitializeResult during InitializeRequest. You are not doing that, so... no Idea:)
I think we are both on the right track: Adding the capabilities in the initialize call did allow me to log the didChangeWorkspaceFolders
event, but the client still shuts down the server. Seems like I have to learn how to define breakpoints in the vscode-languageclient package. :thinking:
As promised, you can now find the first version of the extension in MopeSWTP-SS21/vs-code-client including a README that explains how to setup a connection between client and server. I have not currently tested the extension with your Mo|E server, but only with the new DiagnosticServer
implemented in MopeSWTP-SS21/LSP4J-test-CS.
Current features:
Mo|E: connect
command (allows to choose port)Mo|E: disconnect
command.mo
files opened in the editorloadModel
request using the Mo|E: loadModel
commandThe error due to adding workspace folders still persists. I will open a separate issue for this.
Update: Issue has been created here: https://github.com/MopeSWTP-SS21/LSP4J-test-CS/issues/2 (I suspect the error is on the server side.)
This issue is still open, because it needs a review. I want to be sure that somebody else besides me can start and use the client. :wink:
Hopefully #51 will provide a test case.
I managed to connect the VSCode-Client with our MopeServer (see https://github.com/MopeSWTP-SS21/MopeSWTP/issues/51) . I didn't have a lot problems:)
After our discussion yesterday I thought a little more about the pros and cons of a VS Code extension. I can fully understand why you would like to have one for testing. I still think that the development effort would detract too much from the core server features, but maybe I can offer you to develop the client myself while you are working on the server. I did some first experiments yesterday and got a "hello world"-version of the extension running in a few hours, so I think it could be realistic to have a first working version on Friday evening. From my point of view this would have the following benefits:
Let me know what you think.
If you do not have any objections, I would continue the development on Friday and add the client as a public repository to the group.