angular-cn/packages/language-service
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
..
bundles fix(language-service): Return empty external files during project initialization (#32519) 2019-09-09 12:22:19 -04:00
src feat(language-service): directive info when looking up attribute's symbol (#33127) 2019-10-15 16:49:18 +00:00
test feat(language-service): directive info when looking up attribute's symbol (#33127) 2019-10-15 16:49:18 +00:00
BUILD.bazel build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
index.ts build: roll up to named .js files rather than 'index.js' (#19190) 2017-09-19 16:59:18 -07:00
language-service.ts build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07:00
package.json fix(language-service): Use index.d.ts for typings (#33043) 2019-10-10 13:58:57 -07:00