diff --git a/package.json b/package.json index e4004d2..571014f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "frog", "displayName": "frog", "description": "The Oracle SQL workbench for VSCode", - "version": "0.0.11", + "version": "0.0.12", "publisher": "todie", "engines": { "vscode": "^1.17.0" diff --git a/src/sessionmanager.ts b/src/sessionmanager.ts index 5784983..97bbd36 100644 --- a/src/sessionmanager.ts +++ b/src/sessionmanager.ts @@ -34,10 +34,11 @@ export class SessionManager { public set currentConnection(c : ConnectionNode) { this.statusBarItem.text = c.name; if (this.dbSession) this.closeSession(); + this._currentConnection = c; } public get currentConnection() : ConnectionNode { - return this.currentConnection; + return this._currentConnection; } public isSessionActive() : boolean { @@ -51,10 +52,10 @@ export class SessionManager { this.dbSession = null; } - public check() { + public check() : boolean { if (!this.currentConnection) { vscode.window.showWarningMessage('No connection selected'); - return; + return false; } let extPath = vscode.extensions.getExtension("todie.frog").extensionPath; @@ -129,10 +130,11 @@ export class SessionManager { this.dbSession = null; }); + return true; } public execute(text : string, rowLimit : number) { - this.check(); + if (!this.check()) return; this.outputChannel.append("-- " + new Date() + " -------------------------------\n"); //Executing: '" + text + "'\n"); let input = { "sql": text, "rowLimit": rowLimit };