From f216464263d94b7bf8211e945fb711e07e5a9050 Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@uni-duesseldorf.de> Date: Mon, 25 May 2020 11:47:04 +0200 Subject: [PATCH] add languageServer.performanceHints option --- README.md | 3 ++- package.json | 6 ++++++ server/src/server.ts | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e22d8c..b78b438 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,9 @@ Compiler support for b/eventb via ProB. You need a nightly build of ProB to full This extension contributes the following settings: * `languageServer.probHome`: to set the path to ProB -* `languageServer.wdChecks`: to enable/disable WDChecks. Make sure to enable/disable for the current workspace too. +* `languageServer.wdChecks`: to enable/disable WD (Well-Definedness) Checks. Make sure to enable/disable for the current workspace too. * `languageServer.strictChecks`: to enable/disable stricter Checks. Make sure to enable/disable for the current workspace too. +* `languageServer.performanceHints`: to enable/disable performance-related Hints. Make sure to enable/disable for the current workspace too. Please note that user settings overwrite workspace settings. diff --git a/package.json b/package.json index 78af215..5bbc4c4 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,12 @@ "type": "boolean", "default": false, "description": "Option for stricter Checks" + }, + "languageServer.performanceHints": { + "scope": "window", + "type": "boolean", + "default": true, + "description": "Option for performance-related Hints" } } }, diff --git a/server/src/server.ts b/server/src/server.ts index da95a95..f7ace0d 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -181,6 +181,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> { function getCommand(documentPath : string, errorPath : string, settings: Settings) : string{ let wdCmd = "" let strict = "" + let perf = "" if(settings.wdChecks == true){ wdCmd = " -wd-check -release_java_parser " } @@ -189,7 +190,11 @@ function getCommand(documentPath : string, errorPath : string, settings: Setting strict = " -p STRICT_CLASH_CHECKING TRUE -p TYPE_CHECK_DEFINITIONS TRUE -lint " } - return settings.probHome + ' -p MAX_INITIALISATIONS 0 -version ' + strict + wdCmd + documentPath +" -p " + "NDJSON_ERROR_LOG_FILE " + errorPath + if(settings.performanceHints == true){ + perf = " -p PERFORMANCE_INFO TRUE " + } + + return settings.probHome + ' -p MAX_INITIALISATIONS 0 -version ' + perf + strict + wdCmd + documentPath +" -p " + "NDJSON_ERROR_LOG_FILE " + errorPath } -- GitLab