Skip to content

Commit 09f6247

Browse files
committed
[editors/code] add markdown syntax highlighting to doc comments
1 parent a04d845 commit 09f6247

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

editors/code/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,16 @@
15621562
"language": "ra_syntax_tree",
15631563
"scopeName": "source.ra_syntax_tree",
15641564
"path": "ra_syntax_tree.tmGrammar.json"
1565+
},
1566+
{
1567+
"scopeName": "rustdoc.markdown.injection",
1568+
"path": "rustdoc.markdown.injection.tmGrammar.json",
1569+
"injectTo": [
1570+
"source.rust"
1571+
],
1572+
"embeddedLanguages": {
1573+
"meta.embedded.block.markdown": "text.html.markdown"
1574+
}
15651575
}
15661576
],
15671577
"problemMatchers": [
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"scopeName": "rustdoc.markdown.injection",
3+
"injectionSelector": "L:source.rust",
4+
"patterns": [
5+
{
6+
"include": "#doc-comment-line"
7+
},
8+
{
9+
"include": "#doc-comment-block"
10+
}
11+
],
12+
"repository": {
13+
"doc-comment-line": {
14+
"name": "comment.line.documentation.rust",
15+
"begin": "^\\s*//(/|!)",
16+
"while": "^\\s*//(/|!)",
17+
"contentName": "meta.embedded.block.markdown",
18+
"patterns": [
19+
{
20+
"include": "text.html.markdown"
21+
}
22+
]
23+
},
24+
"doc-comment-block": {
25+
"name": "comment.block.documentation.rust",
26+
"begin": "/\\*(\\*|!)",
27+
"end": "\\s*\\*/",
28+
"contentName": "meta.embedded.block.markdown",
29+
"patterns": [
30+
{
31+
"include": "text.html.markdown"
32+
}
33+
]
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)