Skip to content

Commit 5ed3776

Browse files
authored
Merge pull request #78 from SSlinky/textMate
TextMate Updates
2 parents 5f2fb32 + 71ad926 commit 5ed3776

File tree

11 files changed

+3536
-3086
lines changed

11 files changed

+3536
-3086
lines changed

client/syntaxes/vba.tmLanguage.json

Lines changed: 628 additions & 497 deletions
Large diffs are not rendered by default.

client/syntaxes/vba.tmLanguage.yaml

Lines changed: 351 additions & 250 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"icon": "images/vba-lsp-icon.png",
77
"author": "SSlinky",
88
"license": "MIT",
9-
"version": "1.5.11",
9+
"version": "1.5.12",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/SSlinky/VBA-LanguageServer"

test/textmate/snapshot/Dictionary.cls.snap

Lines changed: 970 additions & 967 deletions
Large diffs are not rendered by default.

test/textmate/snapshot/DictionaryTests.bas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Public Type MyFooType 'Comment
4040
'Comment
4141
Length As Long 'Comment
4242
'Comment
43-
43+
4444
Length As Long 'Comment
4545
'Comment
4646
End Type 'Comment
@@ -679,7 +679,7 @@ Attribute TestDictionary_RemoveRemovesKey.VB_Description = "Test that remove rem
679679
d.Add INPKEYB, Nothing
680680

681681
' Act
682-
d.Remove(INPKEYA)
682+
d.Remove INPKEYA
683683

684684
' Assert
685685
On Error Resume Next

test/textmate/snapshot/DictionaryTests.bas.snap

Lines changed: 1339 additions & 1339 deletions
Large diffs are not rendered by default.

test/textmate/unit/logicFlowBlock.vba

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
1-
' SYNTAX TEST "source.vba" "logic flow"
1+
' SYNTAX TEST "source.vba" "logic blocks"
22

3-
Attribute VB_Name = "Logic"
4-
' Copyright 2024 Sam Vanderslink
5-
'
6-
' Permission is hereby granted, free of charge, to any person obtaining a copy
7-
' of this software and associated documentation files (the "Software"), to deal
8-
' in the Software without restriction, including without limitation the rights
9-
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
' copies of the Software, and to permit persons to whom the Software is
11-
' furnished to do so, subject to the following conditions:
12-
'
13-
' The above copyright notice and this permission notice shall be included in
14-
' all copies or substantial portions of the Software.
15-
'
16-
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21-
' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22-
' IN THE SOFTWARE.
23-
24-
Option Explicit
25-
26-
27-
Public Sub Foo()
3+
Sub Foo()
284
' Variable positive
295
If condition Then
306
' ^^^^^^^^^^^^^^^^^ meta.block-if-else.vba

test/textmate/unit/logicFlowInline.vba

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
' SYNTAX TEST "source.vba" "logic flow inline"
1+
' SYNTAX TEST "source.vba" "logic inline"
22

33
Attribute VB_Name = "Logic inline"
44

5-
Public Sub Foo()
5+
Sub Foo()
66

77
''''''''''''''''''''''''''''''''
88
' 1. Inline Ifs (without nesting)

test/textmate/unit/logicFlowLoop.vba

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
' SYNTAX TEST "source.vba" "loop for"
2+
3+
' Normal people for loops
4+
5+
Sub Foo()
6+
' Supports omitting Step.
7+
For i = 1 To 10
8+
' ^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
9+
' ^^^^^^^^^^^ meta.for-iterator-loop.vba
10+
' ^ variable.other.readwrite.vba
11+
' ^ keyword.operator.assignment.vba
12+
' ^ ^^ constant.numeric.vba
13+
' ^^ keyword.control.flow.loop.vba
14+
Next i
15+
' ^^^^^^ meta.flow.for-loop.vba
16+
' ^^^^ keyword.control.flow.loop.vba
17+
18+
' Supports number literals.
19+
For i = 1 To 10 Step 2
20+
' ^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
21+
' ^^^^^^^^^^^^^^^^^^ meta.for-iterator-loop.vba
22+
' ^ variable.other.readwrite.vba
23+
' ^ keyword.operator.assignment.vba
24+
' ^ ^^ ^ constant.numeric.vba
25+
' ^^ ^^^^ keyword.control.flow.loop.vba
26+
Next i
27+
' ^^^^^^ meta.flow.for-loop.vba
28+
' ^^^^ keyword.control.flow.loop.vba
29+
30+
' Supports negative number literals.
31+
For i = -1 To -10 Step -2
32+
' ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
33+
' ^^^^^^^^^^^^^^^^^^^^^ meta.for-iterator-loop.vba
34+
' ^ variable.other.readwrite.vba
35+
' ^ keyword.operator.assignment.vba
36+
' ^^ ^^^ ^^ constant.numeric.vba
37+
' ^^ ^^^^ keyword.control.flow.loop.vba
38+
Next i
39+
' ^^^^^^ meta.flow.for-loop.vba
40+
' ^^^^ keyword.control.flow.loop.vba
41+
42+
' Supports properties.
43+
For i = .Low To .High Step .Step
44+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
45+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.for-iterator-loop.vba
46+
' ^ variable.other.readwrite.vba
47+
' ^^^^ ^^^^^ ^^^^^ meta.variable-or-property.vba
48+
' ^ keyword.operator.assignment.vba
49+
' ^^ ^^^^ keyword.control.flow.loop.vba
50+
Next i
51+
' ^^^^^^ meta.flow.for-loop.vba
52+
' ^^^^ keyword.control.flow.loop.vba
53+
54+
' Supports functions.
55+
For i = .GetLow() To .GetHigh() Step .GetStep()
56+
Next i
57+
' ^^^^^^ meta.flow.for-loop.vba
58+
' ^^^^ keyword.control.flow.loop.vba
59+
60+
' Simple for each.
61+
For Each obj In collection
62+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
63+
' ^^^^^^^^^^^^^^^^^^^^^^ meta.for-each-loop.vba
64+
' ^^^ ^^^^^^^^^^ meta.variable-or-property.vba
65+
' ^^ keyword.control.flow.loop.vba
66+
Next obj
67+
' ^^^^^^^^ meta.flow.for-loop.vba
68+
' ^^^^ keyword.control.flow.loop.vba
69+
70+
' Supports properties.
71+
For Each obj In .Collection
72+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
73+
' ^^^^^^^^^^^^^^^^^^^^^^^ meta.for-each-loop.vba
74+
' ^^^ ^^^^^^^^^^^ meta.variable-or-property.vba
75+
' ^^ keyword.control.flow.loop.vba
76+
Next obj
77+
' ^^^^^^^^ meta.flow.for-loop.vba
78+
' ^^^^ keyword.control.flow.loop.vba
79+
80+
' Supports functions.
81+
For Each obj In .Collection()
82+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
83+
' ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.for-each-loop.vba
84+
' ^^^ meta.variable-or-property.vba
85+
' ^^ keyword.control.flow.loop.vba
86+
' ^^^^^^^^^^^^^ meta.function.call.vba
87+
Next obj
88+
' ^^^^^^^^ meta.flow.for-loop.vba
89+
' ^^^^ keyword.control.flow.loop.vba
90+
91+
' Supports normal block things.
92+
For Each obj In collection
93+
For j = 1 To 10
94+
' ^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
95+
If condition Then DoSomething
96+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.inline-if.vba
97+
Next j
98+
99+
For Each obj In collection
100+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.flow.for-loop.vba
101+
Next obj
102+
103+
If condition Then
104+
' ^^^^^^^^^^^^^^^^^ meta.block-if-else.vba
105+
End If
106+
Next obj
107+
End Sub
108+
109+
' Line continued tests
110+
111+
Sub Bar()
112+
For _
113+
' ^^^ keyword.control.flow.loop.vba
114+
i _
115+
' ^ variable.other.readwrite.vba
116+
= _
117+
' ^ keyword.operator.assignment.vba
118+
-2 _
119+
' ^^ constant.numeric.vba
120+
To _
121+
' ^^ keyword.control.flow.loop.vba
122+
10 _
123+
' ^^ constant.numeric.vba
124+
Step _
125+
' ^^^^ keyword.control.flow.loop.vba
126+
20
127+
' ^^ constant.numeric.vba
128+
Next i
129+
' ^^^^ keyword.control.flow.loop.vba
130+
End Sub

test/textmate/unit/openStatement.vba

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
' SYNTAX TEST "source.vba" "open statements"
2+
3+
' Normal people tests
4+
Sub Foo()
5+
' Mode: Input, Output, Binary, Random
6+
Open path For Input As #1
7+
' ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
8+
' ^^^^ ^^^ ^^ keyword.control.vba
9+
' ^^^^ meta.variable-or-property.vba
10+
' ^^^^^ storage.type.vba
11+
' ^ support.type.primitive.vba
12+
' ^ constant.numeric.vba
13+
Open "xx" For Output As #f
14+
' ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
15+
' ^^^^ ^^^ ^^ keyword.control.vba
16+
' ^^^^ string.quoted.double.vba
17+
' ^^^^^^ storage.type.vba
18+
' ^ support.type.primitive.vba
19+
' ^ meta.variable-or-property.vba
20+
Open .f.o For Binary As .f
21+
' ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
22+
' ^^^^ ^^^ ^^ keyword.control.vba
23+
' ^^^^ meta.variable-or-property.vba
24+
' ^^^^^^ storage.type.vba
25+
' ^^ meta.variable-or-property.vba
26+
27+
Open xx() For Random As #1
28+
' ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
29+
' ^^^^ ^^^ ^^ keyword.control.vba
30+
' ^^^^ meta.function.call.vba
31+
' ^^^^^^ storage.type.vba
32+
' ^ support.type.primitive.vba
33+
' ^ constant.numeric.vba
34+
35+
' Access: Read, Write
36+
Open xx() For Input Access Read As #1
37+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
38+
' ^^^^ ^^^ ^^^^^^ keyword.control.vba
39+
' ^^^^ meta.function.call.vba
40+
' ^^^^^ ^^^^ storage.type.vba
41+
42+
Open path For Input Access Write As #1
43+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
44+
' ^^^^ ^^^ ^^^^^^ keyword.control.vba
45+
' ^^^^ meta.variable-or-property.vba
46+
' ^^^^^ ^^^^^ storage.type.vba
47+
48+
49+
' Lock: Read, Write, Read Write
50+
Open path For Input Lock Read As #1
51+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
52+
' ^^^^ ^^^ ^^^^ keyword.control.vba
53+
' ^^^^ meta.variable-or-property.vba
54+
' ^^^^^ ^^^^ storage.type.vba
55+
Open path For Input Lock Write As #1
56+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
57+
' ^^^^ ^^^ ^^^^ keyword.control.vba
58+
' ^^^^ meta.variable-or-property.vba
59+
' ^^^^^ ^^^^^ storage.type.vba
60+
Open path For Input Lock Read Write As #1
61+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
62+
' ^^^^ ^^^ ^^^^ keyword.control.vba
63+
' ^^^^ meta.variable-or-property.vba
64+
' ^^^^^ ^^^^ ^^^^^ storage.type.vba
65+
66+
67+
' Access / Lock
68+
Open path For Input Access Read Lock Read As #1
69+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
70+
' ^^^^ ^^^ ^^^^^^ ^^^^ keyword.control.vba
71+
' ^^^^^ ^^^^ ^^^^ storage.type.vba
72+
73+
74+
Open path For Random As #1 Len = Len(MyRecord)
75+
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.open-statement.vba
76+
' ^^^^ ^^^ ^^ ^^^ keyword.control.vba
77+
' ^^^^^^ storage.type.vba
78+
' ^ keyword.operator.assignment.vba
79+
' ^^^^^^^^^^^^^ meta.expression.vba
80+
End Sub
81+
82+
' Crazy people tests
83+
Sub Bar()
84+
Open _
85+
' ^^^^ keyword.control.vba
86+
foo _
87+
' ^^^ meta.variable-or-property.vba
88+
For _
89+
' ^^^ keyword.control.vba
90+
Binary _
91+
' ^^^^^^ storage.type.vba
92+
Access _
93+
' ^^^^^^ keyword.control.vba
94+
Read _
95+
' ^^^^ storage.type.vba
96+
Write _
97+
' ^^^^^ storage.type.vba
98+
As _
99+
' ^^ keyword.control.vba
100+
#1 _
101+
' ^ support.type.primitive.vba
102+
' ^ constant.numeric.vba
103+
Len _
104+
' ^^^ keyword.control.vba
105+
= _
106+
' ^ keyword.operator.assignment.vba
107+
Len("abc") + 1
108+
' ^^^^^^^^^^^^^^ meta.expression.vba
109+
End Sub

0 commit comments

Comments
 (0)