Open leorochael opened 3 years ago
As far as I know, Visual Code is using a parser (based on a regular expressions defined in https://github.com/asciidoctor/asciidoctor-vscode/blob/master/syntaxes/Asciidoctor.json) to do syntax highlighting.
This parser has some limitations because the AsciiDoc syntax can be context-dependent. Having said that it might be possible to fix this particular issue.
If you want to give it a try, here's some documentation about the syntax highlighter in Visual Code: https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
Some time ago we moved to using the same grammar as the Atom language and the process for updating it is documented in Contributing.
However the grammar in the Atom language package hasn't been modified in the last 4 years. Perhaps in future the spec effort will allow a language server approach in future. I think it would still be ideal to upstream the grammar efforts and then synch periodically.
See here for the rationale for changing from what was done previously and a discussion of the grammars available for Asciidoc.
Description
When including code listings delimited by
....
the syntax highlighter gets lost, as can be seen in the screenshot below.According to the Asciidoctor documentation, code blocks delimited by
....
are valid:https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#literals-and-source-code
System Information
AsciiDoc v2.8.9 VS.Code 1.60.0 OS: Linux x64 5.4.0-81-generic
To Reproduce
.txt
extension and leave the.adoc
extension.Screenshots & Files
Sample file demonstrating the problem:
dot-listing-breaks-highlighting.adoc.txt
Screenshot of the broken highlighting:
Additional Context
N/A