angular/vscode-ng-language-service
Andrew Scott 6fb39d9b62 feat(language-server): Support client-side file watching via onDidChangeWatchedFiles
This implements `onDidChangedWatchedFiles` in the language server, which
allows the client to communicate changes to files rather than having the
server create system file/directory watchers.

This option is enabled in the extension via the
`angular.server.useClientSideFileWatcher` setting.
When enabled, the extension registers a FileSystemWatcher for .ts, .html, and package.json files and forwards events to the server. The server completely disables its internal native file watchers (via a new 'ServerHost' implementation that stubs watchFile/watchDirectory).

This is significantly more performant and reliable than native watching for several reasons:
- Deduplication: VS Code already watches the workspace. Piggybacking on these events prevents the server from duplicating thousands of file watchers.
- OS Limits: Since the server opens zero watcher handles, it is impossible to hit OS limits (ENOSPC), no matter how large the repo is.
- Optimization: VS Code's watcher uses highly optimized native implementations (like Parcel Watcher in Rust/C++) which handle recursive directory watching far better than Node.js's 'fs.watch'.
- Debouncing: The client aggregates extremely frequent file events (e.g., during 'git checkout'), reducing the flood of processing requests to the server.

This option was tested in one very large internal project and observed
~10-50x improvement of initialization times.

fixes #66543
2026-01-23 19:52:37 +00:00
..
client feat(language-server): Support client-side file watching via onDidChangeWatchedFiles 2026-01-23 19:52:37 +00:00
common build: update license for vscode extension 2026-01-12 08:17:39 -08:00
docs build: automate GitHub release creation for vscode extension 2025-11-21 12:22:20 -05:00
integration build: initial test of TypeScript 6 2026-01-15 13:41:01 -08:00
server feat(language-server): Support client-side file watching via onDidChangeWatchedFiles 2026-01-23 19:52:37 +00:00
syntaxes fix(vscode-extension): add syntax highlighting for arrow functions 2026-01-13 11:09:26 -08:00
tools build: remove tsx dependency and update release script to use node directly 2026-01-14 07:56:38 -08:00
angular.png build: migrate vscode extension into repo (#63924) 2025-09-24 20:24:32 +00:00
BUILD.bazel refactor: exclude tsconfig.json from VSIX package contents (#64991) 2025-11-07 11:36:31 -08:00
CHANGELOG.md docs: release notes for the vscode extension 21.1.1 release (#66715) 2026-01-22 10:44:12 -08:00
DEVELOPER.md docs(vscode-extension): Update developer docs to match current setup 2026-01-05 17:01:49 -05:00
package.json feat(language-server): Support client-side file watching via onDidChangeWatchedFiles 2026-01-23 19:52:37 +00:00
README.md docs: update link to releases for vscode extension 2025-12-15 11:41:14 -08:00
tsconfig-test.json build: migrate to in-repo ts_project with strict deps (#64306) 2025-10-09 10:00:31 -07:00
tsconfig.json build: migrate to in-repo ts_project with strict deps (#64306) 2025-10-09 10:00:31 -07:00

Angular Language Service

demo

Features

This extension provides a rich editing experience for Angular templates, both inline and external templates including:

  • Completions lists
  • AOT Diagnostic messages
  • Quick info
  • Go to definition

Download

Download the extension from Visual Studio Marketplace.

Configuring compiler options for the Angular Language Service

The Angular Language Service uses the same set of options that are used to compile the application. To get the most complete information in the editor, set the strictTemplates option in tsconfig.json, as shown in the following example:

"angularCompilerOptions": {
  "strictTemplates": true
}

For more information, see the Angular compiler options guide.

Versioning

The language service extension relies on the @angular/language-service and typescript packages for its backend. @angular/language-service is always bundled with the extension, and is always the latest version at the time of the release. typescript is loaded, in order of priority, from:

  1. The path specified by typescript.tsdk in project or global settings.
  2. (Recommended) The version of typescript bundled with the Angular Language Service extension.
  3. The version of typescript present in the current workspace's node_modules.

We suggest not specifying typescript.tsdk in your VSCode settings per method (1) above. If the typescript package is loaded by methods (1) or (3), there is a potential for a mismatch between the API expected by @angular/language-service and the API provided by typescript. This could lead to a failure of the language service extension.

For more information, please see #594.

Installing a particular release build

Download the .vsix file for the release that you want to install from the releases tab.

Do not open the .vsix file directly. Instead, in Visual Studio code, go to the extensions tab. Click on the "..." menu in the upper right corner of the extensions tab, select "Install from vsix..." and then select the .vsix file for the release you just downloaded.

The extension can also be installed with the following command:

code --install-extension /path/to/ngls.vsix

Angular Language Service for Other Editors