Text block breaks syntax highlighting if an odd number (>=3) of double quotes appear inside the text block
See original GitHub issueAs soon as a text block contains an odd number (>=3) of double quotes, the rest of the file is colored as if it were part of the text block (but there’s no compilation errors & things like autocompletion etc. work, it’s just syntax highlighting that breaks).
Environment
- Operating System: Windows 10
- JDK version: 13.0.1
- Visual Studio Code version: 1.42.0
- Java extension version: 0.55.1
Steps To Reproduce
- Create a Java file with a text block that contains 3 double quotes, e.g.
class Foo {
private static final String BAR = """
1"
2"
3"
""";
private static void baz() {}
}
Current Result
Notice how the baz
method etc. are fully orange.
Expected Result
Syntax highlighting is correct.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Quoted text inline with the rest using code tags is bad. Why?
(b) looks the same (there's no syntax highlighting in inline-code. ... In StackOverflow, the formatting of the block quote essentially acts as this...
Read more >Handling content breaks in multi-column layout - CSS
To control breaks inside boxes use the break-inside property. This property takes values of: auto.
Read more >Code Blocks with Syntax Highlighting | by Alex Benzer - Blog
In the web-based story editor, when you click the + button, you will now see an updated toolbar. You can click the “{...
Read more >How to copy multi-line text from Excel without quotes?
You can get around this by highlighting the cell and then copy and pasting the code directly out of the text bar at...
Read more >How to turn off syntax highlighting in indented portion of block ...
Code fences with a directive not to format the text appears to be exactly what you're looking for: > ```lang-none > 3.1) How...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just come across the same issue as with the post by @Eskibear above.
I think, if possible, at a basic level all double quotes inside triple quotes blocks should be treated as automatically escaped as that’s how the compiler sees it.
(originally reported by @jflorez-planittesting)
Environment:
Step to Reproduce: create a text block with a json inside it, add a http URL to a JSON value
Expected Behavior: Syntax highlighting is unaffected
Actual Behavior: Syntax highlighting inside the text block and in subsequent Java code is altered and colours deviate from the configured theme