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

added improved error messages when probcli is failing

parent 745644cd
Branches
Tags
No related merge requests found
......@@ -7,5 +7,5 @@
"source.fixAll.eslint": true
},
"languageServer.wdChecks": false,
"languageServer.probHome": "/home/sebastian/prob_prolog/probcli.sh"
"languageServer.probHome": "/home/sebastian/prb_prolog/probcli.sh"
}
\ No newline at end of file
......@@ -32,7 +32,8 @@ Please note that user settings overwrite workspace settings.
## Future plans
- Linter Support (via Server, is still in development by Mircosoft https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/)
- Quickfix support aká Code Completion
- Add feedback of failing prob cli to output
- Add snipptest
- Make startup time faster
- Switch to Java Server
## Release Notes
......
......@@ -26,7 +26,6 @@ export async function readErrors(errorPath: string): Promise<Map<string, Set<NDJ
let obj: NDJSON
try{
console.log(line)
obj = JSON.parse(line)
}catch(e){
throw Error(e.message + " at line " + line)
......
......@@ -179,7 +179,6 @@ 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, settings)
// console.log(command)
if (correctPath(settings.probHome)) {
exec(command, (err: string, stdout: string, stderr: string) => {
......@@ -194,13 +193,20 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
} else {
diagnostics = matchErrors(entry[1])
}
console.log("sending to " + entry[0])
connection.sendDiagnostics({ uri: entry[0], diagnostics });
}
}, function (err) {
connection.sendNotification("parse_error_prob", "there are things wrong with the parse results " + err)
});
if(!stdout.includes('Running ProB Command-line Interface'))
{
connection.sendNotification("path_error_prob", "could not call/reach probcli "+ command)
}
})
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment