microsoft / microsoft/TypeScript

AllowUnresolveNames not working for completion getters/setters and property signature and declaration

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

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

Domain: LS: Refactorings Experience Enhancement Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔎 Search Terms

AllowUnresolveNames, "preserve type nodes"

🕗 Version & Regression Information
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about AllowUnresolvedNames and preserve types
⏯ Playground Link

https://www.typescriptlang.org/play/?target=99#code/JYOwLgpgTgZghgYwgAgILIN4Chm+TAewIC5lgBbABwKjAAoAiAOgHoATAiAZ3AgA9gXMEwBWXBgEomAMSIBuHHgDmEMMgBGcKHQmkK1Wo1YduvAUNHipsggoC+WRwgA2cLl2QAhMlWcRyEOAe6NgsLMgAKlDASipQyAgEvqrABCCkDPp+AeBkvLCIKKgMyGyClK4AnshgABaCCUkVKWnEWGFoCGAArnDObR2EJMhwIJUKHSpqmtq6I2OY7eF4NbVQBADuyCAQWwCiUOvaDACyqrUEbNsEaln+gZBsTJIT4XbIjh17fJQQXRBsAbhIZ6Kg0ejMdicHiQczCMSSGTyJbIKYaLQ6UEGCHGaFmQTwqxIgiLDorOrrLY7faHGiMM51S7XW7JHKPZ4SV7Id5YOxAA

💻 Code
interface A {
    foo: import("./doesntexist.js").Foo;
    get bar(): import("./doesntexist.js").Foo;
}


class B implements A {
// Trigger completion: "implement interface A" display this completion:
// Actual:
// foo: any;
// get bar(): any {
//     throw new Error("Method not implemented.");
// } 

// Expected:
// foo: import("./doesntexist.js").Foo;
// get bar(): import("./doesntexist.js").Foo {
//     throw new Error("Method not implemented.");
// } 
}
🙁 Actual behavior

Triggering completion uses any instead of the unresolved type.

🙂 Expected behavior

Completion should be the unresolved type instead of any

Additional information about the issue

Found in PR https://github.com/microsoft/TypeScript/pull/59440

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

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

はじめの一歩

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

調査の方向性

interface A を実装する際は、リンク先の Playground で再現されている補完動作から始め、補完の getter/setter とプロパティ宣言に焦点を当てます。実際の any の出力を、想定される未解決の import 型と比較します。完了条件は、表示されるすべての補完が any を使用するのではなく、import("./doesntexist.js").Foo を保持することです。

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

評価

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

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

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