Skip to content

Commit 594ec50

Browse files
ematipicosiketyan
andauthored
fix(lsp): remove rename capability (#6422)
Co-authored-by: siketyan <[email protected]>
1 parent dd88565 commit 594ec50

File tree

5 files changed

+5
-113
lines changed

5 files changed

+5
-113
lines changed

.changeset/wild-chefs-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Removed the experimental rename feature from Biome LSP, which caused some issues inside existing editors such as Zed.

crates/biome_lsp/src/extension_settings.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@ impl ExtensionSettings {
5959
Ok(())
6060
}
6161

62-
pub(crate) fn rename_enabled(&self) -> bool {
63-
let new_setting = self
64-
.settings
65-
.experimental
66-
.as_ref()
67-
.is_some_and(|experimental| experimental.rename.unwrap_or(false));
68-
69-
let old_setting = self.settings.rename.unwrap_or(false);
70-
71-
new_setting | old_setting
72-
}
73-
7462
pub(crate) fn requires_configuration(&self) -> bool {
7563
self.settings.require_configuration.unwrap_or_default()
7664
}

crates/biome_lsp/src/handlers.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
pub(crate) mod analysis;
22
pub(crate) mod formatting;
3-
pub(crate) mod rename;
43
pub(crate) mod text_document;

crates/biome_lsp/src/handlers/rename.rs

Lines changed: 0 additions & 66 deletions
This file was deleted.

crates/biome_lsp/src/server.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,6 @@ impl LSPServer {
222222
},
223223
);
224224

225-
let rename = {
226-
let config = self.session.extension_settings.read().ok();
227-
config.is_some_and(|x| x.rename_enabled())
228-
};
229-
230-
capabilities.add_capability(
231-
"biome_rename",
232-
"textDocument/rename",
233-
if rename {
234-
CapabilityStatus::Enable(None)
235-
} else {
236-
CapabilityStatus::Disable
237-
},
238-
);
239-
240225
self.session.register_capabilities(capabilities).await;
241226
}
242227

@@ -483,25 +468,6 @@ impl LanguageServer for LSPServer {
483468

484469
self.map_op_error(result).await
485470
}
486-
487-
async fn rename(&self, params: RenameParams) -> LspResult<Option<WorkspaceEdit>> {
488-
biome_diagnostics::panic::catch_unwind(move || {
489-
let rename_enabled = self
490-
.session
491-
.extension_settings
492-
.read()
493-
.ok()
494-
.and_then(|config| config.settings.rename)
495-
.unwrap_or(false);
496-
497-
if rename_enabled {
498-
handlers::rename::rename(&self.session, params).map_err(into_lsp_error)
499-
} else {
500-
Ok(None)
501-
}
502-
})
503-
.map_err(into_lsp_error)?
504-
}
505471
}
506472

507473
impl Drop for LSPServer {

0 commit comments

Comments
 (0)