mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 21:47:07 +04:00
Simplify textDocument/didClose, we don't need to look up LSP again
This commit is contained in:
parent
8744f367bd
commit
c00cf238af
@ -287,14 +287,9 @@ pub fn close(&mut self, id: ViewId, close_buffer: bool) {
|
|||||||
|
|
||||||
if close_buffer {
|
if close_buffer {
|
||||||
// get around borrowck issues
|
// get around borrowck issues
|
||||||
let language_servers = &mut self.language_servers;
|
|
||||||
let doc = &self.documents[view.doc];
|
let doc = &self.documents[view.doc];
|
||||||
|
|
||||||
let language_server = doc
|
if let Some(language_server) = doc.language_server() {
|
||||||
.language
|
|
||||||
.as_ref()
|
|
||||||
.and_then(|language| language_servers.get(language).ok());
|
|
||||||
if let Some(language_server) = language_server {
|
|
||||||
tokio::spawn(language_server.text_document_did_close(doc.identifier()));
|
tokio::spawn(language_server.text_document_did_close(doc.identifier()));
|
||||||
}
|
}
|
||||||
self.documents.remove(view.doc);
|
self.documents.remove(view.doc);
|
||||||
|
Loading…
Reference in New Issue
Block a user