diff --git a/languages.json b/languages.json index e531c00..e9e481c 100644 --- a/languages.json +++ b/languages.json @@ -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" } } \ No newline at end of file diff --git a/vscode-python-inline-source/README.md b/vscode-python-inline-source/README.md index 24b1ecb..38b116e 100644 --- a/vscode-python-inline-source/README.md +++ b/vscode-python-inline-source/README.md @@ -80,6 +80,7 @@ at runtime to determine the language that a string has been annotated with. - `graphql` - `xml` - `python` +- `glsl` ## Requirements diff --git a/vscode-python-inline-source/docs/examples.py b/vscode-python-inline-source/docs/examples.py index 12447fb..c4bce60 100644 --- a/vscode-python-inline-source/docs/examples.py +++ b/vscode-python-inline-source/docs/examples.py @@ -67,3 +67,11 @@ def my_function(): """ + +test_shader: "glsl" = """ +#version 330 core +in vec3 position; +void main() { + gl_Position = vec4(position, 1.0); +} +""" \ No newline at end of file diff --git a/vscode-python-inline-source/package.json b/vscode-python-inline-source/package.json index 7030117..a7e6eda 100644 --- a/vscode-python-inline-source/package.json +++ b/vscode-python-inline-source/package.json @@ -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" } } ] diff --git a/vscode-python-inline-source/syntaxes/python-inline-source.json b/vscode-python-inline-source/syntaxes/python-inline-source.json index 399ed70..cd973b3 100644 --- a/vscode-python-inline-source/syntaxes/python-inline-source.json +++ b/vscode-python-inline-source/syntaxes/python-inline-source.json @@ -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" + } + ] } ] -} \ No newline at end of file +}