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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control Flow syntax highlight curly braces mismatch #1991

Open
1 of 2 tasks
ryanhanwu opened this issue Jan 23, 2024 · 2 comments
Open
1 of 2 tasks

Control Flow syntax highlight curly braces mismatch #1991

ryanhanwu opened this issue Jan 23, 2024 · 2 comments
Labels

Comments

@ryanhanwu
Copy link

馃悶 bug report

Is this a regression?

Don't think so, the Control Flow syntax is new.

Description

When using the Control Flow syntax, the curly braces breaks the syntaxhighlight.

Bug Type

What does this bug affect

  • Angular Language Service VSCode extension
  • Angular Language Service server

Reproduction

  • [After install angular language service VSC extension]
  • Create a new file and change the language mode to html
  • Paste the following html
@if (true) {
    @if (true) {
    {{ variable }}
    } @else {{{ variable2 }}}
}

Expected behavior

The curly braces should be correctly highlighted.

Screenshots

Screenshot 2024-01-23 at 9 25 40鈥疉M

馃實 Your Environment

Angular Version:
N/A

Extension Version:


v17.1.0

VSCode Version:


1.85.1

Operating System:


Mac OS 14.2.1

Extension options:


Default

Thanks!

@ryanhanwu ryanhanwu added the bug label Jan 23, 2024
@kimdah3
Copy link

kimdah3 commented Apr 9, 2024

Same behaviour with a one-liner

@if (true) {{{ variable }}}

image

Adding spaces doesn't show any error and makes more sense

@if (true) { {{ variable }} }

image
Maybe tripple curly brackets (even though it's not especially readable) coming after the new control flow shouldn't show up as red at all?

@atscott
Copy link
Collaborator

atscott commented Apr 9, 2024

Maybe tripple curly brackets (even though it's not especially readable) coming after the new control flow shouldn't show up as red at all?

It's not that triple curly is intentionally red. It's that {{ is immediately captured as a binding, the first }} is then the end of the binding and then the extra { and } are mismatched. Texmate scopes work off of regex capturing so the solution isn't necessarily simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants