From 926fe8bf270caf92c83ded29c4bed89717a1c4d7 Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:05:26 -0500 Subject: [PATCH] Remove lookbehind for `functions` scope (#119) --- syntaxes/tests/vba/other.bas | 2 +- syntaxes/tests/vba/procedure.bas | 4 ++++ syntaxes/vba.yaml-tmlanguage | 13 ++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/syntaxes/tests/vba/other.bas b/syntaxes/tests/vba/other.bas index 6e30fde..38bd837 100644 --- a/syntaxes/tests/vba/other.bas +++ b/syntaxes/tests/vba/other.bas @@ -136,7 +136,7 @@ Private WithEvents app As Outlook.Application Event LogonCompleted(UserName as String) ' <----- keyword.other.vba -Sub Logon +Sub Logon() RaiseEvent LogonCompleted ("AntoineJan") ' ^^^^^^^^^^ keyword.other.vba End Sub diff --git a/syntaxes/tests/vba/procedure.bas b/syntaxes/tests/vba/procedure.bas index 13afd40..4a6077d 100644 --- a/syntaxes/tests/vba/procedure.bas +++ b/syntaxes/tests/vba/procedure.bas @@ -50,3 +50,7 @@ End Function Call mSub() ' <---- keyword.other.vba ' ^^^^ entity.name.function.vba + +Call SubWithNoArgs +' <---- keyword.other.vba +' ^^^^^^^^^^^^^ entity.name.function.vba diff --git a/syntaxes/vba.yaml-tmlanguage b/syntaxes/vba.yaml-tmlanguage index f016ebc..331ca78 100644 --- a/syntaxes/vba.yaml-tmlanguage +++ b/syntaxes/vba.yaml-tmlanguage @@ -39,9 +39,16 @@ repository: match: ^.* functions: - name: entity.name.function.vba - match: (?i:\b(?:(?<=(Call|Function|Sub) ))([a-zA-Z][a-zA-Z0-9_]*)\b)(?=\(\)?) - + name: testing.vba + begin: (?i:\b(Call|Function|Sub) ) + beginCaptures: + 1: + name: keyword.other.vba + patterns: + - name: entity.name.function.vba + match: (?i:\b([a-zA-Z][a-zA-Z0-9_]*)\b) + end: \(|(?=\n) + keywords: patterns: - name: keyword.conditional.vba