mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-06 10:20:36 +00:00
fix: Clone URI to avoid borrow-after-move in handle_did_open
This commit is contained in:
parent
e81afaee5e
commit
8395a02832
1 changed files with 3 additions and 2 deletions
|
@ -24,15 +24,16 @@ impl Store {
|
|||
}
|
||||
|
||||
pub fn handle_did_open(&mut self, params: DidOpenTextDocumentParams, client: &Client) -> Result<()> {
|
||||
let uri = params.text_document.uri.clone(); // Clone the URI here
|
||||
let document = TextDocument::new(
|
||||
String::from(params.text_document.uri),
|
||||
uri.to_string(), // Use the cloned URI
|
||||
params.text_document.text,
|
||||
params.text_document.version,
|
||||
params.text_document.language_id,
|
||||
);
|
||||
|
||||
self.add_document(document);
|
||||
self.publish_diagnostics(params.text_document.uri.as_str(), client);
|
||||
self.publish_diagnostics(uri.as_str(), client); // Use the cloned URI
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue