angular-cn/packages/language-service/ivy
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
..
test fix(language-service): shorthand syntax with variables (#40239) 2020-12-22 14:50:22 -08:00
BUILD.bazel feat(language-service): complete attributes on elements (#40032) 2020-12-14 12:08:41 -08:00
adapters.ts refactor(language-service): language_service_adapter -> adapters (#39619) 2020-11-17 14:45:09 -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 feat(language-service): completions for structural directives (#40032) 2020-12-14 12:08:41 -08:00
definitions.ts refactor(language-service): add context to template target system (#40032) 2020-12-14 12:08:40 -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): complete attributes on elements (#40032) 2020-12-14 12:08:41 -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 refactor(language-service): add context to template target system (#40032) 2020-12-14 12:08:40 -08:00
template_target.ts fix(language-service): shorthand syntax with variables (#40239) 2020-12-22 14:50:22 -08:00
ts_plugin.ts feat(language-service): implement autocompletion for global properties (Ivy) (#39250) 2020-12-04 10:19:45 -08:00
ts_utils.ts refactor(language-service): Use compiler APIs in Ivy to get definitions for external resources (#39476) 2020-11-06 09:17:33 -08:00
utils.ts fix(language-service): shorthand syntax with variables (#40239) 2020-12-22 14:50:22 -08:00