From 35cbcc2cc274f30af7321eafc40446685bfe4ac4 Mon Sep 17 00:00:00 2001 From: Antonio Sarosi Date: Mon, 9 Dec 2024 18:29:13 +0100 Subject: [PATCH] Fix vscode syntax --- .../baml_src/test-files/functions/output/type-aliases.baml | 2 +- typescript/vscode-ext/packages/syntaxes/baml.tmLanguage.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integ-tests/baml_src/test-files/functions/output/type-aliases.baml b/integ-tests/baml_src/test-files/functions/output/type-aliases.baml index 69005e6ce..7219b1915 100644 --- a/integ-tests/baml_src/test-files/functions/output/type-aliases.baml +++ b/integ-tests/baml_src/test-files/functions/output/type-aliases.baml @@ -37,7 +37,7 @@ function NestedAlias(c: Combination) -> Combination { // Test attribute merging. type Currency = int @check(gt_ten, {{ this > 10 }}) -type Amount = Currency @assert ({{ this > 0 }}) +type Amount = Currency @assert({{ this > 0 }}) class MergeAttrs { amount Amount @description("In USD") diff --git a/typescript/vscode-ext/packages/syntaxes/baml.tmLanguage.json b/typescript/vscode-ext/packages/syntaxes/baml.tmLanguage.json index 66b8fd9ff..5034ded68 100644 --- a/typescript/vscode-ext/packages/syntaxes/baml.tmLanguage.json +++ b/typescript/vscode-ext/packages/syntaxes/baml.tmLanguage.json @@ -731,9 +731,10 @@ { "include": "#comment" }, { "begin": "(?<=\\=)\\s*", - "end": "(?=$|\\n)", + "end": "(?=//|$|\\n)", "patterns": [ - { "include": "#type_definition" } + { "include": "#type_definition" }, + { "include": "#block_attribute" } ] } ]