Skip to content

Commit d27eae5

Browse files
committed
Update modifiers and types
1 parent ed51855 commit d27eae5

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ repository:
571571
end: (?=[,):'\n])
572572
beginCaptures:
573573
0:
574-
name: storage.type.modifier.vba
574+
name: storage.modifier.$1.vba
575575
patterns:
576576
- include: "#argumentSignatureFromParam"
577577
- include: "#lineContinuation"
@@ -900,7 +900,7 @@ repository:
900900
end: (?=[':\n])
901901
beginCaptures:
902902
0:
903-
name: storage.modifier.declare.vba
903+
name: storage.type.vba
904904
patterns:
905905
- include: "#separator"
906906
- include: "#lineContinuation"
@@ -912,7 +912,7 @@ repository:
912912
end: (?=[':\n])
913913
beginCaptures:
914914
0:
915-
name: storage.modifier.declare.vba
915+
name: storage.type.vba
916916
patterns:
917917
- include: "#separator"
918918
- include: "#lineContinuation"
@@ -978,7 +978,7 @@ repository:
978978
end: (?=[':\n])
979979
beginCaptures:
980980
0:
981-
name: storage.modifier.declare.vba
981+
name: storage.type.vba
982982
patterns:
983983
- include: "#lineContinuation"
984984
- include: "#methodDeclarationPtrsafe"
@@ -990,7 +990,7 @@ repository:
990990
end: (?=[)':\n])
991991
beginCaptures:
992992
0:
993-
name: storage.modifier.declare.vba
993+
name: storage.modifier.ptrsafe.vba
994994
patterns:
995995
- include: "#lineContinuation"
996996
- include: "#methodDeclarationMethod"

test/textmate/unit/declarations.vba

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Dim x As Long, y As Long, z ' Comment
66
'<------------------------------- meta.declare.variable.vba
7-
'<--- storage.modifier.declare.vba
7+
'<--- storage.type.vba
88
' ^ ^ ^ variable.other.readwrite.vba
99
' ^^ ^^ keyword.control.as.vba
1010
' ^^^^ ^^^^ support.type.primitive.Long.vba
@@ -36,7 +36,7 @@ Global x As Long, y As Long, z ' Comment
3636
' ^^^^^^^^^ comment.line.apostrophe.vba - meta.declare.variable.vba
3737
Dim x As New Object, y as New Object ' Comment
3838
'<---------------------------------------- meta.declare.variable.vba
39-
'<--- storage.modifier.declare.vba
39+
'<--- storage.type.vba
4040
' ^ ^ variable.other.readwrite.vba
4141
' ^^ ^^ keyword.control.as.vba
4242
' ^^^ ^^^ keyword.storage.new.vba
@@ -46,7 +46,7 @@ Dim x As New Object, y as New Object ' Comment
4646

4747
Const X As Long = 0, Y As Long = 0, Z = 0 ' Comment
4848
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.constant.vba
49-
' ^^^^^ storage.modifier.declare.vba
49+
' ^^^^^ storage.type.vba
5050
' ^ ^ ^ variable.other.constant
5151
' ^^ ^^ keyword.control.as.vba
5252
' ^^^^ ^^^^ support.type.primitive.Long.vba
@@ -56,23 +56,23 @@ Dim x As New Object, y as New Object ' Comment
5656
' ^^^^^^^^^ comment.line.apostrophe.vba - meta.declare.variable.vba
5757
Private Const X As Long = 0, Y As Long = 0, Z = 0 ' Comment
5858
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.constant.vba
59-
' ^^^^^ storage.modifier.declare.vba
59+
' ^^^^^ storage.type.vba
6060
' ^ ^ ^ variable.other.constant
6161
' ^^ ^^ keyword.control.as.vba
6262
' ^^^^ ^^^^ support.type.primitive.Long.vba
6363
' ^ ^ punctuation.separator.vba
6464
' ^^^^^^^^^ comment.line.apostrophe.vba - meta.declare.variable.vba
6565
Public Const X As Long = 0, Y As Long = 0, Z = 0 ' Comment
6666
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.constant.vba
67-
' ^^^^^ storage.modifier.declare.vba
67+
' ^^^^^ storage.type.vba
6868
' ^ ^ ^ variable.other.constant
6969
' ^^ ^^ keyword.control.as.vba
7070
' ^^^^ ^^^^ support.type.primitive.Long.vba
7171
' ^ ^ punctuation.separator.vba
7272
' ^^^^^^^^^ comment.line.apostrophe.vba - meta.declare.variable.vba
7373
Global Const X As Long = 0, Y As Long = 0, Z = 0 ' Comment
7474
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.constant.vba
75-
' ^^^^^ storage.modifier.declare.vba
75+
' ^^^^^ storage.type.vba
7676
' ^ ^ ^ variable.other.constant
7777
' ^^ ^^ keyword.control.as.vba
7878
' ^^^^ ^^^^ support.type.primitive.Long.vba
@@ -82,7 +82,7 @@ Global Const X As Long = 0, Y As Long = 0, Z = 0 ' Comment
8282

8383

8484
Dim x As Long, _
85-
'<--- meta.declare.variable.vba storage.modifier.declare.vba
85+
'<--- meta.declare.variable.vba storage.type.vba
8686
' ^ meta.declare.variable.vba variable.other.readwrite.vba
8787
' ^^ meta.declare.variable.vba keyword.control.as.vba
8888
' ^^^^ meta.declare.variable.vba support.type.primitive.Long.vba
@@ -100,7 +100,7 @@ Dim x As Long, _
100100

101101

102102
Const X As Long = 0, _
103-
'<----- meta.declare.constant.vba storage.modifier.declare.vba
103+
'<----- meta.declare.constant.vba storage.type.vba
104104
' ^ meta.declare.constant.vba variable.other.constant
105105
' ^^ meta.declare.constant.vba keyword.control.as.vba
106106
' ^^^^ meta.declare.constant.vba support.type.primitive.Long.vba
@@ -125,7 +125,7 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
125125
' ^^^^^^^^ ^^^^^^^^ meta.declare.array-bounds.vba
126126

127127
Dim _
128-
' ^^^ storage.modifier.declare.vba
128+
' ^^^ storage.type.vba
129129
x _
130130
' ^ variable.other.readwrite.vba
131131
( _
@@ -156,7 +156,7 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
156156
' ^ keyword.control.line-separator.vba - meta.declare.variable.vba
157157
' ^^^^^^^ meta.declare.Private.vba storage.modifier.visibility.vba
158158
Const _
159-
' ^^^^^ meta.declare.constant.vba storage.modifier.declare.vba
159+
' ^^^^^ meta.declare.constant.vba storage.type.vba
160160
BAZ _
161161
' ^^^ variable.other.constant
162162
As _
@@ -173,7 +173,8 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
173173
' Function declarations.
174174
Private Declare PtrSafe Function AccessibleObjectFromWindow Lib "oleacc" Alias "foo" (ByVal hwnd As LongPtr, ByVal dwId As Long, riid As tGUID, ppvObject As Object) As Long
175175
' ^^^^^^^ storage.modifier.visibility.vba
176-
' ^^^^^^^ ^^^^^^^ meta.declare.function.vba storage.modifier.declare.vba
176+
' ^^^^^^^ meta.declare.function.vba storage.type.vba
177+
' ^^^^^^^ meta.declare.function.vba storage.modifier.ptrsafe.vba
177178
' ^^^^^^^^ meta.declare.function.vba storage.type.Function.vba
178179
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.function.vba entity.name.function.vba
179180
' ^^^ ^^^^^ meta.declare.function.vba storage.type.dll.vba
@@ -182,7 +183,7 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
182183
' ^^^^^^^ meta.declare.function.vba meta.argument-signature.as.vba
183184
Private Declare Function AccessibleObjectFromWindow Lib "oleacc" Alias "foo" (ByVal hwnd As LongPtr, ByVal dwId As Long, riid As tGUID, ppvObject As Object) As Long
184185
' ^^^^^^^ storage.modifier.visibility.vba
185-
' ^^^^^^^ meta.declare.function.vba storage.modifier.declare.vba
186+
' ^^^^^^^ meta.declare.function.vba storage.type.vba
186187
' ^^^^^^^^ meta.declare.function.vba storage.type.Function.vba
187188
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.function.vba entity.name.function.vba
188189
' ^^^ ^^^^^ meta.declare.function.vba storage.type.dll.vba
@@ -191,7 +192,8 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
191192
' ^^^^^^^ meta.declare.function.vba meta.argument-signature.as.vba
192193
Private Declare PtrSafe Function AccessibleObjectFromWindow Lib "oleacc" (ByVal hwnd As LongPtr, ByVal dwId As Long, riid As tGUID, ppvObject As Object) As Long
193194
' ^^^^^^^ storage.modifier.visibility.vba
194-
' ^^^^^^^ ^^^^^^^ meta.declare.function.vba storage.modifier.declare.vba
195+
' ^^^^^^^ meta.declare.function.vba storage.type.vba
196+
' ^^^^^^^ meta.declare.function.vba storage.modifier.ptrsafe.vba
195197
' ^^^^^^^^ meta.declare.function.vba storage.type.Function.vba
196198
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.function.vba entity.name.function.vba
197199
' ^^^ meta.declare.function.vba storage.type.dll.vba
@@ -200,7 +202,7 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
200202
' ^^^^^^^ meta.declare.function.vba meta.argument-signature.as.vba
201203
Private Declare Function AccessibleObjectFromWindow Lib "oleacc" (ByVal hwnd As LongPtr, ByVal dwId As Long, riid As tGUID, ppvObject As Object)
202204
' ^^^^^^^ storage.modifier.visibility.vba
203-
' ^^^^^^^ meta.declare.function.vba storage.modifier.declare.vba
205+
' ^^^^^^^ meta.declare.function.vba storage.type.vba
204206
' ^^^^^^^^ meta.declare.function.vba storage.type.Function.vba
205207
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.declare.function.vba entity.name.function.vba
206208
' ^^^ meta.declare.function.vba storage.type.dll.vba
@@ -211,9 +213,9 @@ Dim foo(1 To 5) As Long, bar(2 To 7)
211213
Public _
212214
' ^^^^^^ storage.modifier.visibility.vba
213215
Declare _
214-
' ^^^^^^^ meta.declare.function.vba storage.modifier.declare.vba
216+
' ^^^^^^^ meta.declare.function.vba storage.type.vba
215217
PtrSafe _
216-
' ^^^^^^^ meta.declare.function.vba storage.modifier.declare.vba
218+
' ^^^^^^^ meta.declare.function.vba storage.modifier.ptrsafe.vba
217219
Sub _
218220
' ^^^ meta.declare.function.vba storage.type.Sub.vba
219221
AccessibleObjectFromWindow _

test/textmate/unit/methodSignatures.vba

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Public Sub Foo(ByVal x As Long, ByRef y As Long, ParamArray vars() As Variant)
1212
' <------------------------------------------------------------------------------ source.method.signature.vba
1313
' <---------- storage.type.method.vba
1414
' ^^^ entity.name.function.vba
15-
' ^^^^^ storage.type.modifier.vba
15+
' ^^^^^ storage.modifier.ByVal.vba
1616
' ^ variable.parameter.vba
1717
' ^^ keyword.control.as.vba
1818
' ^^^^ support.type.primitive.Long.vba
1919
' ^ punctuation.separator.vba
20-
' ^^^^^ storage.type.modifier.vba
20+
' ^^^^^ storage.modifier.ByRef.vba
2121
' ^ variable.parameter.vba
2222
' ^^ keyword.control.as.vba
2323
' ^^^^ support.type.primitive.Long.vba
@@ -43,12 +43,12 @@ Public Function Foo(ByVal x As Long, ByRef y As Long, ParamArray vars() As Varia
4343
' <--------------------------------------------------------------------------------------------- source.method.signature.vba
4444
' <--------------- storage.type.method.vba
4545
' ^^^ entity.name.function.vba
46-
' ^^^^^ storage.type.modifier.vba
46+
' ^^^^^ storage.modifier.ByVal.vba
4747
' ^ variable.parameter.vba
4848
' ^^ keyword.control.as.vba
4949
' ^^^^ support.type.primitive.Long.vba
5050
' ^ punctuation.separator.vba
51-
' ^^^^^ storage.type.modifier.vba
51+
' ^^^^^ storage.modifier.ByRef.vba
5252
' ^ variable.parameter.vba
5353
' ^^ keyword.control.as.vba
5454
' ^^^^ support.type.primitive.Long.vba
@@ -82,7 +82,8 @@ Public Sub Foo(Optional Bar As String, _
8282
' ^ punctuation.separator.vba
8383
' ^ keyword.control.line-continuation.vba
8484
Optional ByVal Zip As Boolean = True)
85-
' ^^^^^^^^ ^^^^^ storage.type.modifier.vba
85+
' ^^^^^^^^ storage.type.modifier.vba
86+
' ^^^^^ storage.modifier.ByVal.vba
8687
' ^^^ variable.parameter.vba
8788
' ^^ keyword.control.as.vba
8889
' ^^^^^^^ support.type.primitive.Boolean.vba
@@ -124,7 +125,7 @@ Public Sub Foo( _
124125
' ^^^^^^^^ storage.type.modifier.vba
125126
' ^ keyword.control.line-continuation.vba
126127
ByRef _
127-
' ^^^^^ storage.type.modifier.vba
128+
' ^^^^^ storage.modifier.ByRef.vba
128129
' ^ keyword.control.line-continuation.vba
129130
bix As _
130131
' ^^^ variable.parameter.vba

0 commit comments

Comments
 (0)