Skip to content

Commit

Permalink
(feat) pug syntax highlighting (#371)
Browse files Browse the repository at this point in the history
This provides syntax highlighting, but does not fix any diagnostic errors
#106
  • Loading branch information
dummdidumm authored Jul 27, 2020
1 parent 28d439a commit e84e0e2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/svelte-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,22 @@
"path": "./syntaxes/svelte.tmLanguage.json",
"embeddedLanguages": {
"text.html": "html",
"text.pug": "jade",
"source.css": "css",
"source.css.scss": "scss",
"source.js": "javascript",
"source.ts": "typescript"
}
},
{
"scopeName": "markdown.svelte.codeblock",
"path": "./syntaxes/markdown-svelte.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.svelte": "svelte"
}
"scopeName": "markdown.svelte.codeblock",
"path": "./syntaxes/markdown-svelte.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.svelte": "svelte"
}
}
],
"commands": [
Expand Down
43 changes: 43 additions & 0 deletions packages/svelte-vscode/syntaxes/svelte.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@
"uuid": "7582b62f-51d9-4a84-8c8d-fc189530faf6",

"patterns": [
{
"begin": "(<)(template)\\b(?=[^>]*lang=('jade'|\"jade\"|'pug'|\"pug\"))(?![^/>]*/>\\s*$)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.template.html"
}
},
"end": "(</)(template)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.template.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
},
{
"contentName": "text.pug",
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</template>)",
"patterns": [
{
"include": "text.pug"
}
]
}
]
},
{
"begin": "(<)(style)\\b(?=[^>]*(?:type=('text/sass'|\"text/sass\")|lang=(sass|'sass'|\"sass\")))(?![^/>]*/>\\s*$)",
"beginCaptures": {
Expand Down

0 comments on commit e84e0e2

Please sign in to comment.