New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path completions for Node.js subpath imports #52460
Labels
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Comments
RyanCavanaugh
added
Suggestion
An idea for TypeScript
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
labels
Feb 1, 2023
5 tasks
echocrow
added a commit
to echocrow/advent-of-code
that referenced
this issue
Dec 9, 2023
see open issue: microsoft/TypeScript#52460
Same here, except the IDE used. Problem is somehow fixable with |
RyanCavanaugh
added
Help Wanted
You can do this
and removed
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
labels
Jan 30, 2024
6 tasks
Looks like this was fixed in #55015 |
Is there a version we can try to ensure it works as expected? In the meantime, we are duplicating it inside the |
|
andrewbranch
changed the title
Intelli-sense for Node.js subpath imports
Path completions for Node.js subpath imports
Mar 7, 2024
This was referenced Mar 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Suggestion
Node.js for a while has a way to define import aliases (known as subpath imports) in
package.json
file. The subpath imports also work fine when I compile my code usingtsc
and inside my code editor (VSCode).However, as I type the import path in my code editor, no suggestions related to subpath imports are shown.
Given, I have the following subpath import alias inside
package.json
.I should be able to type
#controllers
and get suggestions. Infact, using an export symbol from one of the controller files should write the auto-import using the alias.tsconfig.json
Following is a trimmed down version of my
tsconfig.json
file.🔍 Search Terms
✅ Viability Checklist
⭐ Suggestion
Since, TypeScript can understand and compile subpath imports, it will be great, if they are also suggested during import autocomplete
📃 Motivating Example
Have nice experience of auto-importing files with aliases.
💻 Use Cases
Right now, I have to either manually type the complete import statement by hand. Or type the export symbol name and update the import path to use the subpath alias.
Attaching a small screen recording of the same
subpath-imports.mov
The text was updated successfully, but these errors were encountered: