Closed xiaoxuan-yu closed 4 months ago
This is implemented but introduces bug so I disabled it.
https://github.com/Myriad-Dreamin/tinymist/blob/main/syntaxes/textmate/fenced.ts
The case of bug, when your code in raw block has grammar errors, the highlighting after the raw block will be messy:
The document ```c++
class BuggyCxxCode
``` will be messy.
/// vscode continues parsing c++ grammar after the block
class is hightlighted.
I wonder how markdown deals with this
Would the Embedded languages - Syntax Highlight Guide be helpful?
@Enter-tainer VSCode's markdown syntax is located here and looks like
And I see many embedded langauge projects follow the same pattern, say Vue
not sure why the link preview don't work here :(
The regex tricks from markdown.tmLanguage don't help us, since it cause false highlighting in some cases. Regarding to having semantic highlighting, we would like to make syntax highlighting work only if it is 100% correct. Concludingly, I adapt the rules from vue.tmLanguage and generate all rules to cover cases when the ticks of fence is less or equals to 6.
Failure explanation, the following begin/while pattern usually fails:
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.cpp source.cpp",
"patterns": [
{
"include": "source.cpp"
}
]
}
The above rules don't exactly match fences ([`~]{3,})
(if I read it correctly), sometimes causing messy highlighting.
Describe the bug When try to use tinymist in my project, I found the code in raw block is not highlighted. By inspecting editor token and scope, the results shows only typst.
Package/Software version: VSCode version(Help -> About):
tinymist extension version:
v0.11.0
. Get it bytinymist --version
in terminal.Is that a unimplemented feature or a bug?