[editors/code] add markdown syntax highlighting to doc comments

This commit is contained in:
Andreas Backx 2023-05-21 16:25:47 +01:00
parent a04d8456be
commit 09f624721c
No known key found for this signature in database
2 changed files with 46 additions and 0 deletions

View File

@ -1562,6 +1562,16 @@
"language": "ra_syntax_tree",
"scopeName": "source.ra_syntax_tree",
"path": "ra_syntax_tree.tmGrammar.json"
},
{
"scopeName": "rustdoc.markdown.injection",
"path": "rustdoc.markdown.injection.tmGrammar.json",
"injectTo": [
"source.rust"
],
"embeddedLanguages": {
"meta.embedded.block.markdown": "text.html.markdown"
}
}
],
"problemMatchers": [

View File

@ -0,0 +1,36 @@
{
"scopeName": "rustdoc.markdown.injection",
"injectionSelector": "L:source.rust",
"patterns": [
{
"include": "#doc-comment-line"
},
{
"include": "#doc-comment-block"
}
],
"repository": {
"doc-comment-line": {
"name": "comment.line.documentation.rust",
"begin": "^\\s*//(/|!)",
"while": "^\\s*//(/|!)",
"contentName": "meta.embedded.block.markdown",
"patterns": [
{
"include": "text.html.markdown"
}
]
},
"doc-comment-block": {
"name": "comment.block.documentation.rust",
"begin": "/\\*(\\*|!)",
"end": "\\s*\\*/",
"contentName": "meta.embedded.block.markdown",
"patterns": [
{
"include": "text.html.markdown"
}
]
}
}
}