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

"Solution Style" tsconfig causes VS Code Typescript language service to break #39666

Closed
seangwright opened this issue Jul 20, 2020 · 2 comments
Closed

Comments

@seangwright
Copy link

seangwright commented Jul 20, 2020

TypeScript Version:

"typescript": "3.9.7"

Search Terms:

"Solution Style" tsconfig
VS Code Typescript import intellisense failure

Code

https://github.com/seangwright/ng10-0-3-typescript-issue

Expected behavior:

Using "Solution Style" tsconfig.json in VS Code keeps standard code fixes for imports.

Actual behavior:

Code fixes for imports are completely broken.

The below repository was created with a new Angular 10.0.3 project without any Typescript customizations or VS Code settings.

Playground Link:

https://github.com/seangwright/ng10-0-3-typescript-issue

Steps:

  • npm i -g @angular/cli@latest
  • ng new ng103 --skip-git
  • cd ng103
  • code .
    • Open in VS Code (1.47.2)
  • Open src/app/app.module.ts
  • Remove line 5: import { AppComponent } from './app.component';
  • Try to use ctrl + . code action / fix to add the import statement for AppComponent
    • this fails and instead recommends Add 'const' to unresolved variable

Annotation 2020-07-19 210707

  • Navigate to src/app/app.component
  • Try to use ctrl + . code action / fix to add the import statement for TestService
    • this fails and instead shows No code actions available

Annotation 2020-07-19 210817

Now checkout branch fix/standard-tsconfig and try the above two steps to reproduce the issue and you will see the issue is gone.

All that is different between master and fix/standard-tsconfig is that master uses a "Solution Style" tsconfig.json and fix/standard-tsconfig uses the normal tsconfig.json.

Related Issues:

Both of these were closed but I'm experiencing the exact same issue:
#39411
microsoft/vscode#101696

This one is open but doesn't include the same visual details/simple reproduction:
#39632

I've tried reproducing this with VS Code 1.47.2 and Angular 10 and Typescript 10.8.3 (which means I'm not using "Solution Style" tsconfig.json and I _cannot reproduce the issue.

This problem seems to be specific to "Solution Style" tsconfig.json.

@alan-agius4
Copy link
Contributor

alan-agius4 commented Jul 20, 2020

Duplicate of #39632 and #39370

@seangwright
Copy link
Author

Closing as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants