angular/vscode-ng-language-service/server
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
..
bin build: migrate vscode extension into repo (#63924) 2025-09-24 20:24:32 +00:00
src feat(language-server): Support client-side file watching via onDidChangeWatchedFiles 2026-01-23 19:52:37 +00:00
BUILD.bazel build: align git tags with package.json version for snapshot builds (#64350) 2025-10-13 08:28:53 -07:00
esbuild.mjs build: update dependencies and build config (#64154) 2025-09-30 12:35:07 -04:00
package.json build(language-service): upgrade LSP library to v9.0.1 (LSP 3.17) 2026-01-22 19:55:53 +00:00
README.md build: format md files 2025-11-06 10:03:05 -08:00

@angular/language-server

This package contains the Language Server Protocol (LSP) implementation of the Angular Language Service.

Usage

See node index.js --help