Skip to content

Commit 87d399c

Browse files
authored
fix(core): use single ignore list for scanner (#6174)
1 parent 88a898d commit 87d399c

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

crates/biome_service/src/workspace/scanner.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use super::{FeaturesBuilder, IsPathIgnoredParams};
1313
use crate::diagnostics::Panic;
1414
use crate::projects::ProjectKey;
1515
use crate::workspace::DocumentFileSource;
16-
use crate::{Workspace, WorkspaceError};
16+
use crate::{IGNORE_ENTRIES, Workspace, WorkspaceError};
1717
use biome_diagnostics::serde::Diagnostic;
1818
use biome_diagnostics::{Diagnostic as _, Error, Severity};
1919
use biome_fs::{BiomePath, PathInterner, PathKind, TraversalContext, TraversalScope};
@@ -251,17 +251,6 @@ impl ScanContext<'_> {
251251
}
252252
}
253253

254-
/// Path entries that we want to ignore during the scanning phase.
255-
pub const SCANNER_IGNORE_ENTRIES: &[&[u8]] = &[
256-
b".cache",
257-
b".git",
258-
b".hg",
259-
b".svn",
260-
b".yarn",
261-
b".timestamp",
262-
b".DS_Store",
263-
];
264-
265254
impl TraversalContext for ScanContext<'_> {
266255
fn interner(&self) -> &PathInterner {
267256
&self.interner
@@ -281,7 +270,7 @@ impl TraversalContext for ScanContext<'_> {
281270
fn can_handle(&self, path: &BiomePath) -> bool {
282271
if path
283272
.file_name()
284-
.is_some_and(|file_name| SCANNER_IGNORE_ENTRIES.contains(&file_name.as_bytes()))
273+
.is_some_and(|file_name| IGNORE_ENTRIES.contains(&file_name.as_bytes()))
285274
{
286275
return false;
287276
}

0 commit comments

Comments
 (0)