angular/packages/language-service
Kristiyan Kostadinov 0138d75335 refactor(language-service): make selector nullable (#48193)
This is a follow-up from https://github.com/angular/angular/pull/48147. Changes the `DirectiveSymbol.selector` to be nullable since it's possible to have directives without a selector.

PR Close #48193
2022-11-23 09:27:03 -08:00
..
bundles build: switch all instances from ng_rollup_bundle to app_bundle (#44490) 2022-01-04 12:14:14 -08:00
src refactor(language-service): make selector nullable (#48193) 2022-11-23 09:27:03 -08:00
test fix(language-service): correctly handle host directive inputs/outputs (#48147) 2022-11-22 09:47:49 -08:00
testing feat(language-service): Quick fix to import a component when its selector is used (#47088) 2022-10-10 21:32:43 +00:00
api.ts refactor(language-service): Remove option and bundle generation for View Engine (#43723) 2021-10-05 17:24:08 -07:00
BUILD.bazel build(bazel): create AIO example playgrounds for manual testing 2022-11-22 13:51:16 -07:00
build.sh fix(language-service): update packages/language-service/build.sh script to work with vscode-ng-language-service's new Bazel build (#48120) 2022-11-18 10:21:05 -08:00
index.ts refactor(language-service): Remove option and bundle generation for View Engine (#43723) 2021-10-05 17:24:08 -07:00
override_rename_ts_plugin.ts fix(language-service): Fix detection of Angular for v14+ projects (#45998) 2022-05-16 10:03:53 -07:00
package.json feat(core): add support for Node.js version 18 (#47730) 2022-10-11 17:21:19 +00:00
README.md feat(language-service): Provide plugin to delegate rename requests to Angular (#44696) 2022-01-21 11:18:48 -08: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.