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 c7f4deb..16ac7c7 100644 --- a/package.json +++ b/package.json @@ -34,36 +34,40 @@ "env" ], "extensions": [ - ".flaskenv", - ".env", ".env-sample", - ".env.example", - ".env.local", - ".env.dev", - ".env.dev.local", - ".env.build", ".env.build.local", - ".env.development", + ".env.build", + ".env.dev.local", + ".env.dev", ".env.development.local", - ".env.test", - ".env.test.local", - ".env.testing", - ".env.qa", + ".env.development", + ".env.dist", + ".env.dusk.local", + ".env.example", + ".env.live.local", + ".env.live", + ".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.stage", + ".env.stag", ".env.stage.local", - ".env.staging", + ".env.stage", ".env.staging.local", - ".env.live", - ".env.live.local", - ".env.production", - ".env.production.local", - ".env.prod", - ".env.prod.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 de83306..7c7d88e 100644 --- a/syntaxes/env.YAML-tmLanguage +++ b/syntaxes/env.YAML-tmLanguage @@ -1,8 +1,28 @@ -# [PackageDev] target_format: plist, ext: tmLanguage +# [PackageDev] target_format: plist, +ext: tmLanguage --- name: DotENV scopeName: source.env -fileTypes: [".env", ".env-sample", ".env.example", ".env.local", ".env.dev", ".env.test", ".env.testing", ".env.production", ".env.prod"] +fileTypes: [ + ".env-sample", + ".env.dev", + ".env.development.local", + ".env.development", + ".env.dist", + ".env.dusk.local", + ".env.example", + ".env.local", + ".env.prod", + ".env.production.local", + ".env.production", + ".env.sample", + ".env.test.local", + ".env.test", + ".env.testing", + ".env", + ".envrc", + ".flaskenv" +] uuid: 09d4e117-0975-453d-a74b-c2e525473f97 patterns: diff --git a/syntaxes/env.tmLanguage b/syntaxes/env.tmLanguage index 59c57ff..0571ad3 100644 --- a/syntaxes/env.tmLanguage +++ b/syntaxes/env.tmLanguage @@ -1,233 +1,242 @@ - - name - DotENV - scopeName - source.env - fileTypes - - .env - .env-sample - .env.example - .env.local - .env.dev - .env.test - .env.testing - .env.production - .env.prod - - uuid - 09d4e117-0975-453d-a74b-c2e525473f97 - patterns - + + fileTypes + + .env-sample + .env.dev + .env.development.local + .env.development + .env.dist + .env.dusk.local + .env.example + .env.local + .env.prod + .env.production.local + .env.production + .env.sample + .env.test.local + .env.test + .env.testing + .env + .envrc + .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 +