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 from ng-mocks doesn't work (VS Code) #2198

Closed
cyberbiont opened this issue Apr 7, 2022 · 5 comments · Fixed by #2202
Closed

Auto-import from ng-mocks doesn't work (VS Code) #2198

cyberbiont opened this issue Apr 7, 2022 · 5 comments · Fixed by #2202
Assignees
Labels
bug Something isn't working released v13.4.1

Comments

@cyberbiont
Copy link

cyberbiont commented Apr 7, 2022

Description of the bug

Cannot use auto-import in VS Code like with all other packages

Expected vs actual behavior

E.g. if I use MockBuilder somewhere in my code and it's not defined (typescript says 'cannot find name 'MockBuilder'.ts(2304)' I expect that pressing 'Quick fix' button will present me an option 'add import from "ng-mocks", that automatically adds import { MockBuilder } from 'ng-mocks' line.
Tried it in several projects.

Usually this feature work perfectly for other packages, probably it's something related to the way the exports are done from 'ng-mocks'.

Listing all imports manually each time is kind of annoying.

@cyberbiont cyberbiont added the bug Something isn't working label Apr 7, 2022
@cyberbiont cyberbiont changed the title Auto-import from ng-mocks doesn't work Auto-import from ng-mocks doesn't work (VS Code) Apr 7, 2022
@satanTime
Copy link
Member

Hi there. Actually it should, that's what I always do.

Could you describe steps and specify IDE its version and related plugins?

@satanTime
Copy link
Member

satanTime commented Apr 7, 2022

Hi @cyberbiont,

could you verify that this version works correctly? ng-mocks.zip

satanTime added a commit to satanTime/ng-mocks that referenced this issue Apr 7, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Apr 7, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Apr 7, 2022
satanTime added a commit to satanTime/ng-mocks that referenced this issue Apr 7, 2022
@cyberbiont
Copy link
Author

cyberbiont commented Apr 7, 2022

Sorry, false alarm.
Seems like you can auto-import something only if somewhere in your project you already have at least one import from this module.
I hadn't imported anything from 'ng-mocks' by then so it didn't work until I did it manually first time.
Thanks for paying attention, I think we can close it

@satanTime
Copy link
Member

Ah. I see. It's good to know, because I saw time to time I can import and time to time cannot, and at least one import explains it.

Also, feel free to comment if you have any feedback or concerns.

@satanTime
Copy link
Member

v13.4.1 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released v13.4.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants