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

Consider using a new Java grammar: Text block(JEP 378) breaks Java syntax highlighting #167913

Closed
tzengshinfu opened this issue Dec 2, 2022 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality grammar Syntax highlighting grammar

Comments

@tzengshinfu
Copy link

tzengshinfu commented Dec 2, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.73.1
  • OS Version: Windows 10 22H2 19045.2251

Steps to Reproduce:

Create a Java file with a text block that contains double quotes.
img-20221202-165011

Current Result
Notice the codes after text block are fully orange.

Expected Result
Syntax highlighting is correct.

Workaround
Add an escape character in each double quote.
img-20221202-184608

@RedCMD
Copy link
Contributor

RedCMD commented Dec 2, 2022

The current syntax highlighter doesn't support java Text Blocks
prob should report to https://github.com/atom/language-java

@alexr00 alexr00 changed the title Text block(JEP 378) breaks Java syntax highlighting Consider using a new Java grammar: Text block(JEP 378) breaks Java syntax highlighting Dec 5, 2022
@alexr00 alexr00 added feature-request Request for new features or functionality grammar Syntax highlighting grammar labels Dec 5, 2022
@alexr00 alexr00 added this to the Backlog milestone Dec 5, 2022
@alexr00
Copy link
Member

alexr00 commented Dec 5, 2022

Given that https://github.com/atom/language-java will be archived, I'm repurposing this issue for considering a new Java grammar.

@alexr00
Copy link
Member

alexr00 commented Dec 5, 2022

Possibly a good candidate grammar: https://github.com/georgewfraser/java-language-server

@RedCMD
Copy link
Contributor

RedCMD commented Dec 5, 2022

@alexr00 but that repo doesn't have textmate syntax highlighting??

@alexr00
Copy link
Member

alexr00 commented Dec 6, 2022

They do have a grammar though: https://github.com/georgewfraser/java-language-server/blob/master/lib/java.tmLanguage.json

I haven't checked whether it would be an improvement.

@alexr00
Copy link
Member

alexr00 commented Jul 13, 2023

The grammar from https://github.com/georgewfraser/java-language-server doesn't highlight as much, so it's not a good option:

image

@alexr00
Copy link
Member

alexr00 commented Dec 13, 2023

New grammar was adopted with #188361

@alexr00 alexr00 closed this as completed Dec 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

5 participants