Skip to content
Snippets Groups Projects
Commit 8f8db742 authored by SeeBasTStick's avatar SeeBasTStick
Browse files

version 0.1.0

parent f40b711a
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": true
}, },
"languageServer.strictChecks": true, "languageServer.wdChecks": false
"languageServer.wdChecks": true
} }
\ No newline at end of file
...@@ -16,3 +16,10 @@ ...@@ -16,3 +16,10 @@
- fixed bug in the package.json file leading to unnoticed server crash - fixed bug in the package.json file leading to unnoticed server crash
- added feedback when using an unreachable path - added feedback when using an unreachable path
- added feedback when using a old version of proB - 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
...@@ -18,6 +18,8 @@ Compiler support for b/eventb via ProB. You need a nightly build of ProB to full ...@@ -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: This extension contributes the following settings:
* `languageServer.probHome`: to set the path to ProB * `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 ## Bugs
...@@ -53,3 +55,10 @@ This extension contributes the following settings: ...@@ -53,3 +55,10 @@ This extension contributes the following settings:
- fixed bug in the package.json file leading to unnoticed server crash - fixed bug in the package.json file leading to unnoticed server crash
- added feedback when using an unreachable path - added feedback when using an unreachable path
- added feedback when using a old version of proB - 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
...@@ -58,13 +58,13 @@ ...@@ -58,13 +58,13 @@
"languageServer.wdChecks": { "languageServer.wdChecks": {
"scope": "window", "scope": "window",
"type": "boolean", "type": "boolean",
"default": "false", "default": true,
"description": "Option for WD Checks" "description": "Option for WD Checks"
}, },
"languageServer.strictChecks": { "languageServer.strictChecks": {
"scope": "window", "scope": "window",
"type": "boolean", "type": "boolean",
"default": "false", "default": false,
"description": "Option for stricter Checks" "description": "Option for stricter Checks"
} }
} }
......
...@@ -139,13 +139,12 @@ documents.onDidClose(e => { ...@@ -139,13 +139,12 @@ documents.onDidClose(e => {
}); });
documents.onDidSave(change => { documents.onDidSave(change => {
validateTextDocument(change.document) validateTextDocument(change.document)
}) })
async function validateTextDocument(textDocument: TextDocument): Promise<void> { 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); let documentPath:path.ParsedPath = path.parse(URI.parse(textDocument.uri).path);
...@@ -156,7 +155,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> { ...@@ -156,7 +155,7 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
fs.writeFile(errorPath, "", () =>{}) //Insure a clean error file 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 diagnostics : Array<Diagnostic> = new Array()
let diagnosticsPromise : Promise<Set<Diagnostic>> let diagnosticsPromise : Promise<Set<Diagnostic>>
...@@ -179,19 +178,18 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> { ...@@ -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 wdCmd = ""
let strict = "" let strict = ""
console.log(globalSettings.wdChecks + " " + globalSettings.strictChecks) if(settings.wdChecks == true){
if(globalSettings.wdChecks){
wdCmd = " -wd-check -release_java_parser " 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 " 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
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment