Skip to content

Commit e0288d6

Browse files
committed
Merge branch 'dev' of https://github.com/sslinky/vba-LanguageServer into dev
2 parents 7e9d887 + 9e01337 commit e0288d6

File tree

5 files changed

+534
-356
lines changed

5 files changed

+534
-356
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
# Template from: https://github.com/DecimalTurn/VBA-on-GitHub
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Properties for VBA, VB6 and twinBASIC file extensions
8+
[*.{bas,cls,frm,vba,doccls,ctl,dsr,twin,tbform}]
9+
indent_style = space
10+
indent_size = 4
11+
end_of_line = crlf
12+
# Avoid line too long error (https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/line-too-long):
13+
max_line_length = 1023
14+
insert_final_newline = true
15+
trim_trailing_whitespace = true
16+
17+
# The character set property isn't widely supported, but you can still add it. It just won't do anything if unsupported by your editor.
18+
# Reference: https://github.com/editorconfig/editorconfig/issues/209#issuecomment-445241830
19+
# Eg.:
20+
# charset = windows-1252
21+
# charset = us-ascii

client/src/syntaxes/vba.tmLanguage.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ repository:
284284

285285
inlineIfElse:
286286
name: meta.flow.inline-if-else.vba
287-
match: (?i)\s*((?:else)?if)\s+(.*?)\s+(then)\s+(.*)\s+(else)\s+([^'\n]*)
287+
match: (?i)\s*((?:else\s+)?if)\s+(.*?)\s+(then)\s+(.*)\s+(else)\s+([^'\n]*)
288288
captures:
289289
1:
290290
name: keyword.control.flow.decision.vba
@@ -296,8 +296,12 @@ repository:
296296
name: keyword.control.flow.decision.vba
297297
4:
298298
patterns:
299+
- include: "#inlineIfElse"
300+
- include: "#inlineIf"
299301
- include: "#valueAssignment"
300302
- include: "#language"
303+
- include: "#expression"
304+
- include: "#functionCall"
301305
5:
302306
name: keyword.control.flow.decision.vba
303307
6:
@@ -319,10 +323,11 @@ repository:
319323
name: keyword.control.flow.decision.vba
320324
4:
321325
patterns:
326+
- include: "#inlineIfElse"
327+
- include: "#inlineIf"
322328
- include: "#valueAssignment"
323329
- include: "#language"
324330

325-
326331
flowCall:
327332
name: keyword.control.flow.call.vba
328333
match: "(?i)\\bcall\\b"

contributing.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ Note the grammar file for this project can be found at /server/src/antlr/vba.g4
3939
* Show ATN Graph for Rule
4040

4141
The grammar call graph is interesting, but not particularly useful. Generating "valid" input generates garbage.
42+
43+
### Run unit tests for TextMate grammar
44+
45+
To verify that your changes haven't broken existing syntax or tests, and to ensure any new tests pass, run the following command:
46+
47+
```
48+
npm run tmUnitTest
49+
```

0 commit comments

Comments
 (0)