Skip to content

Commit

Permalink
chore: add glimmer js/ts markdown language injects
Browse files Browse the repository at this point in the history
feat: add glimmer js/ts markdown language injects
  • Loading branch information
lifeart authored Jan 25, 2024
2 parents e45d89e + 3520507 commit fcd9712
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
"hbs"
],
"configuration": "./languages/handlebars.configuration.json"
},
{
"id": "markdown-gjs"
},
{
"id": "markdown-gts"
}
],
"grammars": [
Expand Down Expand Up @@ -152,6 +158,28 @@
"embeddedLanguages": {
"meta.embedded.block.html": "handlebars"
}
},
{
"language": "markdown-gjs",
"scopeName": "markdown.gjs.codeblock",
"path": "./syntaxes/markdown-gjs.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.gjs": "glimmer-js"
}
},
{
"language": "markdown-gts",
"scopeName": "markdown.gts.codeblock",
"path": "./syntaxes/markdown-gts.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.gts": "glimmer-ts"
}
}
],
"typescriptServerPlugins": [
Expand Down
45 changes: 45 additions & 0 deletions syntaxes/markdown-gjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"fileTypes": [],
"injectionSelector": "L:text.html.markdown",
"patterns": [
{
"include": "#gjs-code-block"
}
],
"repository": {
"gjs-code-block": {
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(gjs)(\\s+[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.gjs",
"patterns": [
{
"include": "source.gjs"
}
]
}
]
}
},
"scopeName": "markdown.gjs.codeblock"
}
45 changes: 45 additions & 0 deletions syntaxes/markdown-gts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"fileTypes": [],
"injectionSelector": "L:text.html.markdown",
"patterns": [
{
"include": "#gts-code-block"
}
],
"repository": {
"gts-code-block": {
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(gts)(\\s+[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.gts",
"patterns": [
{
"include": "source.gts"
}
]
}
]
}
},
"scopeName": "markdown.gts.codeblock"
}

0 comments on commit fcd9712

Please sign in to comment.