mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-12 13:26:51 +00:00
refactor: make document change handling async with proper awaits
This commit is contained in:
parent
7f10d611c3
commit
da388d7efc
2 changed files with 3 additions and 2 deletions
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue