-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Auto import in angular typescript is not working #28773
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
Comments
Does this reproduce in the latest VS Code insiders build with all extensions disabled? |
This happens with latest build both on macOS and Windows 10. A latest few builds, the autocomplete feels incosistent and partially working. |
I tried restarting the app, but no good. |
I haven't tried this insiders build. I am using the official final build. |
Try on insiders |
I've just tried insiders version on Windows 10. The problem is still there. Auto import is not picking up the definition inside installed
It gets even weirder with The conclusion is that this auto import logic is obviously broken. |
I confirmed this by using TS 3.3.0-dev20181130. The
|
@mjbvz I don't get that exception. Note that when I create app and add that library it is not included in the project (because its not referenced from anywhere and hence completion wont show up for it as we only look for symbols in files included in the program). Opening the types.d.ts doesn't throw any expression. If I add |
@mjbvz I am seeing the exceptions with that call stack when there is ordering mismatch in sending the requests from code-insiders. I was looking into #28389 this and I noticed that exception and log is:
And the log from vscode output window shows:
|
@sheetalkamat I can't repo the exception anymore on latest I still don't get quick fix though in a simple ts file though because import a from '@datorama/akita'
ID; And shouldn't imports quick fixes pick up the |
@mjbvz the index.ts opened in inferred project and doesn't include
|
Even once the import is resolved though, the quick fix still doesn't work for |
The ID is type and not value. So it will work for import a from '@datorama/akita'
const x : ID; |
Man, i should stop trying to repo this bug; yes that was the issue. Going back to the original repo steps:
|
The same problem occurs even when I try to import some |
@mjbvz and @sheetalkamat I'm having the same issue for Angular Material.
The suggestion for VS Code: 1.29.1 (system setup) |
This is still not working, even with the latest VSCode version :( |
@RyanCavanaugh @DanielRosenwasser This shouldn't be a bug but working as intended? WIthout the files being included in the project how can we know the symbol 'ID' is from Let me know if we need to take any other action here. Thanks |
Is it possible to force tsserver to lookup all files up-front? If i'm using a lot of dependencies, or a large project with many dependencies, i would prefer to have tsserver scan all files up-front, so i don't have to find where every symbol is defined every time. As a user, i could choose between
I can see how doing this by default would make the process slower, so could this be an opt-in setting that forces tsserver to parse all files up-front eagerly? (user be warned: 'it will be slow', or something among those lines) Thank you |
VSCode Version:
Version 1.29.1
Typescript 3.1.4
OS Version:
macOS 10.14.1
Steps to Reproduce:
Create new angular app:
ng new app
Add new library:
yarn add @datorama/akita
Create session.model.ts:
Auto import is not working. I get this error:
Starting VSCode with
code --disable-extensions
didn't help :(The text was updated successfully, but these errors were encountered: