microsoft / microsoft/TypeScript
exports subpath with array types is not autocompleting
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.109.5
- OS Version: Windows 11
This issue should apply to all OS. It's about JavaScript/TypeScript language server handling import paths.
When a dependency uses array form in the export path, e.g. in [@repobuddy/storybook](https://github.com/repobuddy/storybook/blob/main/libs/storybook/package.json):
```jsonc
{
"exports": {
".": {
"types": [
"./esm/index.d.ts",
"./src/index.ts"
],
"default": "./esm/index.js"
},
"./manager": {
"types": "./esm/manager/index.d.ts",
"default": "./esm/manager/index.js"
},
"./storybook-addon-tag-badges": {
"types": [
"./esm/storybook-addon-tag-badges/index.d.ts",
"./src/storybook-addon-tag-badges/index.ts"
],
"default": "./esm/storybook-addon-tag-badges/index.js"
},
}
}
```
The import can resolve correctly, e.g.:
```tsx
import type { Meta, StoryObj } from '@repobuddy/storybook/storybook-addon-tag-badges'
```
But the path completion does not show the subpath:
贡献指南
调研方向
从 TypeScript 的 language server 对 package.json exports 的处理开始,复现 @repobuddy/storybook 中的示例,并比较 types 条目的标量形式和数组形式。验证 @repobuddy/storybook/storybook-addon-tag-badges import 的补全;当子路径出现且 import 仍能正确解析时,即可认为 issue 已完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, typescript
- 领域
- developer-experience, tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 54/100