mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-15 13:52:59 +00:00
[editors/code] add markdown syntax highlighting to doc comments
This commit is contained in:
parent
a04d8456be
commit
09f624721c
@ -1562,6 +1562,16 @@
|
|||||||
"language": "ra_syntax_tree",
|
"language": "ra_syntax_tree",
|
||||||
"scopeName": "source.ra_syntax_tree",
|
"scopeName": "source.ra_syntax_tree",
|
||||||
"path": "ra_syntax_tree.tmGrammar.json"
|
"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": [
|
"problemMatchers": [
|
||||||
|
|||||||
36
editors/code/rustdoc.markdown.injection.tmGrammar.json
Normal file
36
editors/code/rustdoc.markdown.injection.tmGrammar.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user