Skip to content
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

Send LSP server init notification to frontend #71

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

lionel-
Copy link
Contributor

@lionel- lionel- commented Jul 28, 2023

  • Move responsibility of sending LSP start notification from LspComm to Shell::open_comm().

  • The start notification message is now of type server_started instead of lsp_started. This more general message type will be shared for all comms wrapping a server (e.g. DAP).

  • The server notifies open_comm() that it is ready to accept connections via a channel. The notification is then forwarded to the frontend through the comm. Before this change we were potentially sending the notification message too soon.

@lionel- lionel- force-pushed the feature/lsp-init-notif branch from b6e92a2 to 4dab7ef Compare August 3, 2023 13:40
@lionel- lionel- force-pushed the feature/lsp-init-notif branch from 4dab7ef to 360f002 Compare August 22, 2023 07:03
@lionel- lionel- merged commit 15d45fa into main Aug 22, 2023
@lionel- lionel- deleted the feature/lsp-init-notif branch August 22, 2023 07:18
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
Merge pull request #189 from posit-dev/feature/wait-lsp

 Sync LSP with positron-r
--------------------
Commit message for posit-dev/positron-python@bdb0b65:

Sync LSP with positron-r

This makes the necessary changes to the Python LSP to keep it in sync
with the following PRs for positron-r:

- posit-dev/ark#71
- #934
- #1144

It improves the interaction between Positron and the LSP. Instead of
Positron repeatedly trying to reconnect to the LSP server until it's
ready, now Positron waits for the server to notify it with a
`server_started` message over the LSP comm.

I also made minor changes to `lsp.py` to add more logging and
mark methods/attributes as private.

I tested repeatedly restarting with `Cmd+Shift+0` ~20 times on Python
3.8 and 3.12 as well as refreshing with `Cmd+R` and all worked well.


Authored-by: Wasim Lorgat <[email protected]>
Signed-off-by: Wasim Lorgat <[email protected]>
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
Merge pull request #189 from posit-dev/feature/wait-lsp

 Sync LSP with positron-r
--------------------
Commit message for posit-dev/positron-python@bdb0b65:

Sync LSP with positron-r

This makes the necessary changes to the Python LSP to keep it in sync
with the following PRs for positron-r:

- posit-dev/ark#71
- #934
- #1144

It improves the interaction between Positron and the LSP. Instead of
Positron repeatedly trying to reconnect to the LSP server until it's
ready, now Positron waits for the server to notify it with a
`server_started` message over the LSP comm.

I also made minor changes to `lsp.py` to add more logging and
mark methods/attributes as private.

I tested repeatedly restarting with `Cmd+Shift+0` ~20 times on Python
3.8 and 3.12 as well as refreshing with `Cmd+R` and all worked well.


Authored-by: Wasim Lorgat <[email protected]>
Signed-off-by: Wasim Lorgat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants