Skip to content

Commit aa6500c

Browse files
author
Lukas Neubert
authored
syntax highlighting for comments and grammar test structure (#6)
1 parent cd83af9 commit aa6500c

File tree

6 files changed

+252
-2
lines changed

6 files changed

+252
-2
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ on:
77
- master
88

99
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: "14"
17+
- name: Install dependencies
18+
run: npm install
19+
- name: Test
20+
run: npm run test
21+
1022
compile-and-package:
1123
runs-on: ubuntu-latest
1224
steps:
@@ -20,6 +32,7 @@ jobs:
2032
run: npm run compile
2133
- name: VSCE package
2234
run: npm run package
35+
2336
code-style:
2437
runs-on: ubuntu-latest
2538
steps:

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.github/
22
.vscode/
33
src/
4+
**/tests/**
45
**/*.map
56
.gitignore
67
tsconfig.json

package-lock.json

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

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"compile": "tsc -p ./",
4848
"watch": "tsc -watch -p ./",
4949
"lint": "eslint .",
50+
"test": "vscode-tmgrammar-test -s source.vba -g syntaxes/vba.tmLanguage.json -t \"syntaxes/tests/*.bas\"",
5051
"package": "vsce package"
5152
},
5253
"devDependencies": {
@@ -56,6 +57,7 @@
5657
"@typescript-eslint/parser": "^4.32",
5758
"eslint": "^7.32",
5859
"typescript": "^4.4.3",
59-
"vsce": "^1.100.0"
60+
"vsce": "^1.100.0",
61+
"vscode-tmgrammar-test": "^0.0.11"
6062
}
6163
}

syntaxes/tests/comment.bas

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
' SYNTAX TEST "source.vba" "comment"
2+
' my comment
3+
' ^^^^^^^^^^^^ comment.line

syntaxes/vba.tmLanguage.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"scopeName": "source.vba",
3+
"fileTypes": [
4+
".bas",
5+
".cls",
6+
".frm"
7+
],
8+
"patterns": [
9+
{ "include": "#comments" }
10+
],
11+
"repository": {
12+
"comments": {
13+
"name": "comment.line",
14+
"begin": "'",
15+
"end": "$"
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)