Skip to content
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

Support for Angular control flow formatting #198390

Closed
ssougnez opened this issue Nov 16, 2023 · 2 comments
Closed

Support for Angular control flow formatting #198390

ssougnez opened this issue Nov 16, 2023 · 2 comments
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension

Comments

@ssougnez
Copy link

Angular 17 introduced control flow which is a better alternative to *ngIf.
For example, we can now write:

<div>
   @if (condition) {
      <div>...</div>
   } @ else {
      <div>...</div>
   }
</div>

However, by default, Visual Studio Code does not support this new syntax in a sense that the indentation is not correct:

<div>
   @if (condition) {
   <div>...</div>
   } @ else {
   <div>...</div>
   }
</div>

So basically, by default, vscode makes something supposed to be more readable... less readable :-)
A solution is to use extensions such as Prettier, however, this one comes with some many enforced rules that not every developer (myself included) are willing to use it (see angular/angular#52720 (comment)).
Finally, a fair amount of Angular project are developed using vscode, so it would be nice that vscode support indenting this syntax.

@ssougnez
Copy link
Author

Just as I posted this, I got notified about beautifier/js-beautify#2219

If this issue will solve the current one, it can be closed then, sorry :-)

@mjbvz mjbvz added the *caused-by-extension Issue identified to be caused by an extension label Nov 20, 2023
@vscodenpa
Copy link

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. If you don't know which extension is causing the problem, you can run Help: Start extension bisect from the command palette (F1) to help identify the problem extension.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension
Projects
None yet
Development

No branches or pull requests

3 participants