TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Reference missing with declare module

Open MJE-GTI opened this issue 7 months ago • 1 comments

🔎 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 https://github.com/microsoft/TypeScript/issues/61741

MJE-GTI avatar May 26 '25 08:05 MJE-GTI

Hi is this is open ? i would like to work on this

maddie0501 avatar Jun 07 '25 06:06 maddie0501

Closing language service bugs related to the 6.0 implementation. For more information, see #62827

RyanCavanaugh avatar Dec 03 '25 00:12 RyanCavanaugh