microsoft / microsoft/TypeScript

External interfaces included in IDE symbol space

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

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

Domain: API Help Wanted Suggestion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

Overview

Interfaces defined in .d.ts files (even if they are not part of the Visual Studio project) are nonetheless included in the IDE symbol space; i.e. they appear in the Navigate To search results.

Repro

Add the NuGet package underscore.TypeScript.DefinitelyTyped to a project. Ensure that underscore.d.ts is not included in the project; however, do put a reference to it in a TypeScript file in the project, e.g.

/// <reference path="../Scripts/typings/underscore/underscore.d.ts"/>

In Visual Studio, press Ctrl + , and type reduce. Notice you get lots of listings for methods defined in the underscore interface.

Commentary

The repro steps are analogous to adding a reference to System.Web.Mvc, hitting Ctrl + ,, typing file, and seeing the File methods for System.Web.Mvc.Controller, plus who knows what else. Of course, for assembly references this doesn't happen; it would be noise, polluting the IDE symbol space with stuff you rarely want to try to navigate to. Libraries have lots of symbols, often more than our own apps. Those symbols get in the way of navigating quickly within our own app. That's why there's a switch to turn off external items. The same situation applies to JavaScript libraries with TypeScript annotations - not at the same scale as the .NET Framework, but still at enough scale to be a problem.

The bug is that for TypeScript, interfaces and their members in .d.ts files always show up. Ideally, they shouldn't show up regardless of whether the .d.ts file is referenced with an XML directive or by including the file in the project.

The main use case where it would be helpful to include the identifiers in the IDE symbol space is when developers are actually writing .d.ts files. To serve that need, it would be reasonable to include the symbols if the "Search within external items" option is enabled.

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

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

はじめの一歩

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

調査の方向性

XML ディレクティブから参照される underscore.d.ts で問題を再現し、その後、Navigate To が外部 .d.ts ファイルのインターフェイスとメンバーをどのようにインデックス化するかを調査してください。この修正では、デフォルトでこれらの識別子を IDE のシンボル空間の外に置きつつ、“Search within external items” が有効な場合はそれらを許可する必要があります。

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

評価

技術スタック
typescript
領域
developer-experience, search
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

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

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