Skip to content

Match ignore rules case-insensitively on case-insensitive filesystems #1832

Description

@Widthdom

Summary

SkipDirs / SkipFiles / ignore-rule lookups in FileIndexer.cs:1416, 1509 perform exact-case basename matching even on case-insensitive filesystems (macOS HFS+/APFS default, Windows NTFS, ExFAT). A user who adds node_modules to the skip list but whose project happens to contain Node_Modules/ (different casing on the same volume) gets the directory walked. The class already tracks an _ignoreCase hint elsewhere, but it is not consulted at the skip lookup. Symmetrically, on case-sensitive filesystems containing two directories Foo/ and foo/, an ignore rule for foo matches only one — surprising for users moving cross-platform.

Where

  • src/CodeIndex/Indexer/Scanning/FileIndexer.cs:1416 (skip-dir lookup)
  • src/CodeIndex/Indexer/Scanning/FileIndexer.cs:1509 (skip-file lookup)

Suggested approach

(1) Detect filesystem case-sensitivity once per workspace root (probe by creating two files differing only in case in a tmp dir under the workspace, or by reading the O_PATH/macOS pathconf(_PC_CASE_SENSITIVE)). (2) Cache the result on the scanner and use case-insensitive matching for skip lists when the workspace FS is case-insensitive. (3) Document the policy: "Ignore rules match case-insensitively on case-insensitive filesystems". (4) Add a --ignore-case-sensitivity=auto|strict|loose override for users who want explicit control. (5) Add regression tests on macOS/Linux runners that create both casings and assert the ignore rule fires correctly. (6) Cross-link with #1633 (IgnoreRules) — same family.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions