lsp: Send DidOpen notifications when changing selections in multi buffer (#22958)

Fixes #22773

Release Notes:

- Fixed an edge case with multibuffers that could break language
features within them.
This commit is contained in:
Piotr Osiewicz 2025-02-07 12:33:35 +01:00 committed by GitHub
parent f700268029
commit b6b06cf6d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 34 deletions

View file

@ -1977,7 +1977,12 @@ impl LocalLspStore {
Some(local) => local.abs_path(cx),
None => return,
};
let file_url = lsp::Url::from_file_path(old_path).unwrap();
let file_url = lsp::Url::from_file_path(old_path.as_path()).unwrap_or_else(|_| {
panic!(
"`{}` is not parseable as an URI",
old_path.to_string_lossy()
)
});
self.unregister_buffer_from_language_servers(buffer, file_url, cx);
}