microsoft / microsoft/TypeScript

Extra entries for JavaScript auto complete(intellisense) make no sense

オープン
#15,679 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

説明

TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)

Code
The following code in javascript:

/**
* @param {MessageActivity} activity
* @param {IConversationContext} context
*/
export function Prompt_beforeResponse(activity, context)
{
  // MessageActivity is defined in typescript definition provided to the editor as having 4 properties (attachements, text, speak, type). 
 // Typing activity. will show those for properties but also: 
 //     activity  - why should activity be under itself?
 //     context - why should the second parameter be under activity?
 //     IConversationContext - why would a type, that is not a property in any object be under activity?
 //     MessageActivity - same question as above
 //     onRun - why should a global function be under activity
 //     Prompt_when - same as above
 //     Prompt_beforeResponse - same question as above and this is the function itself


//  Here is another example. obj. should display only a and b, but it also shows activity, context, MessageActivity, IConversationContext, etc.
   /**
    * @type {{a: number, b: string }}
   */
   var obj = {};
   obj.
}
// A *self-contained* demonstration of the problem follows...

Expected behavior:
When a javascript type is not "any", i.e. when it is definded in jsdoc or in the typescript definition helper (See https://github.com/Microsoft/TypeScript/wiki/JavaScript-Language-Service-in-Visual-Studio#unsupported-patterns) only those defined members should be part of intellisense.
Even if the type is any, throwing everything on intellisense like that defeats the purpose of finding out what reasonably could be under the object.

Actual behavior:
A bunch of extra entries show up in intellisnese that make no sense for either typed or untyped scenarios, but it is specially bad for typed scenarios where some thought was put in place in what should appear in intellisense. Adding all those entries makes the intellisense feature less useful.

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

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

はじめの一歩

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

調査の方向性

JavaScript language service と issue 内の JSDoc-typed の例から始め、activity. と obj. の補完結果を再現します。候補を宣言されたメンバーおよびレポートに記載された期待される動作と比較します。型付き JavaScript 値の補完として、関係のない globals、パラメーター、型、関数が表示されなくなれば完了です。

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

評価

技術スタック
javascript, typescript
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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