microsoft / microsoft/TypeScript

Suggestion: ability to find imports for module

オープン
#22,374 コメント 8 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

Find references is a very useful feature, however sometimes I need to be able to find all imports of a given module:

  • regardless of what they're exporting
  • but the module does not have any exports

This is sometimes necessary when a module has side effects, and you want to see which files imported it.

This might also be useful for dynamic imports. In one project we have several dynamic imports (for code splitting) that never explicitly reference the module exports, so if I use find references on those module exports, I will not be shown the dynamic import. For example, here is a dynamic import:

image

When I activate find references on the exports of that module, I am not shown the import:

image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

issue にはソースファイルもテストも記載されていません。まず、副作用のあるモジュールと dynamic import で Find References を再現し、その後、参照を解決する language-service の動作を追跡してください。どの export も参照されていない場合でも imports を検出でき、dynamic imports も含まれることが完了条件です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
developer-experience, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。