Simplify textDocument/didClose, we don't need to look up LSP again

This commit is contained in:
Blaž Hrastnik 2021-09-01 14:38:47 +09:00
parent 8744f367bd
commit c00cf238af

View file

@ -287,14 +287,9 @@ impl Editor {
if close_buffer {
// get around borrowck issues
let language_servers = &mut self.language_servers;
let doc = &self.documents[view.doc];
let language_server = doc
.language
.as_ref()
.and_then(|language| language_servers.get(language).ok());
if let Some(language_server) = language_server {
if let Some(language_server) = doc.language_server() {
tokio::spawn(language_server.text_document_did_close(doc.identifier()));
}
self.documents.remove(view.doc);