From 8f8db742ff22b3359058470cd26ece7adbf4bd65 Mon Sep 17 00:00:00 2001 From: SeeBasTStick <sebastian.stock@hhu.de> Date: Thu, 21 May 2020 12:08:41 +0200 Subject: [PATCH] version 0.1.0 --- .vscode/settings.json | 3 +-- CHANGELOG.md | 9 ++++++++- README.md | 11 ++++++++++- package.json | 4 ++-- server/src/ErrorMatcher.ts | 2 +- server/src/server.ts | 14 ++++++-------- 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e10b8e4..51284b6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,5 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, - "languageServer.strictChecks": true, - "languageServer.wdChecks": true + "languageServer.wdChecks": false } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e304be..76ffdc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,4 +15,11 @@ - fixed bug in the package.json file leading to unnoticed server crash - added feedback when using an unreachable path -- added feedback when using a old version of proB \ No newline at end of file +- added feedback when using a old version of proB + + +## [0.1.0] + +- added more sound auto compeltion +- added WD cheks +- added strict checks \ No newline at end of file diff --git a/README.md b/README.md index 4ad0ac4..c885a3d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ 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.strictChecks`: to enable/disable stricter Checks. Make sure to enable/disable for the current workspace too. ## Bugs @@ -52,4 +54,11 @@ This extension contributes the following settings: - fixed bug in the package.json file leading to unnoticed server crash - added feedback when using an unreachable path -- added feedback when using a old version of proB \ No newline at end of file +- added feedback when using a old version of proB + + +### 0.1.0 + +- added more sound auto compeltion +- added WD cheks +- added strict checks \ No newline at end of file diff --git a/package.json b/package.json index 4e912e0..b0622cd 100644 --- a/package.json +++ b/package.json @@ -58,13 +58,13 @@ "languageServer.wdChecks": { "scope": "window", "type": "boolean", - "default": "false", + "default": true, "description": "Option for WD Checks" }, "languageServer.strictChecks": { "scope": "window", "type": "boolean", - "default": "false", + "default": false, "description": "Option for stricter Checks" } } diff --git a/server/src/ErrorMatcher.ts b/server/src/ErrorMatcher.ts index c686663..bbb1889 100644 --- a/server/src/ErrorMatcher.ts +++ b/server/src/ErrorMatcher.ts @@ -18,7 +18,7 @@ export class ErrorMatcher{ }); - + for await (const line of rl) { let obj : XOR<Error, Warning> = JSON.parse(line) let diagnostic : Diagnostic diff --git a/server/src/server.ts b/server/src/server.ts index dcf4005..b3c4e80 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -139,13 +139,12 @@ documents.onDidClose(e => { }); documents.onDidSave(change => { - validateTextDocument(change.document) }) async function validateTextDocument(textDocument: TextDocument): Promise<void> { - globalSettings = await getDocumentSettings(textDocument.uri) // Waiting for correct setting; otherwise allways default + let settings = await getDocumentSettings(textDocument.uri) // Waiting for correct setting; otherwise allways default let documentPath:path.ParsedPath = path.parse(URI.parse(textDocument.uri).path); @@ -156,7 +155,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> { fs.writeFile(errorPath, "", () =>{}) //Insure a clean error file - let command:string = getCommand(URI.parse(textDocument.uri).path, errorPath) + let command:string = getCommand(URI.parse(textDocument.uri).path, errorPath, settings) let diagnostics : Array<Diagnostic> = new Array() let diagnosticsPromise : Promise<Set<Diagnostic>> @@ -179,19 +178,18 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> { } -function getCommand(documentPath : string, errorPath : string) : string{ +function getCommand(documentPath : string, errorPath : string, settings: Settings) : string{ let wdCmd = "" let strict = "" - console.log(globalSettings.wdChecks + " " + globalSettings.strictChecks) - if(globalSettings.wdChecks){ + if(settings.wdChecks == true){ wdCmd = " -wd-check -release_java_parser " } - if(globalSettings.strictChecks){ + if(settings.strictChecks == true){ strict = " -p STRICT_CLASH_CHECKING TRUE -p TYPE_CHECK_DEFINITIONS TRUE -lint " } - return globalSettings.probHome + ' -p MAX_INITIALISATIONS 0 -version ' + strict + wdCmd + documentPath +" -p " + "NDJSON_ERROR_LOG_FILE " + errorPath + return settings.probHome + ' -p MAX_INITIALISATIONS 0 -version ' + strict + wdCmd + documentPath +" -p " + "NDJSON_ERROR_LOG_FILE " + errorPath } -- GitLab