microsoft / microsoft/TypeScript
Autocomple import parent dir wrong when rootDirs is defined
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: 3.3.3333
If you configure in the tsconfig.json a rootDirs section like
{
"compilerOptions": {
"baseUrl": "src",
"rootDirs": [
"src",
"src_gen"
]
}
}
When you try autocomplete an import from the parent folder (..) in a subfolder the subjections are wrong, on linux (where I tested) it add all the valid completitions as well the content of the system root (/) foolder.
Example
File src/example/example.tsx
import { exampleImport } from '../[autocomplete here]'
Try to autocomplete after ../ the displayed options are wrong, it add a lot of extra invalid options.
Note: It only happens when you are listing the ../ autocomplete options, if you already selected a subfolder inside ../ (e.g. ../shared/) it works properly.
Maybe related to: https://github.com/Microsoft/TypeScript/issues/28550 and https://github.com/Microsoft/TypeScript/issues/30148
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された tsconfig.json と src/example/example.tsx を使って問題を再現し、rootDirs が設定されている場合に ../ で始まる import に対する TypeScript のオートコンプリート経路を調査します。親ディレクトリの候補に有効なプロジェクトエントリのみが含まれ、システムルートの内容が含まれず、サブフォルダーを選択した後も補完が引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100