Skip to content
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 doesn't work unless it already imported from another file #46700

Closed
jespertheend opened this issue Nov 5, 2021 · 11 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@jespertheend
Copy link
Contributor

Issue Type: Bug

This is a continuation of microsoft/vscode#129031

  1. Unzip autoImportBug.zip and open it in vscode
  2. Place your cursor at Foo in test1.js and press ctrl + space
  3. Uncomment line 2 in test2.js
  4. Try step 2 again
Screen.Recording.2021-11-05.at.10.12.30.mp4.mp4

VS Code version: Code - Insiders 1.63.0-insider (Universal) (552af97a0170b43c9323bec62211feb184da9749, 2021-11-05T05:15:13.016Z)
OS version: Darwin x64 20.6.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 10, 10, 9
Memory (System) 16.00GB (0.72GB free)
Process Argv --crash-reporter-id a8077276-b3ec-4c71-8c24-fdfb35f5f811
Screen Reader no
VM 0%
Extensions (7)
Extension Author (truncated) Version
Bookmarks ale 13.2.2
vscode-eslint dba 2.2.2
EditorConfig Edi 0.16.4
prettier-vscode esb 9.0.0
copilot Git 1.7.3689
hexeditor ms- 1.8.2
material-icon-theme PKi 4.10.0
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythontb:30258533
pythonvspyt551cf:30291413
pythonptprofiler:30281269
vsdfh931:30280409
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
pythonvspyt200:30323110
vsccppwt:30382699
bridge0708:30335490
pygetstartedt2:30353727
bridge0723:30353136
pythonrunftest32:30365365
pythonf5test824:30361779
javagetstartedt:30350119
pythonvspyt187:30365360
pydsgst2:30361790
vsaa593:30376534

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 5, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Nov 5, 2021

@andrewbranch Can you please take a look at this. Daniel on the VS Code team mentioned to me that he was running into a similar sounding issue

@mjbvz mjbvz removed their assignment Nov 5, 2021
@jespertheend
Copy link
Contributor Author

Fwiw, I believe this has been an issue ever since I started using vscode a few months back, so any recent issues could be completely unrelated.

@andrewbranch
Copy link
Member

Duplicate of #45558

@andrewbranch andrewbranch marked this as a duplicate of #45558 Nov 5, 2021
@andrewbranch andrewbranch added the Duplicate An existing issue was already created label Nov 5, 2021
@andrewbranch
Copy link
Member

Solution for now: add a jsconfg.json with content {}

@jespertheend
Copy link
Contributor Author

Oh hmm I guess I went too far when creating a reduced test case then. Because I do still have this problem with a jsconfig in my project. I’ll try to figure out what the exact conditions are to trigger this.

@jespertheend
Copy link
Contributor Author

Ah, it seems to be caused by my jsconfig containing the files property.
Here's a new reduced test case: autoImport.zip

Screen.Recording.2021-11-06.at.12.55.15.mp4.mp4

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@jespertheend
Copy link
Contributor Author

@andrewbranch Should I create a new issue or is this working as intended?

@andrewbranch
Copy link
Member

It is working as intended.

@jespertheend
Copy link
Contributor Author

If anyone else stumbles upon this, it seems like adding "include": ["src/**/*.js"] to my jsconfig.json causes auto import for new files to work again.

@Mohammad-Ali-Rauf
Copy link

Thank you very much Solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants