Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,10 @@
"match": "python",
"contentName": "meta.embedded.inline.python",
"include": "source.python"
},
"glsl": {
"match": "glsl",
"contentName": "meta.embedded.inline.glsl",
"include": "source.glsl"
}
}
1 change: 1 addition & 0 deletions vscode-python-inline-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ at runtime to determine the language that a string has been annotated with.
- `graphql`
- `xml`
- `python`
- `glsl`

## Requirements

Expand Down
8 changes: 8 additions & 0 deletions vscode-python-inline-source/docs/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ def my_function():
</body>
</html>
"""

test_shader: "glsl" = """
#version 330 core
in vec3 position;
void main() {
gl_Position = vec4(position, 1.0);
}
"""
3 changes: 2 additions & 1 deletion vscode-python-inline-source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"meta.embedded.inline.yaml": "yaml",
"meta.embedded.inline.graphql": "graphql",
"meta.embedded.inline.xml": "xml",
"meta.embedded.inline.python": "python"
"meta.embedded.inline.python": "python",
"meta.embedded.inline.glsl": "glsl"
}
}
]
Expand Down
58 changes: 57 additions & 1 deletion vscode-python-inline-source/syntaxes/python-inline-source.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,62 @@
"include": "source.python"
}
]
},
{
"contentName": "meta.embedded.inline.glsl",
"begin": "(:) ?((((\\w+)(\\.))?(glsl|shader))|((\")(glsl|shader)(\"))|((')(glsl|shader)('))) (=) ([bBrRuU]?f?)(\"{3})",
"beginCaptures": {
"1": {
"name": "punctuation.separator.colon.python"
},
"5": {
"name": "source.python"
},
"6": {
"name": "punctuation.separator.period.python"
},
"7": {
"name": "meta.attribute.python"
},
"9": {
"name": "string.quoted.single.python"
},
"10": {
"name": "string.quoted.single.python"
},
"11": {
"name": "string.quoted.single.python"
},
"13": {
"name": "string.quoted.single.python"
},
"14": {
"name": "string.quoted.single.python"
},
"15": {
"name": "string.quoted.single.python"
},
"16": {
"name": "keyword.operator.assignment.python"
},
"17": {
"name": "storage.type.string.python"
},
"18": {
"name": "string.quoted.multi.python"
}
},
"end": "(\"{3})",
"endCaptures": {
"1": {
"name": "string.quoted.multi.python"
}
},
"patterns": [
{
"include": "source.glsl"
}
]
}
]
}
}