angular-cn/packages/language-service/test
ayazhafiz b64ead5cb8 fix(language-service): prune duplicate returned definitions (#34995)
Sometimes, a request for definitions will return multiple of the same
definition. This can happen in at least the cases of

- two-way bindings (one of the same definition for the property and
  event binding)
- multiple template binding expressions in the same attribute
  - something like "*ngFor="let i of items; trackBy: test" has two
    template bindings, resulting in two template binding ASTs at the
    same location (the attribute span). The language service then parses
    both of these bindings individually, resulting in two independent
    but identical definitions. For more context, see https://github.com/angular/angular/pull/34847#discussion_r371006680.

This commit prunes duplicate definitions by signing definitions with
their location, and checking if that location signature has been seen in
a previous definition returned to the client.

PR Close #34995
2020-01-29 12:21:04 -08:00
..
project feat(language-service): specific suggestions for template context diags (#34751) 2020-01-23 12:25:42 -08:00
BUILD.bazel test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
completions_spec.ts feat(language-service): completions for output $event properties in (#34570) 2020-01-28 09:07:43 -08:00
definitions_spec.ts fix(language-service): prune duplicate returned definitions (#34995) 2020-01-29 12:21:04 -08:00
diagnostics_spec.ts feat(language-service): completions for output $event properties in (#34570) 2020-01-28 09:07:43 -08:00
expression_diagnostics_spec.ts refactor(compiler-cli): Move diagnostics files to language service (#33809) 2019-11-14 09:29:07 -08:00
global_symbols_spec.ts refactor(compiler-cli): Move diagnostics files to language service (#33809) 2019-11-14 09:29:07 -08:00
hover_spec.ts feat(language-service): provide hover for microsyntax in structural directive (#34847) 2020-01-27 10:47:46 -08:00
html_info_spec.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
language_service_spec.ts refactor(language-service): Consistent naming between ts and ng LanguageService (#34888) 2020-01-22 14:36:04 -05:00
mocks.ts refactor(language-service): cleanup of low-hanging TODOs (#34784) 2020-01-21 13:09:30 -05:00
reflector_host_spec.ts test(language-service): remove MockData from MockTypescriptHost (#32752) 2019-09-18 15:29:25 -07:00
template_spec.ts test(language-service): remove MockData from MockTypescriptHost (#32752) 2019-09-18 15:29:25 -07:00
test_utils.ts fix(language-service): Recompute analyzed modules only when source files change (#33806) 2019-11-15 10:42:09 -08:00
ts_plugin_spec.ts fix(language-service): Remove getExternalFiles() (#34260) 2019-12-05 13:13:20 -08:00
typescript_host_spec.ts refactor(language-service): Avoid leaking host outside of LanguageService (#34941) 2020-01-24 15:53:52 -08:00
typescript_symbols_spec.ts fix(compiler-cli): Refactor getTsTypeFromBuiltinType (#33778) 2019-11-15 10:43:41 -08:00
utils_spec.ts fix(language-service): Diagnostic span should point to class name (#34932) 2020-01-23 15:55:44 -08:00