|
|
@ -69,6 +69,8 @@ export class SessionManager {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
let json = JSON.parse(outputBuffer);
|
|
|
|
let json = JSON.parse(outputBuffer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const editor = vscode.window.activeTextEditor;
|
|
|
|
|
|
|
|
const document = editor.document;
|
|
|
|
const diagnostics = [];
|
|
|
|
const diagnostics = [];
|
|
|
|
let cd = json['columnDefinitions']
|
|
|
|
let cd = json['columnDefinitions']
|
|
|
|
|
|
|
|
|
|
|
@ -79,9 +81,6 @@ export class SessionManager {
|
|
|
|
if (json['userErrors']) {
|
|
|
|
if (json['userErrors']) {
|
|
|
|
this.outputChannel.append("Errors found:\n");
|
|
|
|
this.outputChannel.append("Errors found:\n");
|
|
|
|
|
|
|
|
|
|
|
|
const editor = vscode.window.activeTextEditor;
|
|
|
|
|
|
|
|
const document = editor.document;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let error of json['userErrors'][0]['lines']) {
|
|
|
|
for (let error of json['userErrors'][0]['lines']) {
|
|
|
|
let range = document.lineAt(editor.selection.start.line + error['line'] - 1).range;
|
|
|
|
let range = document.lineAt(editor.selection.start.line + error['line'] - 1).range;
|
|
|
|
let diagnostic = new vscode.Diagnostic(range, error['text'], vscode.DiagnosticSeverity.Error);
|
|
|
|
let diagnostic = new vscode.Diagnostic(range, error['text'], vscode.DiagnosticSeverity.Error);
|
|
|
@ -91,7 +90,6 @@ export class SessionManager {
|
|
|
|
this.outputChannel.append(error['line'] + ": " + error['text'] + "\n");
|
|
|
|
this.outputChannel.append(error['line'] + ": " + error['text'] + "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.diagnosticCollection.set(document.uri, diagnostics);
|
|
|
|
|
|
|
|
} else if (json['exception']) {
|
|
|
|
} else if (json['exception']) {
|
|
|
|
this.outputChannel.append("Exception caught: " + json['exceptionMessage'] + "\n");
|
|
|
|
this.outputChannel.append("Exception caught: " + json['exceptionMessage'] + "\n");
|
|
|
|
} else if ("affectedRows" in json) {
|
|
|
|
} else if ("affectedRows" in json) {
|
|
|
@ -111,6 +109,7 @@ export class SessionManager {
|
|
|
|
this.outputChannel.append("Query successful.\n");
|
|
|
|
this.outputChannel.append("Query successful.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.diagnosticCollection.set(document.uri, diagnostics);
|
|
|
|
this.outputChannel.append("-- " + new Date() + " -------------------------------\n");
|
|
|
|
this.outputChannel.append("-- " + new Date() + " -------------------------------\n");
|
|
|
|
outputBuffer = "";
|
|
|
|
outputBuffer = "";
|
|
|
|
this.statusBarItem.text = this.currentConnection.name + " (Connected)";
|
|
|
|
this.statusBarItem.text = this.currentConnection.name + " (Connected)";
|
|
|
|