asciidoctor-vscode icon indicating copy to clipboard operation
asciidoctor-vscode copied to clipboard

syntax highlighting bug with unix shell code sections such as [source,bash]

Open 4a-42 opened this issue 2 years ago • 2 comments
trafficstars

unterminated if statements with shell syntax seem to break syntax highlighting in the VSCode text editor. It doesn't affect the preview though, just the text editor. It seems to affect unix shell languages: bash, sh, shell.

I don't know whether other keywords affect this too.

[source,bash]
----
if
----

Example: image

4a-42 avatar Jan 05 '23 17:01 4a-42

Unterminated quotes also replicate the bug:

[source,bash]
----
'
----

image

4a-42 avatar Jan 05 '23 17:01 4a-42

We currently rely on TextMate grammars but it's too limiting/bug prone. Instead, we should migrate to semantic highlighting: https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide or LSP: https://code.visualstudio.com/api/language-extensions/language-server-extension-guide

If someone wants to give it a try, please feel free to do so!

ggrossetie avatar Jan 10 '23 22:01 ggrossetie