From 44f80772b0a14b86c03b2fcb7133817655899aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Attali?= Date: Mon, 23 Sep 2019 15:29:18 +0200 Subject: [PATCH] update .env extension names and tmLanguage file --- .vscode/launch.json | 6 +- package.json | 37 ++-- syntaxes/env.YAML-tmLanguage | 19 +- syntaxes/env.tmLanguage | 396 ++++++++++++++++++----------------- 4 files changed, 246 insertions(+), 212 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8384213..7ffcb20 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,9 @@ "type": "extensionHost", "request": "launch", "runtimeExecutable": "${execPath}", - "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] + "args": [ + "--extensionDevelopmentPath=${workspaceRoot}" + ] } ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index d618759..7ae48cd 100644 --- a/package.json +++ b/package.json @@ -34,27 +34,34 @@ "env" ], "extensions": [ - ".env", ".env-sample", - ".env.example", - ".env.local", - ".env.dev", ".env.dev.local", - ".env.development", + ".env.dev", ".env.development.local", - ".env.test", - ".env.test.local", - ".env.testing", - ".env.qa", + ".env.development", + ".env.dist", + ".env.dusk.local", + ".env.example", + ".env.local", + ".env.prod.local", + ".env.prod", + ".env.production.local", + ".env.production", ".env.qa.local", - ".env.uat", - ".env.uat.local", - ".env.stag", + ".env.qa", + ".env.sample", ".env.stag.local", - ".env.staging", + ".env.stag", ".env.staging.local", - ".env.production", - ".env.production.local" + ".env.staging", + ".env.test.local", + ".env.test", + ".env.testing", + ".env.uat.local", + ".env.uat", + ".env", + ".envrc", + ".flaskenv" ], "configuration": "./language-configuration.json" } diff --git a/syntaxes/env.YAML-tmLanguage b/syntaxes/env.YAML-tmLanguage index aa11ec6..9db9966 100644 --- a/syntaxes/env.YAML-tmLanguage +++ b/syntaxes/env.YAML-tmLanguage @@ -2,7 +2,24 @@ --- name: DotENV scopeName: source.env -fileTypes: [".env", ".env-sample", ".env.example", ".env.local", ".env.dev", ".env.test", ".env.testing", ".env.production"] +fileTypes: [ + ".env", + ".envrc", + ".env.dist", + ".env.local", + ".env.sample", + ".env.example", + ".env.test", + ".env.test.local", + ".env.dev", + ".env.development", + ".env.development.local", + ".env.prod", + ".env.production", + ".env.production.local", + ".env.dusk.local", + ".flaskenv" +] uuid: 09d4e117-0975-453d-a74b-c2e525473f97 patterns: diff --git a/syntaxes/env.tmLanguage b/syntaxes/env.tmLanguage index a5d2a80..5e19094 100644 --- a/syntaxes/env.tmLanguage +++ b/syntaxes/env.tmLanguage @@ -1,232 +1,240 @@ - - name - DotENV - scopeName - source.env - fileTypes - - .env - .env-sample - .env.example - .env.local - .env.dev - .env.test - .env.testing - .env.production - - uuid - 09d4e117-0975-453d-a74b-c2e525473f97 - patterns - + + fileTypes + + .env + .envrc + .env.dist + .env.local + .env.sample + .env.example + .env.test + .env.test.local + .env.dev + .env.development + .env.development.local + .env.prod + .env.production + .env.production.local + .env.dusk.local + .flaskenv + + name + DotENV + patterns + + + captures - comment - Comments - starts with # - match - (#).*$\n? - name - comment.line.number-sign.env - captures + 1 - 1 - - name - punctuation.definition.comment.env - + name + punctuation.definition.comment.env + comment + Comments - starts with # + match + (#).*$\n? + name + comment.line.number-sign.env + + + begin + (\") + beginCaptures - comment - Strings (double) - name - string.quoted.double.env - begin - (\") - beginCaptures + 1 - 1 - - name - punctuation.definition.string.begin.env - + name + punctuation.definition.string.begin.env - patterns - - - include - #interpolation - - - include - #variable - - - include - #escape-characters - - - end - (\") - endCaptures + + comment + Strings (double) + end + (\") + endCaptures + + 1 - 1 - - name - punctuation.definition.string.end - + name + punctuation.definition.string.end - - comment - Strings (single) - name - string.quoted.single.env - begin - (\') - beginCaptures + name + string.quoted.double.env + patterns + - 1 - - name - punctuation.definition.string.begin.env - + include + #interpolation - end - (\') - endCaptures - 1 - - name - punctuation.definition.string.end - + include + #variable - - - comment - Assignment Operator - match - (?<=[\w])\s?= - name - keyword.operator.assignment.env - - - comment - Variable - match - ([\w]+)(?=\s?\=) - name - variable.other.env - + + include + #escape-characters + + + + + begin + (\') + beginCaptures - comment - Keywords - match - (?i)\s?(export) - name - keyword.other.env + 1 + + name + punctuation.definition.string.begin.env + + comment + Strings (single) + end + (\') + endCaptures - comment - Constants - match - (?i)(?<=\=)\s?(true|false|null) - name - constant.language.env + 1 + + name + punctuation.definition.string.end + + name + string.quoted.single.env + + + comment + Assignment Operator + match + (?<=[\w])\s?= + name + keyword.operator.assignment.env + + + comment + Variable + match + ([\w]+)(?=\s?\=) + name + variable.other.env + + + comment + Keywords + match + (?i)\s?(export) + name + keyword.other.env + + + comment + Constants + match + (?i)(?<=\=)\s?(true|false|null) + name + constant.language.env + + + comment + Numeric + match + \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b + name + constant.numeric.env + + + repository + + escape-characters + + patterns + + + match + \\[nrt\\\$\"\'] + name + constant.character.escape.env + + + + interpolation + + begin + (\$\{|\{) + beginCaptures - comment - Numeric - match - \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b - name - constant.numeric.env + 1 + + name + string.interpolated.env keyword.other.template.begin.env + - - repository - - interpolation + comment + Template Syntax: "foo ${bar} {$baz}" + end + (\}) + endCaptures - comment - Template Syntax: "foo ${bar} {$baz}" - begin - (\$\{|\{) - beginCaptures + 1 - 1 - - name - string.interpolated.env keyword.other.template.begin.env - + name + string.interpolated.env keyword.other.template.end.env - patterns - + + patterns + + + captures - match - (?x)(\$+)?([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b) - captures + 1 - 1 - - name - punctuation.definition.variable.env variable.other.env - - 2 - - name - variable.other.env - + name + punctuation.definition.variable.env variable.other.env + + 2 + + name + variable.other.env - - end - (\}) - endCaptures - - 1 - - name - string.interpolated.env keyword.other.template.end.env - + match + (?x)(\$+)?([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b) - - variable - - patterns - + + + variable + + patterns + + + captures - match - (?x)(\$+)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b) - captures + 1 - 1 - - name - punctuation.definition.variable.env variable.other.env - - 2 - - name - variable.other.env - + name + punctuation.definition.variable.env variable.other.env + + 2 + + name + variable.other.env - - - escape-characters - - patterns - - - match - \\[nrt\\\$\"\'] - name - constant.character.escape.env - - - + match + (?x)(\$+)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b) + + + scopeName + source.env + uuid + 09d4e117-0975-453d-a74b-c2e525473f97 +