Preview source matching still relies on string-prefix and substring checks, which can resolve the wrong file when repos share path prefixes or when separators differ across platforms.
Problem
src/reactFiberAdapter.ts uses substring-style matching for source file comparisons
src/hoverProvider.ts uses fsPath.startsWith(workspaceRoot) when filtering definition results
- sibling repos such as
/repo and /repo-other can be treated as the same workspace prefix
node_modules filtering only checks /node_modules/, which misses Windows-style paths
Suggested fix
- Replace
startsWith and substring checks with normalized, segment-aware path comparisons based on path.relative
- Normalize separators before applying
node_modules filtering
- Add tests for
/repo vs /repo-other, Windows-style paths, and same-basename files in different folders
Relevant files
src/reactFiberAdapter.ts
src/hoverProvider.ts
src/pathUtils.ts
Preview source matching still relies on string-prefix and substring checks, which can resolve the wrong file when repos share path prefixes or when separators differ across platforms.
Problem
src/reactFiberAdapter.tsuses substring-style matching for source file comparisonssrc/hoverProvider.tsusesfsPath.startsWith(workspaceRoot)when filtering definition results/repoand/repo-othercan be treated as the same workspace prefixnode_modulesfiltering only checks/node_modules/, which misses Windows-style pathsSuggested fix
startsWithand substring checks with normalized, segment-aware path comparisons based onpath.relativenode_modulesfiltering/repovs/repo-other, Windows-style paths, and same-basename files in different foldersRelevant files
src/reactFiberAdapter.tssrc/hoverProvider.tssrc/pathUtils.ts