-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Auto import from yarn workspaces using package's name in the package.json #48723
Comments
You need either use |
Yes, I can change the tsconfig in the every project that I am going to work on by duplicating packages's names into tsconfig's |
You should raise request to support yarn workspaces in TS repo. In your current configuration there is no indications for TS (which provides these import suggestions for VS Code) to changes how modules are imported. |
Auto-import has to strike a balance between not over-aggressively offering up everything in In this situation there's just not enough available evidence to TS that |
Thanks UPDATE Not sure why I was having this issue, but now it's gone. |
Still, there is a problem with auto-importing a package that is part of the same workspace but not yet a dependency of a current package. Importing a known symbol works perfectly without |
This issue has been marked as 'Not a Defect' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Issue Type: Bug
I have a typescript project, that uses yarn workspaces in it. When I import any entity from a package, that is a workspace, using the auto import feature - the only option I have is to import it relative to the project's root. Instead I want to also be able to import them in the same way I import any entity from a regular package from the node_modules. I have to manually refactor all the imports that vscode generates for me to keep up with the code style in the project, which is time consuming.
Steps to reproduce:
Expected behavior:
There is an option to add the import from the node_modules, that would result to this import:
since the package exists in the node_modules as a symlink to the workspace
Actual result:
The only option in the context menu is:
Which leads to this import:
VS Code version: Code - Insiders 1.67.0-insider (Universal) (27dd7b4, 2022-04-12T18:42:30.490Z)
OS version: Darwin x64 21.3.0
Restricted Mode: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Extensions (52)
A/B Experiments
The text was updated successfully, but these errors were encountered: