lsp: Fix workspace folders being cleared when new set is the same as the old one (#27242)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-21 14:47:06 +01:00 committed by GitHub
parent a709d4c7c6
commit 579868110b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1275,9 +1275,9 @@ impl LanguageServer {
name: String::default(),
})
.collect();
*workspace_folders = folders;
let should_notify = !added.is_empty() || !removed.is_empty();
if should_notify {
*workspace_folders = folders;
drop(workspace_folders);
let params = DidChangeWorkspaceFoldersParams {
event: WorkspaceFoldersChangeEvent { added, removed },