microsoft / microsoft/TypeScript
exports subpath with array types is not autocompleting
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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:
Contributor guide
Research direction
Start with TypeScript's language-server handling of package.json exports and reproduce the example from @repobuddy/storybook, comparing scalar and array forms of the types entry. Verify completion for the @repobuddy/storybook/storybook-addon-tag-badges import, and consider the issue done when the subpath appears while the import still resolves correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 54/100