-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DiagnosticServer: Adding a workspace folder with the VS code client leads to server shutdown #2
Comments
Hot damn, this was a difficult one! 🤯 As it turns out, it was not an error on the server side, but on the side of the client instead - although the solution does affect the server side. Long story short, I misunderstood the life cycle of a VS Code extension to be something like this: activate() // by user-issued command
...
doStuff()
doSomeOtherStuff()
...
deactivate() // by user-issued command However, it is actually more like this: activate() // by user-issued command
...
doStuff()
...
deactivate() // re-load of extension due to fundamental configuration changes
activate()
...
doSomeOtherStuff()
...
deactivate() // by user-issued command Changing from a clean workspace without any open folders to a single-folder workspace apparently required a reload of the extension (as does changing from single-folder to multi-folder setup). This means that I need to
Currently I lean towards option 2. This is totally ugly from the point of view of the extension user, but I think it allows us maximum flexibility for testing the server. For a finished product, I would opt for option 4, as I think that this is the way it is done by most other projects and it keeps both the client and server code as simple and straightforward as possible. The only downside is that the current state of the OMC (loaded models, Modelica path, command line options) will be lost, so the user should at least be informed/warned that a reload occurred. |
Side note: If you should debug the client in the future, note that debugging does not work during a reload of the extension, even if you interrupt the |
Steps to reproduce:
DiagnosticServer
Mo|E: connect
to connect to serverExpected behavior:
Server should stay alive after a single
workspace/didChangeWorkspaceFolders
has been received.Actual behavior:
Client requests server to shut down. Also two
workspace/didChangeWorkspaceFolders
events are sent, the second being empty.Ideas:
This might have something to do with missing entries in the
ServerCapabilities
, but this is hard to pinpoint since no exception is thrown.The text was updated successfully, but these errors were encountered: