5

Intellisense for html in my VSCode has stopped working. I'm able to get the autocomplete for html tags, but I'm not getting suggestions for .ts variables. I've always used this feature and for some reasons it's not working anymore. For ts files it's working correctly.

VSCode version: 1.60.2

Installed extensions:

  • Angular Language Service
  • Angular spec generator
  • OpenAPI (Swagger) Editor
  • Reload
  • SVG Viewer
  • TODO Highlight
  • Visual Studio IntelliCode
  • YAML

I don't remember installing one of those and then intellisense for html stop working. I've tried restarting VSCode and the language shown in the bottom bar of VSCode is the right one.

Usr
  • 2,628
  • 10
  • 51
  • 91

6 Answers6

9

I had the same problem and fixed by disabling and then re-enable the Angular Language Service extension.

  1. Disable the Angular Language Service.
  2. Reload VS Code.
  3. Enable the Angular Language Service.

This worked for me.

Karti
  • 131
  • 1
  • 4
1

Try enabling "Force Strict Templates" in your Settings. I am on Angular 15. Now I see the autocomplete for nested objects in the HTML. Adding strictTemplates in my tsconfig.json did not work as suggested by the documentation.

"Force Strict Template" option in VSCode Settings

Neil Menon
  • 169
  • 1
  • 5
0

In order to get full angular variable autocomplete feature inside your html file we need to tweak some setting in our workspace tsconfig.json file, Please perform the following steps :-

  1. Open tsconfig.json file of your angular project workspace.
  2. set strictTemplates flag to true in your tsconfig.json file.
"angularCompilerOptions": {
    "strictTemplates": true   
},
  1. Restart your Visual studio code and then check if suggestion are coming inside your html file.

This is also stated in Angular language plugin's official info page.

enter image description here

Rifky Niyas
  • 1,737
  • 10
  • 25
0

Have you tried disabling all the plugins except Angular Lanugage Service ? and if that works just start enabling one by one until it stops working.

Also have you checked the logs of the extensions ? Where are the VSCode error logs for extensions?

Mauricio Gracia Gutierrez
  • 10,288
  • 6
  • 68
  • 99
0

I had the same problem and fixed by disabling and then re-enable the Angular Lanugage Service extension.

  1. Disable the Angular Lanugage Service,
  2. Reload VS Code
  3. Enable the Angular Lanugage Service.

This worked for me.

Karti
  • 1
0

I have installed both Angular Language Servcie and Angular Snippets (Version 13) thats why problem occurs. then i uninstall Angular Snippets (Version 13) and restart Angular Language Servcie and restrat vs code.and now its working fine.