Skip to content

Commit e430555

Browse files
authored
fix: recognize format_range and format_on_type as Format capabilities… (#8213)
1 parent 68c052e commit e430555

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
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+
Fixed #8209: Recognized formatting capability when either range or on-type formatting is supported, not only full-file formatting. This ensures editors and the language server correctly detect formatting support in files like JSONC.

crates/biome_service/src/workspace.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ impl FeaturesSupported {
147147
/// Adds the features that are enabled in `capabilities` to this result.
148148
#[inline]
149149
pub fn with_capabilities(mut self, capabilities: &Capabilities) -> Self {
150-
if capabilities.formatter.format.is_some() {
150+
if capabilities.formatter.format.is_some()
151+
|| capabilities.formatter.format_range.is_some()
152+
|| capabilities.formatter.format_on_type.is_some()
153+
{
151154
self.insert(FeatureKind::Format, SupportKind::Supported);
152155
}
153156
if capabilities.analyzer.lint.is_some() {

0 commit comments

Comments
 (0)