From 8ef3dfb107001e885b83868e32b7dd3e5b48b93a Mon Sep 17 00:00:00 2001 From: Dmitry Maslennikov Date: Mon, 12 Aug 2019 09:03:59 +0300 Subject: [PATCH] small fixes in syntax highlighting --- syntaxes/objectscript.tmLanguage.json | 14 +++++++++----- test/extension.test.ts | 16 ++++++++-------- test/index.ts | 18 +++++++++--------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/syntaxes/objectscript.tmLanguage.json b/syntaxes/objectscript.tmLanguage.json index 08b3dd7d..cb3d5090 100644 --- a/syntaxes/objectscript.tmLanguage.json +++ b/syntaxes/objectscript.tmLanguage.json @@ -4,7 +4,7 @@ "scopeName": "source.objectscript", "patterns": [ { - "match": "^(ROUTINE)\\s(\\b[a-zA-Z0-9]+\\b)", + "match": "^(ROUTINE)\\s(\\b[a-zA-Z0-9.]+\\b)", "captures": { "1": { "name": "keyword.control" }, "2": { "name": "entity.name.class" } @@ -98,11 +98,11 @@ "commands": { "patterns": [ { - "match": "(?i)(?<=\\s)\\b(BREAK|B|SET|S|DO|D|KILL|K|GOTO|G|READ|R|WRITE|W|OPEN|O|USE|U|CLOSE|C|CONTINUE|FOR|F|HALT|H|HANG|JOB|J|MERGE|M|NEW|N|QUIT|Q|RETURN|RET|TSTART|TS|TCOMMIT|TC|TROLLBACK|TRO|THROW|VIEW|V|XECUTE|X|ZKILL|ZL|ZNSPACE|ZN|ZTRAP|ZWRITE|ZW|ZZDUMP|ZZWRITE)\\b(?=( (?![=+-]|\\&|\\|)|:|$))", + "match": "(?i)(?<=\\s|\\.)\\b(BREAK|B|SET|S|DO|D|KILL|K|GOTO|G|READ|R|WRITE|W|OPEN|O|USE|U|CLOSE|C|CONTINUE|FOR|F|HALT|H|HANG|JOB|J|MERGE|M|NEW|N|QUIT|Q|RETURN|RET|TSTART|TS|TCOMMIT|TC|TROLLBACK|TRO|THROW|VIEW|V|XECUTE|X|ZKILL|ZL|ZNSPACE|ZN|ZTRAP|ZWRITE|ZW|ZZDUMP|ZZWRITE)\\b(?=( (?![=+-]|\\&|\\|)|:|$))", "captures": { "1": { "name": "keyword.control.objectscript" } } }, { - "match": "(?i)(?<=\\s)\\b(LOCK|L)\\b(?=( (?![=]|\\&|\\|)|:|$))", + "match": "(?i)(?<=\\s|\\.)\\b(LOCK|L)\\b(?=( (?![=]|\\&|\\|)|:|$))", "captures": { "1": { "name": "keyword.control.objectscript" } } } ] @@ -110,7 +110,7 @@ "control-commands": { "patterns": [ { - "match": "(?i)(?<=\\s)\\b(IF|I|WHILE|FOR|F|TRY|CATCH|ELSE|E|ELSEIF)\\b(?=( (?![=+-]|\\&|\\|)|:|$))", + "match": "(?i)(?<=\\s|\\.)\\b(IF|I|WHILE|FOR|F|TRY|CATCH|ELSE|E|ELSEIF)\\b(?=( (?![=+-]|\\&|\\|)|:|$))", "captures": { "1": { "name": "keyword.control.objectscript" } } } ] @@ -214,9 +214,13 @@ "name": "variable.name.objectscrip" }, { - "match": "\\^%?[a-zA-Z0-9]+", + "match": "\\^%?[a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)*", "name": "variable.name.global.objectscrip" }, + { + "match": "(?i)\\$system(.[a-zA-Z0-9]+)*", + "name": "entity.name.function.system.objectscript" + }, { "match": "\\$[a-zA-Z0-9]+", "name": "entity.name.function.system.objectscript" diff --git a/test/extension.test.ts b/test/extension.test.ts index e852319a..8e2701db 100644 --- a/test/extension.test.ts +++ b/test/extension.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +// import * as assert from "assert"; // You can import and use all API from the 'vscode' module // as well as import your extension to test it @@ -6,10 +6,10 @@ import * as assert from "assert"; // import * as myExtension from '../extension'; // Defines a Mocha test suite to group tests of similar kind together -suite("Extension Tests", () => { - // Defines a Mocha unit test - test("Something 1", () => { - assert.equal(-1, [1, 2, 3].indexOf(5)); - assert.equal(-1, [1, 2, 3].indexOf(0)); - }); -}); +// suite("Extension Tests", () => { +// // Defines a Mocha unit test +// test("Something 1", () => { +// assert.equal(-1, [1, 2, 3].indexOf(5)); +// assert.equal(-1, [1, 2, 3].indexOf(0)); +// }); +// }); diff --git a/test/index.ts b/test/index.ts index 109e5b63..2d086a22 100644 --- a/test/index.ts +++ b/test/index.ts @@ -10,14 +10,14 @@ // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. -import * as testRunner from "vscode/lib/testrunner"; +// import * as testRunner from "vscode/lib/testrunner"; -// You can directly control Mocha options by configuring the test runner below -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options -// for more info -testRunner.configure({ - ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true, // colored output from test results -}); +// // You can directly control Mocha options by configuring the test runner below +// // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options +// // for more info +// testRunner.configure({ +// ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) +// useColors: true, // colored output from test results +// }); -module.exports = testRunner; +// module.exports = testRunner;