angular-docs-cn/packages/language-service/ivy
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
..
test feat(language-service): initial implementation for `findRenameLocations` (#40140) 2021-01-14 16:24:39 -08:00
BUILD.bazel fix(language-service): include compilerOptions.rootDir in rootDirs (#40243) 2021-01-06 10:54:11 -08:00
adapters.ts fix(language-service): LSParseConfigHost.resolve should not concat abs paths (#40242) 2021-01-06 10:54:40 -08:00
attribute_completions.ts feat(language-service): completions for structural directives (#40032) 2020-12-14 12:08:41 -08:00
compiler_factory.ts fix(compiler-cli): track poisoned scopes with a flag (#39923) 2020-12-03 13:42:13 -08:00
completions.ts fix(language-service): Support completions of two-way bindings (#40185) 2021-01-07 13:18:38 -08:00
definitions.ts fix(language-service): Support 'go to definition' for two-way bindings (#40185) 2021-01-07 13:18:38 -08:00
display_parts.ts feat(language-service): complete attributes on elements (#40032) 2020-12-14 12:08:41 -08:00
language_service.ts feat(language-service): initial implementation for `findRenameLocations` (#40140) 2021-01-14 16:24:39 -08:00
quick_info.ts refactor(compiler-cli): Enable pipe information when checkTypeOfPipes=false (#39555) 2020-12-11 16:19:15 -08:00
references.ts feat(language-service): initial implementation for `findRenameLocations` (#40140) 2021-01-14 16:24:39 -08:00
template_target.ts refactor(language-service): Have TemplateTarget recognize two way bindings (#40185) 2021-01-07 13:18:38 -08:00
ts_plugin.ts feat(language-service): initial implementation for `findRenameLocations` (#40140) 2021-01-14 16:24:39 -08:00
ts_utils.ts fix(language-service): Do not include $event parameter in reference results (#40158) 2021-01-05 10:07:20 -08:00
utils.ts refactor(language-service): Have TemplateTarget recognize two way bindings (#40185) 2021-01-07 13:18:38 -08:00