Small changes

master
Thorsten Muerell 7 years ago
parent 41cb0c8eda
commit aed27e72be

@ -20,19 +20,19 @@
"commands": [ "commands": [
{ {
"command": "frog.executeSnippet", "command": "frog.executeSnippet",
"title": "Execute SQL Snippet" "title": "Frog: Execute SQL Snippet"
}, },
{ {
"command": "frog.compileFile", "command": "frog.compileFile",
"title": "Compiles the current file" "title": "Frog: Compiles the current file"
}, },
{ {
"command": "frog.selectConnection", "command": "frog.selectConnection",
"title": "Selects the connection to use" "title": "Frog: Selects the connection to use"
}, },
{ {
"command": "frog.setRowLimit", "command": "frog.setRowLimit",
"title": "Sets the row limit" "title": "Frog: Sets the row limit"
} }
], ],
"keybindings": [ "keybindings": [

@ -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)";

Loading…
Cancel
Save