diff --git a/.bumpy/fix-vscode-url-fragment-highlighting.md b/.bumpy/fix-vscode-url-fragment-highlighting.md new file mode 100644 index 000000000..514681520 --- /dev/null +++ b/.bumpy/fix-vscode-url-fragment-highlighting.md @@ -0,0 +1,6 @@ +--- +env-spec-language: patch +"@env-spec/parser": patch +--- + +Fixed URL fragments in @docs() decorator not being highlighted correctly. diff --git a/packages/env-spec-parser/README.md b/packages/env-spec-parser/README.md index 3c373f238..9c0ed0f78 100644 --- a/packages/env-spec-parser/README.md +++ b/packages/env-spec-parser/README.md @@ -10,7 +10,7 @@ _Here is a short illustrative example:_ ```dotenv # Stripe secret api key # @required @sensitive @type=string(startsWith="sk_") -# @docsUrl=https://docs.stripe.com/keys +# @docs(https://docs.stripe.com/keys) STRIPE_SECRET_KEY=encrypted("asdfqwerqwe2374298374lksdjflksdjf981273948okjdfksdl") ``` diff --git a/packages/vscode-plugin/.env.example b/packages/vscode-plugin/.env.example index 7e1ab7f92..67fe9cf40 100644 --- a/packages/vscode-plugin/.env.example +++ b/packages/vscode-plugin/.env.example @@ -16,7 +16,7 @@ APP_ENV=remap($WORKERS_CI_BRANCH, "main", production, regex(.*), preview, undefi # OpenAI API Key # @required @sensitive @type=string(startsWith=sk-) -# @docsUrl=https://platform.openai.com/docs/api-reference/authentication +# @docs(https://developers.openai.com/api/reference/overview#authentication) OPENAI_API_KEY=exec('op read "op://api-config-prod/openai/api-key"') diff --git a/packages/vscode-plugin/language/env-spec.tmLanguage.json b/packages/vscode-plugin/language/env-spec.tmLanguage.json index 2c6047203..33ac19f80 100644 --- a/packages/vscode-plugin/language/env-spec.tmLanguage.json +++ b/packages/vscode-plugin/language/env-spec.tmLanguage.json @@ -629,7 +629,7 @@ "unquoted-string-within-fn-call": { "comment": "unquoted string value within fn call", - "match": "([^ \n#,)$]+)", + "match": "([^ \n,)$]+)", "name": "string.unquoted.env-spec", "captures": { "1": { diff --git a/packages/vscode-plugin/test/grammar.test.txt b/packages/vscode-plugin/test/grammar.test.txt index 6b89d65dc..c9cf89a1b 100644 --- a/packages/vscode-plugin/test/grammar.test.txt +++ b/packages/vscode-plugin/test/grammar.test.txt @@ -61,6 +61,20 @@ EXAMPLE_VAR=test # <- comment.line.env-spec DEC_FN_VAR=test +# @docs(https://varlock.dev/env-spec/overview/#a-short-example) +# <- comment.line.env-spec +# ^^^^^^^^^^^^^^^^ string.unquoted.env-spec +DOCS_FRAGMENT_VAR=test + +# @type( +# string, +# ^^^^^^ string.unquoted.env-spec +# number +# ^^^^^^ string.unquoted.env-spec +# ) +# ^ punctuation.section.parens.end.env-spec +MULTI_DEC_VAR=test + # ====================== # Variable expansion # ======================