-
Notifications
You must be signed in to change notification settings - Fork 122
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
No more completion for components / HTML tags in Ivy mode #1140
No more completion for components / HTML tags in Ivy mode #1140
Comments
+1 I have the same issue. As a quick fix, disabling the experimental Ivy features in VS Code settings, the completion returns to expected behavior. |
Same behavior + always crash Thanks |
Same problem, enabling the ivy engine makes it no longer recognise component tags, something is broken |
Same problem. @reed-lawrence suggested good temporary solution. |
The compiler's parsing code has logic to recover from incomplete open tags (i.e. `<div`) but the recovery logic does not handle when the incomplete tag is terminated by an EOF. This commit updates the logic to allow for the EOF character to be interpreted as the end of the tag open so that the parser can continue processing. It will then fail to find the end tag and recover by marking the open tag as incomplete. Part of angular/vscode-ng-language-service#1140
The compiler's parsing code has logic to recover from incomplete open tags (i.e. `<div`) but the recovery logic does not handle when the incomplete tag is terminated by an EOF. This commit updates the logic to allow for the EOF character to be interpreted as the end of the tag open so that the parser can continue processing. It will then fail to find the end tag and recover by marking the open tag as incomplete. Part of angular/vscode-ng-language-service#1140
The compiler's parsing code has logic to recover from incomplete open tags (i.e. `<div`) but the recovery logic does not handle when the incomplete tag is terminated by an EOF. This commit updates the logic to allow for the EOF character to be interpreted as the end of the tag open so that the parser can continue processing. It will then fail to find the end tag and recover by marking the open tag as incomplete. Part of angular/vscode-ng-language-service#1140
The compiler's parsing code has logic to recover from incomplete open tags (i.e. `<div`) but the recovery logic does not handle when the incomplete tag is terminated by an EOF. This commit updates the logic to allow for the EOF character to be interpreted as the end of the tag open so that the parser can continue processing. It will then fail to find the end tag and recover by marking the open tag as incomplete. Part of angular/vscode-ng-language-service#1140
An opening tag `<` without any characters after it is interperted as a text node (just a "less than" character) rather than the start of an element in the template AST. This commit adjusts the autocomplete engine to provide element autocompletions when the nearest character to the left of the cursor is `<`. Note that this also allows for spaces between the `<` so `< ¦` will also provide element autocomplete, much like other extensions such as Emmet. Part of the fix for angular/vscode-ng-language-service#1140
…sion for LS The current logic in the compiler is to bail when there are errors when parsing a template into an HTML AST or when there are errors in the i18n metadata. As a result, a template with these types of parse errors _will not have any information for the language service_. This is because we never attempt to conver the HTML AST to a template AST in these scenarios, so there are no template AST nodes for the language service to look at for information. In addition, this also means that the errors are never displayed in the template to the user because there are no nodes to map the error to. This commit adds an option to the template parser to temporarily ignore the html parse and i18n meta errors and always perform the template AST conversion. At the end, the i18n and HTML parse errors are appended to the returned errors list. While this seems risky, it at least provides us with more information than we had before (which was 0) and it's only done in the context of the language service, when the compiler is configured to use poisoned data (HTML parse and i18n meta errors can be interpreted as a "poisoned" template). fixes angular/vscode-ng-language-service#1140
…le (#41054) The compiler's parsing code has logic to recover from incomplete open tags (i.e. `<div`) but the recovery logic does not handle when the incomplete tag is terminated by an EOF. This commit updates the logic to allow for the EOF character to be interpreted as the end of the tag open so that the parser can continue processing. It will then fail to find the end tag and recover by marking the open tag as incomplete. Part of angular/vscode-ng-language-service#1140 PR Close #41054
…le (#41054) The compiler's parsing code has logic to recover from incomplete open tags (i.e. `<div`) but the recovery logic does not handle when the incomplete tag is terminated by an EOF. This commit updates the logic to allow for the EOF character to be interpreted as the end of the tag open so that the parser can continue processing. It will then fail to find the end tag and recover by marking the open tag as incomplete. Part of angular/vscode-ng-language-service#1140 PR Close #41054
An opening tag `<` without any characters after it is interperted as a text node (just a "less than" character) rather than the start of an element in the template AST. This commit adjusts the autocomplete engine to provide element autocompletions when the nearest character to the left of the cursor is `<`. Part of the fix for angular/vscode-ng-language-service#1140
…sion for LS The current logic in the compiler is to bail when there are errors when parsing a template into an HTML AST or when there are errors in the i18n metadata. As a result, a template with these types of parse errors _will not have any information for the language service_. This is because we never attempt to conver the HTML AST to a template AST in these scenarios, so there are no template AST nodes for the language service to look at for information. In addition, this also means that the errors are never displayed in the template to the user because there are no nodes to map the error to. This commit adds an option to the template parser to temporarily ignore the html parse and i18n meta errors and always perform the template AST conversion. At the end, the i18n and HTML parse errors are appended to the returned errors list. While this seems risky, it at least provides us with more information than we had before (which was 0) and it's only done in the context of the language service, when the compiler is configured to use poisoned data (HTML parse and i18n meta errors can be interpreted as a "poisoned" template). fixes angular/vscode-ng-language-service#1140
…41068) An opening tag `<` without any characters after it is interperted as a text node (just a "less than" character) rather than the start of an element in the template AST. This commit adjusts the autocomplete engine to provide element autocompletions when the nearest character to the left of the cursor is `<`. Part of the fix for angular/vscode-ng-language-service#1140 PR Close #41068
…sion for LS (#41068) The current logic in the compiler is to bail when there are errors when parsing a template into an HTML AST or when there are errors in the i18n metadata. As a result, a template with these types of parse errors _will not have any information for the language service_. This is because we never attempt to conver the HTML AST to a template AST in these scenarios, so there are no template AST nodes for the language service to look at for information. In addition, this also means that the errors are never displayed in the template to the user because there are no nodes to map the error to. This commit adds an option to the template parser to temporarily ignore the html parse and i18n meta errors and always perform the template AST conversion. At the end, the i18n and HTML parse errors are appended to the returned errors list. While this seems risky, it at least provides us with more information than we had before (which was 0) and it's only done in the context of the language service, when the compiler is configured to use poisoned data (HTML parse and i18n meta errors can be interpreted as a "poisoned" template). fixes angular/vscode-ng-language-service#1140 PR Close #41068
…41068) An opening tag `<` without any characters after it is interperted as a text node (just a "less than" character) rather than the start of an element in the template AST. This commit adjusts the autocomplete engine to provide element autocompletions when the nearest character to the left of the cursor is `<`. Part of the fix for angular/vscode-ng-language-service#1140 PR Close #41068
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. |
Describe the bug
When enabling the Ivy language service, there is no more components / HTML tags completion/suggestions at all.
To Reproduce
Steps to reproduce the behavior:
npm i @angular/cli -g
ng new demo --inline-template
(and say "Yes" to strict mode)cd demo
code .
AppComponent
template: no autocomplete at allng g component demo
<app-de
inAppComponent
template: no autocomplete at all (but if I manually write the full tag, the language service is OK with it)Note: there is the same issue with external templates (in this case you have HTML tags autocomplete because it's a HTML file, but you have no more components tags autocomplete).
Expected behavior
Components / HTML tags should be suggested.
Logs
The log file is empty.
Additional context
VS Code version: 1.53.2
Extension and Angular project version: 11.2.2
OS: macOS 11.2.1 (Intel)
No other extension.
The text was updated successfully, but these errors were encountered: