asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
340 stars 97 forks source link

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

Open 4a-42 opened 1 year ago

4a-42 commented 1 year ago

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 commented 1 year ago

Unterminated quotes also replicate the bug:

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

image

ggrossetie commented 1 year ago

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!