diff options
Diffstat (limited to 'editors/vscode/syntaxes')
| -rw-r--r-- | editors/vscode/syntaxes/odin.tmLanguage.json | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/editors/vscode/syntaxes/odin.tmLanguage.json b/editors/vscode/syntaxes/odin.tmLanguage.json index bd41c02..b3d5886 100644 --- a/editors/vscode/syntaxes/odin.tmLanguage.json +++ b/editors/vscode/syntaxes/odin.tmLanguage.json @@ -4,6 +4,7 @@ "name": "Odin", "patterns": [ { "include": "#package-name-declaration" }, + { "include": "#import-declaration" }, { "include": "#statements" } ], "repository": { @@ -217,6 +218,32 @@ "2": { "name": "entity.name.type.module.odin" } } }, + "import-declaration": { + "name": "meta.import.odin", + "begin": "\\b(import|foreign\\s+import)\\b", + "beginCaptures": {"0": {"name": "keyword.control.import.odin"}}, + "end": "(?=^|;)", + "patterns": [ + { "name": "string.import.odin", + "match": "([\"`])([\\w\\.]*[/:])*([A-Za-z_]\\w*)([\"`])", + "captures": { + "1": {"name": "punctuation.definition.string.begin.odin"}, + "3": {"name": "entity.name.namespace.odin"}, + "4": {"name": "punctuation.definition.string.end.odin"} + } + }, + { "name": "entity.name.alias.odin", + "begin": "\\b[A-Za-z_]\\w*", + "beginCaptures": {"0": {"name": "entity.name.namespace.odin"}}, + "end": "(?=^|;)", + "patterns": [ + { "include": "#strings" }, + { "include": "#comments" } + ] + }, + { "include": "#comments" } + ] + }, "map-bitset": { "begin": "\\b(bit_set|map)\\b", "beginCaptures": { "0": { "name": "storage.type.odin" } }, |