From 45b2faa9b0371c222d5a6a61da0e2f738b8a8f66 Mon Sep 17 00:00:00 2001 From: Thomas Michiels Date: Mon, 13 Oct 2025 12:15:04 +0200 Subject: [PATCH 1/4] Update vbs.tmLanguage.json, fix ByRef/ByVal, fix Redim and fix storage sizes --- syntaxes/vbs.tmLanguage.json | 50 ++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/syntaxes/vbs.tmLanguage.json b/syntaxes/vbs.tmLanguage.json index a44befd..f8b2680 100644 --- a/syntaxes/vbs.tmLanguage.json +++ b/syntaxes/vbs.tmLanguage.json @@ -7,7 +7,7 @@ "version": "https://github.com/textmate/asp.vb.net.tmbundle/commit/72d44550b3286d0382d7be0624140cf97857ff69", "name": "VBScript", "scopeName": "source.vbs", - "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com", + "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com, afterwards editted by mi_thom (github)", "patterns": [ { "match": "\\n", @@ -58,7 +58,38 @@ "match": "(?i:'|Rem\\b).*$" }, { - "comment": "function definition", + "comment": "function definition with args", + "beginCaptures": { + "1": { + "name": "storage.modifier.vbs" + }, + "2": { + "name": "storage.type.function.vbs" + }, + "3": { + "name": "entity.name.function.vbs" + }, + "4": { + "name": "punctuation.definition.parameters.begin.vbs" + } + }, + "endCaptures":{ + "0":{ + "name":"punctuation.definition.parameters.end.vbs" + } + }, + "contentName": "variable.parameter.function.vbs", + "patterns":[ + { + "match": "(?<=\\b)(?i:ByRef|ByVal)(?=\\b)", + "name": "storage.modifier.vbs" + } + ], + "begin": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*(\\()", + "end": "\\)" + }, + { + "comment": "function definition without args", "captures": { "1": { "name": "storage.modifier.vbs" @@ -72,21 +103,24 @@ "4": { "name": "punctuation.definition.parameters.begin.vbs" }, - "5": { + "6": { "name": "variable.parameter.function.vbs" }, - "6": { + "5": { + "name": "storage.type.vbs" + }, + "7": { "name": "punctuation.definition.parameters.end.vbs" } }, - "match": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*(?:(\\()([^)]*)(\\)))?" + "match": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*" }, { "match": "(?i:End[\\t ]+(Sub|Function|Class|Property))", "name": "storage.type.end.vbs" }, { - "match": "(?i:\\s*\\b(Redim|Redim Preserve|With|End With|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo|Stop)\\b\\s*)", + "match": "(?i:\\s*\\b(With|End With|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo|Stop)\\b\\s*)", "name": "keyword.control.vbs" }, { @@ -111,7 +145,7 @@ "name": "variable.other.dim.vbs" } }, - "match": "\\b(?i:((?:public|private)\\s+const|public|private|dim|const)\\s+\\b(\\[?[a-zA-Z]\\w*\\]?\\b(?:\\s*,\\s*\\b\\[?[a-zA-Z]\\w*\\]?\\b)*))" + "match": "\\b(?i:((?:public|private)\\s+const|public|private|dim|const|redim(?: preserve)?)\\s+(\\[?[a-zA-Z]\\w*\\]?(?:\\s*\\(\\s*\\d*\\s*\\))?(?:\\s*,\\s*\\[?[a-zA-Z]\\w*\\]?(?:\\s*\\(\\s*\\d*\\s*\\))?)*))" }, { "match": "(?i:\\s*\\b(Empty|False|Nothing|Null|True)\\b)", @@ -175,4 +209,4 @@ "name": "variable.other.member.vbs" } ] -} \ No newline at end of file +} From 2d64bfdc98e85c3732f707489bb0dce922923a61 Mon Sep 17 00:00:00 2001 From: Thomas Michiels Date: Mon, 13 Oct 2025 12:19:09 +0200 Subject: [PATCH 2/4] remove unused capture group names --- syntaxes/vbs.tmLanguage.json | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/syntaxes/vbs.tmLanguage.json b/syntaxes/vbs.tmLanguage.json index f8b2680..f64d711 100644 --- a/syntaxes/vbs.tmLanguage.json +++ b/syntaxes/vbs.tmLanguage.json @@ -7,7 +7,7 @@ "version": "https://github.com/textmate/asp.vb.net.tmbundle/commit/72d44550b3286d0382d7be0624140cf97857ff69", "name": "VBScript", "scopeName": "source.vbs", - "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com, afterwards editted by mi_thom (github)", + "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com", "patterns": [ { "match": "\\n", @@ -99,18 +99,6 @@ }, "3": { "name": "entity.name.function.vbs" - }, - "4": { - "name": "punctuation.definition.parameters.begin.vbs" - }, - "6": { - "name": "variable.parameter.function.vbs" - }, - "5": { - "name": "storage.type.vbs" - }, - "7": { - "name": "punctuation.definition.parameters.end.vbs" } }, "match": "(?i:(Private|Public)[\\t ]+)?(?i:(Class|Function|Sub|(?:Default\\s+)?Property [GLS]et))[\\t ]+(\\[?[a-zA-Z]\\w*\\]?)[\\t ]*" From cc0d0b272a2a9a922d30f014532b6f96cbb615c0 Mon Sep 17 00:00:00 2001 From: Thomas Michiels Date: Mon, 13 Oct 2025 12:20:05 +0200 Subject: [PATCH 3/4] bring back comment edit --- syntaxes/vbs.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/vbs.tmLanguage.json b/syntaxes/vbs.tmLanguage.json index f64d711..a6d2a10 100644 --- a/syntaxes/vbs.tmLanguage.json +++ b/syntaxes/vbs.tmLanguage.json @@ -7,7 +7,7 @@ "version": "https://github.com/textmate/asp.vb.net.tmbundle/commit/72d44550b3286d0382d7be0624140cf97857ff69", "name": "VBScript", "scopeName": "source.vbs", - "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com", + "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com, afterwards editted by mi_thom (github)", "patterns": [ { "match": "\\n", From eb3e738ea329738849b029109dc0d2a8359f707a Mon Sep 17 00:00:00 2001 From: Thomas Michiels Date: Mon, 13 Oct 2025 12:27:31 +0200 Subject: [PATCH 4/4] remove unused replaced old byval/byref object --- syntaxes/vbs.tmLanguage.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/syntaxes/vbs.tmLanguage.json b/syntaxes/vbs.tmLanguage.json index a6d2a10..ed4bf5d 100644 --- a/syntaxes/vbs.tmLanguage.json +++ b/syntaxes/vbs.tmLanguage.json @@ -111,11 +111,6 @@ "match": "(?i:\\s*\\b(With|End With|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo|Stop)\\b\\s*)", "name": "keyword.control.vbs" }, - { - "comment": "not working (in only valid place), overwirtten by variable.parameter.function.vbs", - "match": "(?i:\\b(ByRef|ByVal)\\b)", - "name": "storage.modifier.vbs" - }, { "match": "(?i:\\b(Call|If|Then|Else|ElseIf|End If|Set|While|Wend|For|Step|To|Each|In|Case|Select|End Select|Continue|Do|Until|Loop|Next|Exit (Do|For|Function|Property|Sub))\\b)", "name": "keyword.control.vbs"