diff --git a/syntaxes/rust.tmLanguage.json b/syntaxes/rust.tmLanguage.json index 97e8abe..900648e 100644 --- a/syntaxes/rust.tmLanguage.json +++ b/syntaxes/rust.tmLanguage.json @@ -298,7 +298,14 @@ { "comment": "documentation comments", "name": "comment.line.documentation.rust", - "match": "^\\s*///.*" + "begin": "^\\s*//(/|!)", + "while": "^\\s*//(/|!)", + "contentName": "meta.embedded.block.markdown", + "patterns": [ + { + "include": "text.html.markdown" + } + ] }, { "comment": "line comments", @@ -317,11 +324,15 @@ { "comment": "block documentation comments", "name": "comment.block.documentation.rust", - "begin": "/\\*\\*", - "end": "\\*/", + "begin": "/\\*(\\*|!)", + "end": "\\s*\\*/", + "contentName": "meta.embedded.block.markdown", "patterns": [ { "include": "#block-comments" + }, + { + "include": "text.html.markdown" } ] }, @@ -1165,4 +1176,4 @@ ] } } -} \ No newline at end of file +} diff --git a/syntaxes/rust.tmLanguage.yml b/syntaxes/rust.tmLanguage.yml index 4ce86d8..1ce2bf0 100644 --- a/syntaxes/rust.tmLanguage.yml +++ b/syntaxes/rust.tmLanguage.yml @@ -160,7 +160,11 @@ repository: - comment: documentation comments name: comment.line.documentation.rust - match: ^\s*///.* + begin: ^\\s*//(/|!) + while: ^\\s*//(/|!) + contentName: meta.embedded.block.markdown + patterns: + - include: text.html.markdown - comment: line comments name: comment.line.double-slash.rust @@ -174,10 +178,12 @@ repository: - comment: block documentation comments name: comment.block.documentation.rust - begin: /\*\* - end: \*/ + begin: /\\*(\\*|!) + end: \\s*\\*/ + contentName: meta.embedded.block.markdown patterns: - include: '#block-comments' + - include: text.html.markdown - comment: block comments name: comment.block.rust