microsoft / microsoft/TypeScript
Path based Code navigation to /index.js seems broken
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
- VSCode Version: 1.42.1
- OS Version: Mac OS
Steps to Reproduce:
Code navigation seems broken when you import by path and the file is actually in an index.js file.
There are a couple of scenarios relevant to developing in react-native
- import from another package in a monorepo
import SomeComponent from 'common-lib/Router, when the file ispackages/common-lib/src/Router/index.js - import in the same package
import SomeComponent from 'modules/Router, when the file issrc/modules/Router/index.js import SomeComponent from 'modules/Router, when the file is not actually index.jssrc/modules/Router/index.ios.jsandsrc/modules/Router/index.android.js
In general, what works is loading a file name by name (not an index.js file)
What doesn't work is loading a file by path that is actually an index.js, index.native.js, index.ios.js, index.android.js etc file
My code structure is
root
packages
mobile
server
src
server
shared
common-lib
There is some history here that is not ideal. But ok.
packages/server jsconfig.json
{
"compilerOptions": {
"target": "es2017",
"allowSyntheticDefaultImports": false,
"baseUrl": ".",
"paths": {
"common-lib/*": ["../common-lib/*"],
"mobile/*": ["../mobile/*"],
"modules/*": ["./src/shared/modules/*"],
"components/*": ["./src/shared/components/*"],
"router/*": ["./src/shared/router/*"],
"server/*": ["./src/server*"],
"App": ["./src/App"]
}
},
"exclude": ["node_modules", "../../node_modules", "build"]
}
Does this issue occur when all extensions are disabled?: Yes
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供されている packages/server jsconfig.json を使って、まず3つのインポートケースを再現します。index.js とプラットフォーム固有の index ファイルも含めます。パスベースのインポートでコードナビゲーションを追跡し、名前付きファイルのインポートと比較します。完了とは、列挙された各シナリオでナビゲーションが解決済みのモジュールに到達することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- developer-experience, devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100