microsoft / microsoft/TypeScript

Find all references for ambient module

Open
#9,077 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: API Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

// declarations.d.ts
declare module "x" {
    export const x: number;
}

// index.ts
import {x} from "x";

Goto-declaration for "x" in index.ts works, but find-all-references for "x" in declarations.d.ts finds only itself.

In this case one can simply look through each of export in the module's body and find all of their references; but for shorthand ambient modules (declare module "x";) that won't work, as there is no module body.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior using the declarations.d.ts and index.ts snippets, then trace the find-all-references path for the ambient module and its exported symbol. Done means references from index.ts are included when searching from declarations.d.ts, with shorthand ambient modules also handled; add or update coverage for both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.