microsoft / microsoft/TypeScript

Give 'this' keyword suggestion the same `sortText` as class properties if inside a class

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

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

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

説明

From https://github.com/Microsoft/vscode/issues/66868

TypeScript Version: 3.4.0-dev.20190220

Search Terms:

  • suggestions
  • completions
  • sortText

Code
For the javascript:

class Foo {
    constructor() {
        this.prop = 1;
    }

    render() {
        th
    }
}
  • Trigger intellisense after th in render

Expected behavior:
this should be the first suggestion in VS Code

Actual behavior:
render and then prop are the first suggestions

The root cause of this is that the suggestion for this has a sortText of "0" while the one for prop and render have a sortText of "1". This causes VS Code to sort prop and render before this

@amcasey @minestarks I'm not sure if the current sorting issue would also effect VS

Playground Link:

Related Issues:

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

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

はじめの一歩

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

調査の方向性

クラスの例を使って TypeScript language service の補完順序を再現し、thisproprender の補完エントリを調べます。関連する補完動作を更新し、this がクラスプロパティと同じ sortText を使用するようにしてから、例を対象とするリグレッションテストを追加または更新し、結果の順序を確認します。

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

評価

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

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

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