microsoft / microsoft/TypeScript
typescript intellisense can't find second level index.ts
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Bug Report
it's reopening of #42247 as tested what was suggested and didn't work, opening it as I didn't get any more comment on that issue
https://github.com/microsoft/TypeScript/issues/42247#issuecomment-758863988
Auto-import assumes that an index.d.ts that re-exports a bunch of stuff is a "barrel" module that intends to provide a facade over an opaque directory hierarchy. So in that case, if you want the deeper path, you'd need to just import "./platform-browser/animations"; instead of re-exporting those members.
I tried @RyanCavanaugh suggestion but look like it doesn't work
🔎 Search Terms
- index.ts
- intellisense
🕗 Version & Regression Information
⏯ Playground Link
I created two repos, one following the suggestion and another one with normal index.ts
each repo has a gif showing that IntelliSense doesn't work!
https://github.com/mhamri/vscode-typescript-intellisense-bugs/tree/main/nx-lib-second-level-index-ts
and here is a repo of normal index.ts that still with path doesn't get discovered
https://github.com/mhamri/vscode-typescript-intellisense-bugs/tree/main/nx-lib-first-level-index-ts
🙁 Actual behavior
should get suggestions and IntelliSense for the first level and second level items. or typescript suggests a way that works. atm typescript doesn't give any IntelliSense for any of the second level index.ts for libraries like RxJs , Angular
Please check the original issue, more links to other repos are attached.
🙂 Expected behavior
typescript provides suggestion for the second level items.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior in the two linked repositories, then read the referenced comment and issue #42247 for the prior investigation. Done means determining whether TypeScript can provide first- and second-level index.ts IntelliSense suggestions, or documenting a supported import pattern that works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100