-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular template code completion removes trailing quote #1626
Comments
…he trailing quote For two-way binding syntax, the Angular compiler will append the ` =$event` to the expression of `BoundEvent`. https://github.com/angular/angular/blob/e0ac61412137144a43dc5a2134b4cd620bb4c30f/packages/compiler/src/render3/r3_template_transform.ts#L493 For example, the `[(model)]="title.¦"`, the expression of `BoundEvent` will be converted to `title.¦ =$event`. ^------ this blank will be included in the `replacementSpan` of completion item. When the user selects an item, the trailing quote will be removed. Now the paths include `BoundAttribute` and `BoundEvent` for the two-way binding syntax. So the `BoundEvent` should be removed from the paths and use the `BoundAttribute` instead. Fixes angular/vscode-ng-language-service#1626
…he trailing quote For two-way binding syntax, the Angular compiler will append the ` =$event` to the expression of `BoundEvent`. https://github.com/angular/angular/blob/e0ac61412137144a43dc5a2134b4cd620bb4c30f/packages/compiler/src/render3/r3_template_transform.ts#L493 For example, the `[(model)]="title.¦"`, the expression of `BoundEvent` will be converted to `title.¦ =$event`. ^------ this blank will be included in the `replacementSpan` of completion item. When the user selects an item, the trailing quote will be removed. Now the paths include `BoundAttribute` and `BoundEvent` for the two-way binding syntax. So the `BoundEvent` should be removed from the paths and use the `BoundAttribute` instead. Fixes angular/vscode-ng-language-service#1626
…he trailing quote For two-way binding syntax, the Angular compiler will append the ` =$event` to the expression of `BoundEvent`. https://github.com/angular/angular/blob/e0ac61412137144a43dc5a2134b4cd620bb4c30f/packages/compiler/src/render3/r3_template_transform.ts#L493 For example, the `[(model)]="title.¦"`, the expression of `BoundEvent` will be converted to `title.¦ =$event`. ^------ this blank will be included in the `replacementSpan` of completion item. When the user selects an item, the trailing quote will be removed. Now the paths include `BoundAttribute` and `BoundEvent` for the two-way binding syntax. So the `BoundEvent` should be removed from the paths and use the `BoundAttribute` instead. Fixes angular/vscode-ng-language-service#1626
…he trailing quote For two-way binding syntax, the Angular compiler will append the ` =$event` to the expression of `BoundEvent`. https://github.com/angular/angular/blob/e0ac61412137144a43dc5a2134b4cd620bb4c30f/packages/compiler/src/render3/r3_template_transform.ts#L493 For example, the `[(model)]="title.¦"`, the expression of `BoundEvent` will be converted to `title.¦ =$event`. ^------ this blank will be included in the `replacementSpan` of completion item. When the user selects an item, the trailing quote will be removed. Now the paths include `BoundAttribute` and `BoundEvent` for the two-way binding syntax. So the `BoundEvent` should be removed from the paths and use the `BoundAttribute` instead. Fixes angular/vscode-ng-language-service#1626
…he trailing quote For two-way binding syntax, the Angular compiler will append the ` =$event` to the expression of `BoundEvent`. https://github.com/angular/angular/blob/e0ac61412137144a43dc5a2134b4cd620bb4c30f/packages/compiler/src/render3/r3_template_transform.ts#L493 For example, the `[(model)]="title.¦"`, the expression of `BoundEvent` will be converted to `title.¦ =$event`. ^------ this blank will be included in the `replacementSpan` of completion item. When the user selects an item, the trailing quote will be removed. Now the paths include `BoundAttribute` and `BoundEvent` for the two-way binding syntax. So the `BoundEvent` should be removed from the paths and use the `BoundAttribute` instead. Fixes angular/vscode-ng-language-service#1626
…he trailing quote We allow the path to contain both the `t.BoundAttribute` and `t.BoundEvent` for two-way bindings but do not want the path to contain both the `t.BoundAttribute` with its children when the position is in the value span because we would then logically create a path that also contains the `PropertyWrite` from the `t.BoundEvent`. This early return condition ensures we target just `t.BoundAttribute` for this case and exclude `t.BoundEvent` children. Fixes angular/vscode-ng-language-service#1626
…he trailing quote (#45582) We allow the path to contain both the `t.BoundAttribute` and `t.BoundEvent` for two-way bindings but do not want the path to contain both the `t.BoundAttribute` with its children when the position is in the value span because we would then logically create a path that also contains the `PropertyWrite` from the `t.BoundEvent`. This early return condition ensures we target just `t.BoundAttribute` for this case and exclude `t.BoundEvent` children. Fixes angular/vscode-ng-language-service#1626 PR Close #45582
Fixed by angular/angular#45582 and included in the release from today |
I"m still experiencing this problem and also language serice code completion not working all the time ... version |
@rekna1 This was fixed in 13.3.2. I can reproduce it in 13.3.1 and 13.3.0 but as soon as I upgrade to 13.3.3, I cannot reproduce it. "also language serice code completion not working all the time" - Please do not combine two reports into a single issue. The investigation here is only focused on the resolution for the trailing quote being removed. There are known issues in 13.3.3 so upgrading to 13.3.4 may resolve this other issue. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Issue Type: Bug
When I'm using code completion in angular template it's annoying that the trailing quote is removed upon selection of any of the suggestions.
e.g. in the example below I get code completion suggestion on model
[(ngModel)]="model.|" id="name"
after I select a property on model (tried with enter or tab) the trailing quote is removed:
[(ngModel)]="model.Name id="name"
On top of that, after some time, angular language service stops providing code completion, if I change something in settings of plugin (logging level) it works again (probably just because changing this causes the plugin to reinitialize completely.
Extension version: 13.3.0
VS Code version: Code 1.66.1 (8dfae7a5cd50421d10cd99cb873990460525a898, 2022-04-06T14:50:12.141Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No
A/B Experiments
The text was updated successfully, but these errors were encountered: