Skip to content

fix(vfs): leave files in a directory named c: out of the include walk - #1082

Merged
camc314 merged 1 commit into
oxc-project:mainfrom
magurotuna:fix/vfsmatch-drive-like-directory
Nov 24, 2026
Merged

camc314 merged 1 commit into
oxc-project:mainfrom
magurotuna:fix/vfsmatch-drive-like-directory

Conversation

@magurotuna

Copy link
Copy Markdown
Member

A file below a directory named c: was added to the program. tsgo leaves it out:

// tsconfig.json: {}   (default include)
// b.ts:    export const y = 1;
// c:/a.ts: export const x: number = "s";
tsgo: no error
tsrs: c:/a.ts(1,14): error TS2322: Type 'string' is not assignable to type 'number'.

Go's include walk builds each child directory with ResolveDirectory, which reads a name that has a root (c:) as that root, not as a child. tsrs appended the name as text. This PR uses tspath::resolve_file there. The read-ahead of the walk (tsrs only) now skips a name with a root or a \, as it skips symlinks. Before, it looped on a directory named a\...

Tests: include_drive_like_directory in tsrs_cli (Unix only, because Windows cannot have a directory named c:).

AI assistance: written with Claude Code.

A file below a directory named `c:` was added to the program. tsgo leaves
it out:

```
// tsconfig.json: {}   (default include)
// b.ts:    export const y = 1;
// c:/a.ts: export const x: number = "s";
tsgo: no error
tsrs: c:/a.ts(1,14): error TS2322: Type 'string' is not assignable to type 'number'.
```

Go's include walk (`vfs/vfsmatch/vfsmatch.go:630`) builds each child
directory with `ResolveDirectory`, which reads a name that has a root
(`c:`) as that root, not as a child. tsrs appended the name as text. Use
`tspath::resolve_file` there. The read-ahead of the walk (tsrs only) now
skips a name with a root or a `\`, as it skips symlinks. Before, it looped
on a directory named `a\..`.

Tests: `include_drive_like_directory` in `tsrs_cli` (Unix only, because
Windows cannot have a directory named `c:`).

AI assistance: written with Claude Code.
@camc314
camc314 added this pull request to the merge queue Nov 24, 2026
Merged via the queue into oxc-project:main with commit 872ae94 Nov 24, 2026
69 checks passed
@codspeed

codspeed Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing magurotuna:fix/vfsmatch-drive-like-directory (8a4db5e) with main (7a04074)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants