question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text block breaks syntax highlighting if an odd number (>=3) of double quotes appear inside the text block

See original GitHub issue

As 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
  1. 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. image

Expected Result

Syntax highlighting is correct.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pangoleafcommented, Oct 25, 2022

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.

0reactions
Eskibearcommented, May 23, 2022

(originally reported by @jflorez-planittesting)

Environment:

  • VS Code Version: 1.67.0
  • Java Extension Pack Version: 0.22.4
  • JDK Type & Version: openjdk version “17.0.2” 2022-01-18
  • OS Type & Version: macos 12.3.1 (21E258)

Step to Reproduce: create a text block with a json inside it, add a http URL to a JSON value image

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found