Open
Description
π Search Terms
references dynamic import
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about references
β― Playground Link
π» Code
// @filename: definition.ts
function X() {}
type X = true;
export default X; // do "find references" here
// @filename: usage.ts
import X from './definition';
X; // this reference is found
async function asd() {
const a = await import('./definition');
a.default; // this one is not
await import('./definition').then((m) => m.default /* this one is not */);
}
π Actual behavior
This needs the files to be copied into your IDE to reproduce. In VS Code, do "find references" on export default X
. You'll see that the references of the indirect export (e.g. function x()...; export default x
instead of export default function x()...
) are not recognized for dynamic imports (for static imports they are).
π Expected behavior
Recognize references for dynamic imports, too
Additional information about the issue
The playground needs to be copied into real files locally, as the playground isn't multifile-capable (from what I know), but it's needed for this reproduction.
Doing indirect exports is sometimes necessary in order to do declaration merging.