Draft
Conversation
ogoffart
reviewed
Mar 19, 2026
| [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
| clap = { workspace = true } | ||
| crossbeam-channel = "0.5" # must match the version used by lsp-server | ||
| crossbeam-channel = "0.5" # must match the version used by lsp-server |
Member
There was a problem hiding this comment.
Do we still need this dependency?
|
|
||
| let preview_to_lsp_channel = self.preview_to_lsp_channel.clone(); | ||
|
|
||
| let communication_handle = std::thread::spawn(move || -> Result<(), String> { |
Member
There was a problem hiding this comment.
Maybe we no longer need a thread for this? (but we don't need to change this in this PR)
| let connection = Arc::new(connection); | ||
| let (from_lsp_sender, mut from_lsp_receiver) = tokio::sync::mpsc::unbounded_channel(); | ||
| let inner_connection = connection.clone(); | ||
| std::thread::spawn(move || { |
Member
There was a problem hiding this comment.
I'm a bit curious about the live time of this thread.
Should we not try to join it on exit?
| match msg? { | ||
| tokio::select! { | ||
| msg = from_lsp_receiver.recv() => { | ||
| match msg.ok_or_else(|| "LSP connection closed".to_owned())? { |
Member
There was a problem hiding this comment.
Is that always an error or can it be part of the normal shutdown as well?
I just want to be sure that we don't send spurious error message to the user when we exit normally.
| recv(recompile_timeout) -> _ => { | ||
| { | ||
| let ctx = ctx.clone(); | ||
| let msg = _msg.ok_or_else(|| "Preview to LSP connection closed".to_owned())?; |
Member
There was a problem hiding this comment.
Same comment: I hope we don't treat normally closing the preview as an error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not yet tested.