Conversation
a51f8c5 to
83b511b
Compare
vittorius
commented
Jan 13, 2026
| { | ||
| "label": "cargo nextest tests", | ||
| "command": "cargo nextest run tests", | ||
| "label": "cargo nextest tests (crate root)", |
Owner
Author
There was a problem hiding this comment.
Fixed, wasn't working properly
vittorius
commented
Jan 13, 2026
| // "NEXTEST_SUCCESS_OUTPUT": "immediate" | ||
| }, | ||
| }, | ||
| { |
Owner
Author
There was a problem hiding this comment.
Turned out to be redundant
vittorius
commented
Jan 13, 2026
| use crate::watching::WatchedSet; | ||
|
|
||
| #[derive(Debug)] | ||
| pub struct PathStore { |
83b511b to
fffc384
Compare
fffc384 to
a0c329a
Compare
a0c329a to
2f6fe1f
Compare
This was referenced Jan 16, 2026
Merged
Merged
bloodfeast
approved these changes
Jan 17, 2026
bloodfeast
left a comment
There was a problem hiding this comment.
just a couple notes, overall good job!
lsp/src/watching/path_store.rs
Outdated
| "event did not provide the path of the modified file" | ||
| ))?; | ||
|
|
||
| let body = fs::read_to_string(&path).with_context(|| "Could not read the modified file")?; |
There was a problem hiding this comment.
1.fs::read_to_string is synchronous and will block the async runtime's thread.
- You could use
tokio::fs::read_to_stringand make the function async
async fn process_and_sync(client: &dyn Client, event: &Event) -> Result<()> {
let path = event.paths.first()
.ok_or_else(|| anyhow!("event missing path"))?;
let body = tokio::fs::read_to_string(path).await
.with_context(|| format!("failed to read {}", path.display()))?;
let data = LocalFileData::new(path.clone(), body)?;
client.sync_file(data).await
}- adding the path here would be useful context
.with_context(|| format!("Could not read modified file: {}", path.display()))?;|
|
||
| impl PathStore { | ||
| pub fn new(client: Arc<dyn Client>) -> Result<Self> { | ||
| let event_handler = Box::new(move |event| { |
There was a problem hiding this comment.
You could filter here before the async overhead
let EventKind::Modify(ModifyKind::Data(_)) = event.kind else {
return Box::pin(async {}) as Pin<Box<dyn Future<Output = ()> + Send>>;
};
Owner
Author
There was a problem hiding this comment.
Decided to keep this logic in the process_event function
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.
PR train: