Skip to content

Commit 33305c3

Browse files
committed
highlight io keywords
1 parent 3ca763d commit 33305c3

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
_unreleased_
44

55
- Highlight `Implements` keyword
6+
- Highlight all I/O-related keywords
67

78

89
## 0.9.3

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
@@ -3,7 +3,7 @@
33
"displayName": "VBA",
44
"description": "VBA tooling, syntax highlighting and snippets for VS Code.",
55
"icon": "images/icon_256x256.png",
6-
"version": "0.9.3",
6+
"version": "0.9.4-dev",
77
"license": "MIT",
88
"repository": {
99
"type": "git",

syntaxes/tests/vba/io.bas

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
' SYNTAX TEST "source.vba" "I/O related keywords"
2+
3+
Open "file" For Input As #f
4+
' <--- keyword.io.vba
5+
' ^^^^^ keyword.io.vba
6+
Input #f myVar
7+
' ^^^^^ keyword.io.vba
8+
9+
Line Input #f myLineVar
10+
' ^^^^^^^^^^ keyword.io.vba
11+
Close #f
12+
' <---- keyword.io.vba
13+
14+
Open "file2" For Output As #2
15+
Print #2 "a"
16+
' ^^^^^ keyword.io.vba
17+
Close #2

syntaxes/vba.tmGrammar.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ repository:
3939

4040
keywords:
4141
patterns:
42-
- name: keyword.other.option.vba
43-
match: (?i)\bOption (Base [01]|Compare (Binary|Text)|Explicit|Private Module)\b
4442
- name: keyword.conditional.vba
4543
match: (?i:\b(Do(( While)|( Until))?|While|Case( Else)?|Else(If)?|For( Each)?|(I)?If|In|New|(Select )?Case|Then|To|Step|With)\b)
4644
- name: keyword.conditional.end.vba
4745
match: (?i:\b(End( )?If|End (Select|With)|Next|Wend|Loop(( While)|( Until))?|Exit (For|Do|While))\b)
4846
- name: keyword.control.vba
4947
match: (?i:(\b(Exit (Function|Property|Sub)|As|And|By(Ref|Val)|Goto|Is|Like|Mod|Not|On Error|Optional|Or|Resume Next|Stop|Xor|Eqv|Imp|TypeOf|AddressOf)\b)|(\b(End)\b(?=\n)))
48+
- name: keyword.io.vba
49+
match: (?i:\b(Open|Close|(Line )?Input|Lock|Unlock|Print|Seek|Width|Get|Put|Write)\b)
5050
- name: keyword.other.vba
5151
match: (?i:\b(Attribute|Call|End (Function|Property|Sub|Type|Enum)|(Const|Function|Property|Sub|Type|Enum)|Declare|PtrSafe|WithEvents|Event|RaiseEvent|Implements)\b)
52+
- name: keyword.other.option.vba
53+
match: (?i)\bOption (Base [01]|Compare (Binary|Text)|Explicit|Private Module)\b
5254
- name: keyword.other.visibility.vba
5355
match: (?i:\b(Private|Public|Friend)\b)
5456
- name: constant.language.vba
@@ -63,13 +65,13 @@ repository:
6365
begin: "(?i)^\\s*(BEGIN)\\b"
6466
beginCaptures:
6567
'1':
66-
name: "keyword.metadata.vba"
68+
name: "keyword.metadata.vba"
6769
end: "(?i)^\\s*(END)\\b"
6870
endCaptures:
6971
'0':
7072
name: "keyword.metadata.vba"
71-
patterns:
72-
- include: "source.vba"
73+
patterns:
74+
- include: "source.vba"
7375

7476
numbers:
7577
patterns:

0 commit comments

Comments
 (0)