microsoft / microsoft/TypeScript
Provide better displays for paths when not fully resolved
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
In https://github.com/microsoft/TypeScript/pull/44713, we started to do partial resolutions of paths for auto-import completions. This is great, however, it would be nice if we could do a small amount of work for common cases just to clean up paths that go through node_modules even without further keystrokes.
- In cases where the resolution strategy is
nodeand there are no path mappings, we could try to rewrite some number of dotted segments, followed bynode_modulesintopackage_name/...until fully resolved. - In other cases, we could even just use
containingFolderName/filename
Of course, there are risks here since in JS, string math isn't always cheap. In cases where you have hundreds of thousands of auto-imports from node_modules, this could still get expensive.
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 tracing the partial path-resolution logic introduced in PR #44713 for auto-import completions, focusing on node_modules and node resolution cases. Compare the proposed package_name/... and containingFolderName/filename displays, and verify that the result remains affordable for large node_modules completion sets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100