angular-docs-cn/packages/language-service/test
ayazhafiz ce7f934c66 feat(language-service): directive info when looking up attribute's symbol (#33127)
Now, hovering over an attribute on an element will provide information
about the directive that attribute matches in the element, if any.
(More generally, we return information about directive symbols
matched on an element attribute.)

I believe this is similar to how the indexer provides this kind of
information, though more precise in the sense that this commit provides
directive information only if the directive selector exactly matches the
attribute selector. In another sense, this is a limitation.

In fact, there are the limitations of:

- Directives matched on the element, but with a selector of anything
  more than the attribute (e.g. `div[string-model]` or
  `[string-model][other-attr]`) will not be returned as symbols matching
  on the attribute.
- Only one symbol can be returned currently. If the attribute matches
  multiple directives, only one directive symbol will be returned.
  Furthermore, we cannot say that the directive symbol returned is
  determinstic.

Resolution of these limitations can be discussed in the future. At least
the second limitation should be very easy to fixup in a future commit.

This relies solely on the template compiler and is agnostic to any Ivy
changes, so this is strictly a feature enhancement that will not have to
be refactored when we migrate the language service to Ivy.

PR Close #33127
2019-10-15 16:49:18 +00:00
..
project test(language-service): test project cleanup (#33157) 2019-10-14 23:42:53 +00:00
BUILD.bazel test(language-service): Create proper test project (#32653) 2019-09-18 13:07:01 -07:00
completions_spec.ts fix(compiler-cli): resolve type of exported *ngIf variable. (#33016) 2019-10-14 20:24:43 +00:00
definitions_spec.ts test(language-service): Remove MockTypescriptHost.readFileContent() (#32782) 2019-09-30 14:16:03 -07:00
diagnostics_spec.ts test(language-service): Move diagnostics tests to diagnostics_spec.ts (#33158) 2019-10-14 23:40:20 +00:00
hover_spec.ts feat(language-service): directive info when looking up attribute's symbol (#33127) 2019-10-15 16:49:18 +00: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 test(language-service): Move diagnostics tests to diagnostics_spec.ts (#33158) 2019-10-14 23:40:20 +00:00
reflector_host_spec.ts test(language-service): remove MockData from MockTypescriptHost (#32752) 2019-09-18 15:29:25 -07:00
template_references_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 test(language-service): Remove redundant marker methods in MockHost (#33115) 2019-10-14 16:20:55 +00:00
ts_plugin_spec.ts test(language-service): Move diagnostics tests to diagnostics_spec.ts (#33158) 2019-10-14 23:40:20 +00:00
typescript_host_spec.ts test(language-service): test project cleanup (#33157) 2019-10-14 23:42:53 +00:00
utils_spec.ts refactor(language-service): Omit typechecking for finding directives (#32156) 2019-08-16 09:58:28 -07:00