angular-cn/packages/language-service
Andrew Scott 12cb39c1a4 fix(language-service): shorthand syntax with variables (#40239)
This commit fixes an issue in the ivy native language service
that caused the logic that finds a target node given a template
position to throw away the results. This happened because the
source span of a variable node in the shorthand structural
directive syntax (i.e. `*ngIf=`) included the entire binding.

The result was that we would add the variable node to the path and then
later detect that the cursor was outside the key and value spans and
throw away the whole result. In general, we do this because we do not
want to show information when the cursor is between a key/value
(`inputA=¦"123"`). However, when using the shorthand syntax, we run into
the situation where we can match an `AttributeBinding` as well as the
vaariable in `*ngIf="som¦eValue as myLocalVar"`. This commit updates the
visitor to retain enough information in the visit path to throw away
invalid targets but keep valid ones if there were multiple results on a
`t.Element` or `t.Template`.

PR Close #40239
2020-12-22 14:50:22 -08:00
..
bundles build(language-service): remove typescript from ivy bundle (#38088) 2020-07-16 11:04:57 -07:00
ivy fix(language-service): shorthand syntax with variables (#40239) 2020-12-22 14:50:22 -08:00
src fix(language-service): do not treat file URIs as general URLs (#39917) 2020-12-03 13:45:30 -08:00
test fix(language-service): do not treat file URIs as general URLs (#39917) 2020-12-03 13:45:30 -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