Microsoft/TypeScript

Find all references for ambient module

Open

#9,077 创建于 2016年6月10日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)TypeScript (48,455 star) (6,726 fork)batch import
Domain: APIHelp WantedSuggestion

描述

// 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.

贡献者指南