refactor: make document change handling async with proper awaits

This commit is contained in:
Josh Thomas 2025-01-07 12:04:34 -06:00
parent 7f10d611c3
commit da388d7efc
2 changed files with 3 additions and 2 deletions

View file

@ -55,7 +55,7 @@ impl Store {
Ok(()) Ok(())
} }
pub fn handle_did_change( pub async fn handle_did_change(
&mut self, &mut self,
params: DidChangeTextDocumentParams, params: DidChangeTextDocumentParams,
client: &Client, client: &Client,
@ -78,7 +78,7 @@ impl Store {
document.version = version; document.version = version;
self.versions.insert(uri.clone(), version); self.versions.insert(uri.clone(), version);
self.publish_diagnostics(&uri, client); self.publish_diagnostics(&uri, client).await?;
Ok(()) Ok(())
} }

View file

@ -129,6 +129,7 @@ impl LanguageServer for DjangoLanguageServer {
.write() .write()
.await .await
.handle_did_change(params.clone(), &self.client) .handle_did_change(params.clone(), &self.client)
.await
{ {
eprintln!("Error handling document change: {}", e); eprintln!("Error handling document change: {}", e);
return; return;