a8c5c8ed2d
The Language Service uses the source span of AST nodes to recognize which node a user has selected, given their cursor position in a template. This is used to trigger autocompletion. The previous source span of BindingPipe nodes created a problem when: 1) the pipe binding had no identifier (incomplete or in-progress expression) 2) the user typed trailing whitespace after the pipe character ('|') For example, the expression `{{foo | }}`. If the cursor preceded the '}' in that expression, the Language Service was unable to detect that the user was autocompleting the BindingPipe expression, since the span of the BindingPipe ended after the '|'. This commit changes the expression parser to expand the span of BindingPipe expressions with a missing identifier, to include any trailing whitespace. This allows the Language Service to correctly recognize this case as targeting the BindingPipe and complete it successfully. The `nameSpan` of the BindingPipe is also moved to be right-aligned with the end of any whitespace present in the pipe binding expression. This change allows for the disabled test in the Language Service for pipe completion in this case to be re-enabled. PR Close #40346 |
||
---|---|---|
.. | ||
legacy | ||
BUILD.bazel | ||
adapters_spec.ts | ||
compiler_spec.ts | ||
completions_spec.ts | ||
definitions_spec.ts | ||
diagnostic_spec.ts | ||
env.ts | ||
gettcb_spec.ts | ||
mock_host.ts | ||
quick_info_spec.ts | ||
references_spec.ts | ||
test_utils.ts | ||
type_definitions_spec.ts |