Correctly highlight @example code as js/ts

Fixes #64382
This commit is contained in:
Matt Bierner 2018-12-04 14:05:48 -08:00
parent a57b55f610
commit 89921928d0
2 changed files with 39 additions and 0 deletions

View file

@ -87,6 +87,16 @@
"source.js",
"source.js.jsx"
]
},
{
"scopeName": "documentation.example.injection",
"path": "./syntaxes/ExampleJsDoc.injection.tmLanguage.json",
"injectTo": [
"source.ts",
"source.tsx",
"source.js",
"source.js.jsx"
]
}
],
"snippets": [

View file

@ -0,0 +1,29 @@
{
"injectionSelector": "L:comment.block.documentation",
"patterns": [
{
"include": "#example"
}
],
"repository": {
"example": {
"begin": "((@)example)\\s+",
"while": "(^|\\G)\\s(?!@)",
"beginCaptures": {
"1": {
"name": "storage.type.class.jsdoc"
},
"2": {
"name": "punctuation.definition.block.tag.jsdoc"
}
},
"contentName": "meta.embedded.block.example.source.ts",
"patterns": [
{
"include": "source.tsx"
}
]
}
},
"scopeName": "documentation.example.injection"
}