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

Syntax highlighting messes up when expressions contain } #2056

Closed
DanTup opened this issue Oct 17, 2019 · 3 comments
Closed

Syntax highlighting messes up when expressions contain } #2056

DanTup opened this issue Oct 17, 2019 · 3 comments
Labels
in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Oct 17, 2019

void foo(String a) {
  print('${'test}test'}');
}

This would print the string test}test, but the } is messing up the syntax highlighting:

Screenshot 2019-10-17 at 9 42 19 am

@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Jun 1, 2020
@DanTup DanTup added this to the On Deck milestone Oct 1, 2020
@DanTup DanTup added the is bug label Nov 5, 2020
@DanTup
Copy link
Member Author

DanTup commented Jan 26, 2021

This is slightly better with LSP semantic tokens, but not entirely fixed:

Screenshot 2021-01-26 at 15 52 08

The fix may be to remove any interpolated string expressions once Dart/Flutter stable channels fully support semantic tokens.

@DanTup DanTup modified the milestones: On Deck, v3.25.0 Jun 28, 2021
@DanTup
Copy link
Member Author

DanTup commented Jul 19, 2021

With d4d5fe8 , the interpolated expressions use the other parts of the grammar to parse so that strings are parsed correctly, rather than just looking for the next }.

Screenshot 2021-07-19 at 14 35 09

DanTup added a commit to DanTup/dart-syntax-highlight that referenced this issue Jul 19, 2021
@DanTup DanTup closed this as completed in 2213a21 Jul 19, 2021
@DanTup
Copy link
Member Author

DanTup commented Jul 19, 2021

PR to update the shared grammar is here:

dart-lang/dart-syntax-highlight#19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

1 participant