Skip to content

Fix broken syntax highlighting after the first submodule #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions languages/tlaplus-grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
}
},
"patterns": [
{
"include" : "#module"
},
{
"include": "#pluscal"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
"watch": "npm run compile -- --watch",
"pretest": "tsc -p ./",
"test": "node ./out/tests/runTest.js",
"test:tlaplus-grammar": "vscode-tmgrammar-test ./tests/suite/languages/tlaplus-grammar-test.tla -g ./languages/tlaplus-grammar.json -g ./languages/pluscal-grammar.json"
"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"
},
"devDependencies": {
"@types/glob": "^8.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/tla2tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const cmodsJarPath = path.resolve(__dirname, '../tools/' + TLA_CMODS_LIB_NAME);
const javaCmd = 'java' + (process.platform === 'win32' ? '.exe' : '');
const javaVersionChannel = new ToolOutputChannel('TLA+ Java version');
const TLA_TOOLS_STANDARD_MODULES = '/tla2sany/StandardModules';
const TLA_TOOLS_PLUSCAL_PARAM_SKIP_CFG_CREATION = "-nocfg";
const TLA_TOOLS_PLUSCAL_PARAM_SKIP_CFG_CREATION = '-nocfg';

let lastUsedJavaHome: string | undefined;
let cachedJavaPath: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/languages/GrammarTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Grammar tests are defined under [tests/suite/languages](.)

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).

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

## Run the tests
To run from the command line:
Expand Down
37 changes: 37 additions & 0 deletions tests/suite/languages/tlaplus-grammar-test-submodule.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SYNTAX TEST "source.tlaplus" "tlaplus language grammar testcase"

---- MODULE SubmoduleTest ----
// <---- comment.line
// ^^^^^^ keyword.other
// ^^^^^^^^^^^^^ entity.name.class
---- MODULE InnerModule1 ----
// <---- comment.line
// ^^^^^^ keyword.other
// ^^^^^^^^^^^^ entity.name.class

Op1 == FALSE
//<-- support.type.primitive
// ^^^^^ support.constant.tlaplus

====
// <---- comment.line

---- MODULE InnerModule2 ----
// <---- comment.line
// ^^^^^^ keyword.other
// ^^^^^^^^^^^^ entity.name.class

Op2 == FALSE
//<-- support.type.primitive
// ^^^^^ support.constant.tlaplus


====
// <---- comment.line

Op == FALSE
//<-- support.type.primitive
// ^^^^^ support.constant.tlaplus

====
// <---- comment.line
Loading