project: Register dynamic capabilities even when registerOptions doesn't exist (#36554)

Closes #36482

Looks like we accidentally referenced
[common/formatting.ts#L67-L70](https://github.com/microsoft/vscode-languageserver-node/blob/d90a87f9557a0df9142cfb33e251cfa6fe27d970/client/src/common/formatting.ts#L67-L70)
instead of
[common/client.ts#L2133](https://github.com/microsoft/vscode-languageserver-node/blob/d90a87f9557a0df9142cfb33e251cfa6fe27d970/client/src/common/client.ts#L2133).

Release Notes:

- Fixed code not formatting on save in language servers like Biome.
(Preview Only)
This commit is contained in:
Smit Barmase
2025-08-20 12:20:09 +05:30
committed by GitHub
parent 5d2bb2466e
commit 4c85a0dc71
+6 -7
View File
@@ -12032,16 +12032,15 @@ impl LspStore {
} }
} }
// Registration with empty capabilities should be ignored. // Registration with registerOptions as null, should fallback to true.
// https://github.com/microsoft/vscode-languageserver-node/blob/d90a87f9557a0df9142cfb33e251cfa6fe27d970/client/src/common/formatting.ts#L67-L70 // https://github.com/microsoft/vscode-languageserver-node/blob/d90a87f9557a0df9142cfb33e251cfa6fe27d970/client/src/common/client.ts#L2133
fn parse_register_capabilities<T: serde::de::DeserializeOwned>( fn parse_register_capabilities<T: serde::de::DeserializeOwned>(
reg: lsp::Registration, reg: lsp::Registration,
) -> anyhow::Result<Option<OneOf<bool, T>>> { ) -> anyhow::Result<Option<OneOf<bool, T>>> {
Ok(reg Ok(match reg.register_options {
.register_options Some(options) => Some(OneOf::Right(serde_json::from_value::<T>(options)?)),
.map(|options| serde_json::from_value::<T>(options)) None => Some(OneOf::Left(true)),
.transpose()? })
.map(OneOf::Right))
} }
fn subscribe_to_binary_statuses( fn subscribe_to_binary_statuses(