forked from OSchip/llvm-project
[mlir-vscode] Add support for highlighting pdll and tablegen markdown code blocks
This essentially just piggy backs off of the existing mlir support. Differential Revision: https://reviews.llvm.org/D125734
This commit is contained in:
parent
bdd0093f4d
commit
d6708b7419
|
@ -4,6 +4,12 @@
|
|||
"patterns": [
|
||||
{
|
||||
"include": "#mlir-code-block"
|
||||
},
|
||||
{
|
||||
"include": "#pdll-code-block"
|
||||
},
|
||||
{
|
||||
"include": "#tablegen-code-block"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
|
@ -39,6 +45,72 @@
|
|||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"pdll-code-block": {
|
||||
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(pdll)(\\s+[^`~]*)?$)",
|
||||
"name": "markup.fenced_code.block.markdown",
|
||||
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
|
||||
"beginCaptures": {
|
||||
"3": {
|
||||
"name": "punctuation.definition.markdown"
|
||||
},
|
||||
"4": {
|
||||
"name": "fenced_code.block.language.markdown"
|
||||
},
|
||||
"5": {
|
||||
"name": "fenced_code.block.language.attributes.markdown"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"3": {
|
||||
"name": "punctuation.definition.markdown"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(^|\\G)(\\s*)(.*)",
|
||||
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
|
||||
"contentName": "meta.embedded.block.pdll",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.pdll"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"tablegen-code-block": {
|
||||
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(tablegen)(\\s+[^`~]*)?$)",
|
||||
"name": "markup.fenced_code.block.markdown",
|
||||
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
|
||||
"beginCaptures": {
|
||||
"3": {
|
||||
"name": "punctuation.definition.markdown"
|
||||
},
|
||||
"4": {
|
||||
"name": "fenced_code.block.language.markdown"
|
||||
},
|
||||
"5": {
|
||||
"name": "fenced_code.block.language.attributes.markdown"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"3": {
|
||||
"name": "punctuation.definition.markdown"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(^|\\G)(\\s*)(.*)",
|
||||
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
|
||||
"contentName": "meta.embedded.block.tablegen",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.tablegen"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "markdown.mlir.codeblock"
|
||||
|
|
|
@ -106,7 +106,9 @@
|
|||
"text.html.markdown"
|
||||
],
|
||||
"embeddedLanguages": {
|
||||
"meta.embedded.block.mlir": "mlir"
|
||||
"meta.embedded.block.mlir": "mlir",
|
||||
"meta.embedded.block.pdll": "pdll",
|
||||
"meta.embedded.block.tablegen": "tablegen"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue