Skip to content

Commit

Permalink
feat: add python syntax highlighting (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
monotykamary committed Aug 23, 2024
1 parent 7dded30 commit 9d42c7a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"source.ts",
"source.jsx",
"source.tsx",
"source.go"
"source.go",
"source.python"
],
"scopeName": "inline.aql",
"path": "./syntaxes/inline-aql.json",
Expand Down
49 changes: 36 additions & 13 deletions syntaxes/inline-aql.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"jsx",
"ts",
"tsx",
"go"
"go",
"py"
],
"injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.go -comment -string",
"injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.go -comment -string, L:source.python",
"injections": {
"L:source": {
"patterns": [
Expand All @@ -27,9 +28,6 @@
}
},
"patterns": [
{
"include": "source.ts#template-substitution-element"
},
{
"include": "source.aql"
}
Expand All @@ -44,9 +42,6 @@
},
"end": "(`)",
"patterns": [
{
"include": "source.ts#template-substitution-element"
},
{
"include": "source.aql"
}
Expand All @@ -65,9 +60,6 @@
"begin": "^\\t?\\s?(`)$",
"end": "^\\t?\\s?(`)",
"patterns": [
{
"include": "source.ts#template-substitution-element"
},
{
"include": "source.aql"
}
Expand All @@ -90,10 +82,41 @@
},
"patterns": [
{
"include": "source.ts#template-substitution-element"
"include": "source.aql"
}
]
},
{
"begin": "^(#\\s*aql)\\s*$",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.python"
}
},
"end": "(?<='''|\"\"\")",
"patterns": [
{
"begin": "('''|\"\"\")\\s*$",
"beginCaptures": {
"1": {
"name": "string.quoted.multi.python"
}
},
"end": "('''|\"\"\")",
"endCaptures": {
"1": {
"name": "string.quoted.multi.python"
}
},
"contentName": "meta.embedded.block.aql",
"patterns": [
{
"include": "source.aql"
}
]
},
{
"include": "source.js"
"include": "source.python"
}
]
}
Expand Down

0 comments on commit 9d42c7a

Please sign in to comment.