-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
TS Template added by @mjbvz
TypeScript Version: 4.2.2.
Search Terms
- references
- tsconfig
- VS Code Version: 1.53.2
- OS Version: Darwin x64 18.7.0
In a multi-module/project workspace that's using Typescript Project References, if a shared TS project exports an object like:
export const foo = {
bar: () => {}
};
And two TS projects are consuming it, if you open the workspace in VSCode, the Find All References command invoked on .bar()
will only show 2/3 references. Interestingly, if you invoke the command on foo
, 3/3 references will be found. And if you were to have all 3 files open, the issue does not reproduce (which makes this issue suspiciously similar to microsoft/vscode#80087).
In the workspace, all 3 projects have "composite": true
set and there's a root tsconfig.json
referencing all 3, per official docs (without the root tsconfig.json
, Find All References won't work for foo
either).
Steps to Reproduce:
- Clone https://github.com/WestonThayer/bug-vscode-find-refs (minimal repro)
- Open in VSCode
- Open
/api/src/server.ts
- Right click
.bar()
and try the Find All References command
ACTUAL: only api/src/server.ts
and shared/src/index.ts
are found as references
EXPECTED: all references are found, just like they would be if you right clicked foo
Does this issue occur when all extensions are disabled?: Yes
Notes
Only applies to when the key of a shared, exported object is a function. For example if the shared code had export const foo = () => {};
, Find All References would work fine.