lsp: Check for existing snapshots before sending off a didOpen notification (#25409)
Closes #ISSUE Release Notes: - Fixed Zed sending out didOpen notification to a language server when opening documents.
This commit is contained in:
parent
4067ae4b37
commit
918cba4cce
1 changed files with 10 additions and 7 deletions
|
@ -1921,11 +1921,13 @@ impl LocalLspStore {
|
|||
version: 0,
|
||||
snapshot: initial_snapshot.clone(),
|
||||
};
|
||||
self.buffer_snapshots
|
||||
let previous_snapshots = self
|
||||
.buffer_snapshots
|
||||
.entry(buffer_id)
|
||||
.or_default()
|
||||
.insert(server.server_id(), vec![snapshot]);
|
||||
|
||||
if previous_snapshots.is_none() {
|
||||
server.register_buffer(
|
||||
uri.clone(),
|
||||
adapter.language_id(&language.name()),
|
||||
|
@ -1935,6 +1937,7 @@ impl LocalLspStore {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn unregister_old_buffer_from_language_servers(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue