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

bug fix regarding wrongly shown bug

parent d023c2d0
Branches
No related tags found
No related merge requests found
......@@ -71,4 +71,10 @@
## [0.6.3]
- fixed recognition of failing probcli
\ No newline at end of file
- fixed recognition of failing probcli
## [0.6.4]
- fixed bug where sometimes changes lead to wrong represantation of mistakes
\ No newline at end of file
......@@ -104,4 +104,9 @@ Please note that user settings overwrite workspace settings.
### 0.6.3
- fixed recognition of failing probcli
\ No newline at end of file
- fixed recognition of failing probcli
### 0.6.4
- fixed bug where sometimes changes lead to wrong represantation of mistakes
\ No newline at end of file
......@@ -160,6 +160,13 @@ documents.onDidSave(change => {
validateTextDocument(change.document)
})
documents.onDidChangeContent(change => {
// validateTextDocument(change.document);
});
async function validateTextDocument(textDocument: TextDocument): Promise<void> {
let settings = await getDocumentSettings(textDocument.uri) // Waiting for correct setting; otherwise allways default
......@@ -176,8 +183,9 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
fs.mkdirSync(errorDic);
}
fs.writeFile(errorPath, "", () => { }) //Insure a clean error file
fs.writeFile(errorPath, "", () => { }) //Insure a clean error file
//fs.writeFileSync(errorPath,"",{encoding:'utf8',flag:'w'})
let command: string = getCommand(URI.parse(textDocument.uri).path, errorPath, settings)
// console.log(command)
if (correctPath(settings.probHome)) {
......@@ -186,14 +194,19 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
errorMap.then(function (result: Map<string, Set<NDJSON>>) {
let diagnostics: Array<Diagnostic> = new Array()
for (let entry of result) {
if (entry[0] == textDocument.uri) {
diagnostics = matchErrors(entry[1], textDocument)
} else {
diagnostics = matchErrors(entry[1])
if(result.size != 0)
{
for (let entry of result) {
if (entry[0] == textDocument.uri) {
diagnostics = matchErrors(entry[1], textDocument)
} else {
diagnostics = matchErrors(entry[1])
}
connection.sendDiagnostics({ uri: entry[0], diagnostics });
}
connection.sendDiagnostics({ uri: entry[0], diagnostics });
}
else{
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
}
}, function (err) {
......@@ -210,6 +223,9 @@ async function validateTextDocument(textDocument: TextDocument): Promise<void> {
})
}
fs.writeFile(errorPath, "", () => { }) //Insure a clean error file
}
......@@ -271,6 +287,7 @@ connection.onCompletion(
//Can be used to enrich completion with more infos
connection.onCompletionResolve(
(item: CompletionItem) => { return item })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment