Skip to content

VSCode intellisense not working with typescript 3.7.5 in Angular projects #37187

Closed
@admosity

Description

@admosity

TS Template added by @mjbvz

TypeScript Version: 3.7.5

Search Terms

  • angular

Using the latest vscode with Typescript 3.7.5, intellisense breaks for anything referencing node_modules. This is reflected on new projects created with @angular/cli as well. Tested on an Angular 7 project to see if the version difference between Angular 7 and Angular 9 made a difference.

> code --version
1.42.1
c47d83b293181d9be64f27ff093689e8e7aed054
x64

Steps to Reproduce:

  1. Type a symbol that can be indexed from node_modules (e.g. ReactiveFormsModule from Angular).
  2. Hit ctrl+space or whatever is the intellisense hotkey is configured..
  3. No Suggestions appears.

Switching to the lower workspace Typescript version in my Angular 7 setup I can get the suggestions to show again.

Video reproduction with Typescript version switch:
intellisense-repro

On a fresh Angular 9 setup:

image

Does this issue occur when all extensions are disabled?: Yes
image

Same project in Atom:

image

EDIT: This appears to be happening in Atom with Typescript 3.7.5 as well now in the Angular 9 setup. Might be specifically a Typescript 3.7.5 issue.

EDIT EDIT: It seems that adding node_modules/@angular as a typeRoot fixes some issues:

TSCONFIG:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types",
      "node_modules/@angular"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

It seems that adding node_modules/@angular as a typeRoot fixes some issues:
image

image

Metadata

Metadata

Assignees

Labels

DuplicateAn existing issue was already created

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions