diff --git a/.vscode/settings.json b/.vscode/settings.json index e10b8e4542f2f17559c1f96caffc7ce5e6750f1e..51284b6c40da19a240724911b60bc78704d18fa4 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 5e304bec9eea3239463595aefa5f4098569b91dd..76ffdc348600edd137b32fd885fc9db15470e535 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 4ad0ac4a21a7eb334d3758dc8158c48f82fd27f6..c885a3d10510b9a60d2b18fa5b7118ac503c2acf 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 4e912e0a995901d3d5098c85c9166182ba2bd773..b0622cd3199f0471d4ac69d5dfe7a15ece3b9119 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 c686663d3502bf53e68bee9f6eddbf42301383f9..bbb1889512e78ef2d95dd33cebed9bf693aa18b4 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 dcf400510926612c0f559cecfbb40b2bdacdc76b..b3c4e80d182609594da331faf58b0e6534a4d364 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 }