Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/brave-tires-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@biomejs/biome": patch
---

Fixed a bug where the Biome Language Server would enable its project file watcher even when no project rules were enabled.

Now the watching of nested configuration files and nested ignore files is delegated to the editor, if their LSP spec supports it.
27 changes: 26 additions & 1 deletion crates/biome_lsp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ impl LSPServer {
}),
kind: Some(WatchKind::all()),
},
FileSystemWatcher {
glob_pattern: GlobPattern::Relative(RelativePattern {
pattern: "**/.gitignore".to_string(),
base_uri: OneOf::Left(folder.clone()),
}),
kind: Some(WatchKind::all()),
},
FileSystemWatcher {
glob_pattern: GlobPattern::Relative(RelativePattern {
pattern: "**/.ignore".to_string(),
base_uri: OneOf::Left(folder.clone()),
}),
kind: Some(WatchKind::all()),
},
]
})
.collect();
Expand All @@ -176,6 +190,15 @@ impl LSPServer {
)),
kind: Some(WatchKind::all()),
},
FileSystemWatcher {
glob_pattern: GlobPattern::String("**/.gitignore".to_string()),
kind: Some(WatchKind::all()),
},
FileSystemWatcher {
glob_pattern: GlobPattern::String("**/.ignore".to_string()),

kind: Some(WatchKind::all()),
},
],
};
CapabilityStatus::Enable(Some(json!(value)))
Expand Down Expand Up @@ -354,7 +377,9 @@ impl LanguageServer for LSPServer {
&& (ConfigName::file_names()
.iter()
.any(|file_name| watched_file.ends_with(file_name))
|| watched_file.ends_with(".editorconfig"))
|| (watched_file.ends_with(".editorconfig"))
|| watched_file.ends_with(".gitignore")
|| watched_file.ends_with(".ignore"))
{
self.session.load_extension_settings().await;
self.session.load_workspace_settings(true).await;
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_lsp/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ impl Session {
spawn_blocking(move || {
let result = session.workspace.scan_project(ScanProjectParams {
project_key,
watch: true,
watch: scan_kind.is_project(),
force,
scan_kind,
verbose: false,
Expand Down