angular/packages/language-service
Andrew Scott d4c8a9a887 refactor(compiler-cli): decouple SymbolBuilder from BoundTarget and minimize adapter surface
Decouple `SymbolBuilder` from the full `BoundTarget` interface by introducing a purpose-built `SymbolBoundTarget` interface containing only the 4 methods required for symbol resolution. This eliminates the need for the large, pass-through `BoundTargetAdapter` and further isolates `SymbolBuilder` from compiler-internal implementation details.

Also minimize `TypeCheckableDirectiveMetaAdapter` by redefining `SymbolDirectiveMeta` to not extend `DirectiveMeta`, exposing only the properties actually used by `SymbolBuilder`.

Removed dead code `getDirectiveMeta` in `template_symbol_builder.ts` which was unused.

These changes improve maintainability and ensure a cleaner architecture by strictly defining the boundaries of what `SymbolBuilder` needs from the rest of the system.
By limiting the required inputs to only what's necessary for the implementation, we make it easier to re-use
the implementation between different compiler architectures
2026-04-08 11:59:42 -07:00
..
bundles build: update to the latest version of devinfra and rename npm2 workspace (#63093) 2025-08-11 10:35:32 -07:00
src refactor(compiler-cli): decouple SymbolBuilder from BoundTarget and minimize adapter surface 2026-04-08 11:59:42 -07:00
test refactor(compiler-cli): decouple TemplateSymbolBuilder from ts.TypeChecker 2026-04-07 14:51:37 -07:00
testing feat(language-service): add linked editing ranges for HTML tag synchronization 2026-02-04 15:45:27 -08:00
api.ts perf(language-service): use lightweight project warmup for Angular analysis 2026-02-20 02:11:06 +00:00
BUILD.bazel refactor: fix types extraction for private (#67898) 2026-03-26 21:32:20 +00:00
index.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
index.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
override_rename_ts_plugin.ts build: update cross-repo angular dependencies (#64255) 2025-10-07 20:15:46 -04:00
package.json refactor(language-service): Export template target from API 2026-03-25 13:07:47 -07:00
plugin-factory.ts refactor(language-service): delegate plugin initialization to bundle 2026-02-02 11:07:06 -08:00
private.ts refactor(language-service): Export template target from API 2026-03-25 13:07:47 -07:00
README.md build: format md files 2025-11-06 10:03:05 -08:00
tsconfig.json build: add comment explaining path maps (#61584) 2025-05-21 17:27:18 +00:00

Override Rename Ts Plugin

When the user wants to rename a symbol in the ts file VSCode will ask the rename providers for the answer in turn. If the first extension returns the result, the VSCode will break the loop and apply the result. If the first extension cannot rename the symbol, VSCode will ask the second extension in the list (built-in TS/JS extension, Angular LS extension, etc.). In other words, VSCode takes the result from only one rename provider and the order depends on registration timing, scoring.

Because the built-in ts extension and Angular extension have the same high score, if the built-in ts extension is the first(depends on the time the extension was registered), the result will be provided by the built-in extension. We want Angular to provide it, so this plugin will delegate rename requests and reject the request for the built-in ts server.

The Angular LS only provides the rename info when working within an Angular project. If we cannot locate Angular sources in the project files, the built-in extension should provide the rename info.

This plugin will apply to the built-in TS/JS extension and delegate rename requests to the Angular LS. It provides the rename info only when it is an Angular project. Otherwise, it will return info by the default built-in ts server rename provider.

See here for more info.