angular-cn/packages/language-service
Zach Arend 9a5ac47331 feat(language-service): initial implementation for `findRenameLocations` (#40140)
This commit lays the groundwork for potentially providing rename
locations from the Ivy native LS. The approach is very similar to what
was done with the feature to find references. One difference, however,
is that we did not require the references to be fully "correct". That
is, the exact text spans did not matter so much, as long as we provide a
location that logically includes the referenced item.

An example of a necessary difference between rename locations and references is
directives. The entire element in the template is a "reference" of the
directive's class. However, it's not a valid location to be renamed. The
same goes for aliased inputs/outputs. The locations in the template
directly map to the class property, which is correct for references, but
would not be correct for rename locations, which should instead map to
the string node fo the alias.

As an initial approach to address the aforementioned issues with rename
locations, we check that all the rename location nodes have the same text. If
_any_ node has text that differs from the request, we do not return any
rename locations. This works as a way to prevent renames that could
break the the program by missing some required nodes in the rename action, but
allowing other nodes to be renamed.

PR Close #40140
2021-01-14 16:24:39 -08:00
..
bundles build(language-service): remove typescript from ivy bundle (#38088) 2020-07-16 11:04:57 -07:00
ivy feat(language-service): initial implementation for `findRenameLocations` (#40140) 2021-01-14 16:24:39 -08:00
src fix(language-service): diagnostic and definition should work for absolute url (#40406) 2021-01-13 09:05:04 -08:00
test fix(language-service): diagnostic and definition should work for absolute url (#40406) 2021-01-13 09:05:04 -08:00
BUILD.bazel build(language-service): include sources for Ivy LS (#39748) 2020-11-20 09:23:45 -08:00
build.sh build(language-service): install @angular/language-service in root node_modules (#40058) 2020-12-10 13:48:04 -08:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
language-service.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json build(language-service): Remove ls_rollup_bundle (#38086) 2020-07-16 11:04:28 -07:00