Skip to content

Reference missing with declare moduleΒ #61766

Open
@MJE-GTI

Description

@MJE-GTI

πŸ”Ž Search Terms

missing reference

πŸ•— Version & Regression Information

  • Typescript 5.8.3 with VisualStudio Code 1.100.2
  • Typescript 5.0.2 with MonacoEditor 0.39.0

⏯ Playground Link

No response

πŸ’» Code

bugReportApi.d.ts

declare module '@bug/api/index' {

  export * from "@bug/api/miscFunctions";

}
declare module '@bug/api/miscFunctions' {

  export function myFunction(testParam: string): Promise<void>;
  

}

declare namespace bug.v0 {const api: typeof import('@bug/api/index')}

test.ts

bug.v0.api.myFunction('test')

πŸ™ Actual behavior

When I search for references to "myFunction", I only find the declaration in 'bugReportApi.d.ts', but not its usage in 'test.ts'.
However, if I copy the contents of 'bugReportApi.d.ts' into a new file named 'bugReportApiC.d.ts' and search for references again, I find two declarations ('bugReportApi.d.ts' and 'bugReportApiC.d.ts') as well as the usage in 'test.ts'.

πŸ™‚ Expected behavior

The usage in 'test.ts' is found as reference.

Additional information about the issue

Maybe it's the same issue as #61741

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions