Skip to content

Commit 250ef51

Browse files
Merge pull request #339 from FedericoPonzi/issue-284
Fix broken syntax highlighting after the first submodule
2 parents 9b9493f + fc0364f commit 250ef51

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

languages/tlaplus-grammar.json

+3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@
170170
}
171171
},
172172
"patterns": [
173+
{
174+
"include" : "#module"
175+
},
173176
{
174177
"include": "#pluscal"
175178
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
"watch": "npm run compile -- --watch",
508508
"pretest": "tsc -p ./",
509509
"test": "node ./out/tests/runTest.js",
510-
"test:tlaplus-grammar": "vscode-tmgrammar-test ./tests/suite/languages/tlaplus-grammar-test.tla -g ./languages/tlaplus-grammar.json -g ./languages/pluscal-grammar.json"
510+
"test:tlaplus-grammar": "vscode-tmgrammar-test ./tests/suite/languages/tlaplus-grammar-test.tla ./tests/suite/languages/tlaplus-grammar-test-submodule.tla -g ./languages/tlaplus-grammar.json -g ./languages/pluscal-grammar.json"
511511
},
512512
"devDependencies": {
513513
"@types/glob": "^8.1.0",

src/tla2tools.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const cmodsJarPath = path.resolve(__dirname, '../tools/' + TLA_CMODS_LIB_NAME);
3434
const javaCmd = 'java' + (process.platform === 'win32' ? '.exe' : '');
3535
const javaVersionChannel = new ToolOutputChannel('TLA+ Java version');
3636
const TLA_TOOLS_STANDARD_MODULES = '/tla2sany/StandardModules';
37-
const TLA_TOOLS_PLUSCAL_PARAM_SKIP_CFG_CREATION = "-nocfg";
37+
const TLA_TOOLS_PLUSCAL_PARAM_SKIP_CFG_CREATION = '-nocfg';
3838

3939
let lastUsedJavaHome: string | undefined;
4040
let cachedJavaPath: string | undefined;

tests/suite/languages/GrammarTests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Grammar tests are defined under [tests/suite/languages](.)
88

99
A grammar test is a test file that includes annotation of the expected assigned scopes. One example is the [tlaplus-grammar-test.tla](tlaplus-grammar-test.tla).
1010

11-
For more information on how to write a test see [vscode-tmgrammar-test](thttps://github.com/PanAeon/vscode-tmgrammar-test).
11+
For more information on how to write a test see [vscode-tmgrammar-test](https://github.com/PanAeon/vscode-tmgrammar-test).
1212

1313
## Run the tests
1414
To run from the command line:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SYNTAX TEST "source.tlaplus" "tlaplus language grammar testcase"
2+
3+
---- MODULE SubmoduleTest ----
4+
// <---- comment.line
5+
// ^^^^^^ keyword.other
6+
// ^^^^^^^^^^^^^ entity.name.class
7+
---- MODULE InnerModule1 ----
8+
// <---- comment.line
9+
// ^^^^^^ keyword.other
10+
// ^^^^^^^^^^^^ entity.name.class
11+
12+
Op1 == FALSE
13+
//<-- support.type.primitive
14+
// ^^^^^ support.constant.tlaplus
15+
16+
====
17+
// <---- comment.line
18+
19+
---- MODULE InnerModule2 ----
20+
// <---- comment.line
21+
// ^^^^^^ keyword.other
22+
// ^^^^^^^^^^^^ entity.name.class
23+
24+
Op2 == FALSE
25+
//<-- support.type.primitive
26+
// ^^^^^ support.constant.tlaplus
27+
28+
29+
====
30+
// <---- comment.line
31+
32+
Op == FALSE
33+
//<-- support.type.primitive
34+
// ^^^^^ support.constant.tlaplus
35+
36+
====
37+
// <---- comment.line

0 commit comments

Comments
 (0)