Repository navigation
fix(vfs): leave files in a directory named c: out of the include walk - #1082
Merged
camc314 merged 1 commit intoNov 24, 2026
Merged
Conversation
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
approved these changes
Nov 24, 2026
Contributor
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A file below a directory named
c:was added to the program. tsgo leaves it out: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 usestspath::resolve_filethere. 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 nameda\...Tests:
include_drive_like_directoryintsrs_cli(Unix only, because Windows cannot have a directory namedc:).AI assistance: written with Claude Code.