mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-25 05:23:12 +00:00
[editors/code] add markdown syntax highlighting to doc comments
This commit is contained in:
parent
a04d8456be
commit
09f624721c
2 changed files with 46 additions and 0 deletions
|
|
@ -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": [
|
||||
|
|
|
|||
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…
Add table
Add a link
Reference in a new issue