Refactoring
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "frog",
|
"name": "frog",
|
||||||
"displayName": "frog",
|
"displayName": "frog",
|
||||||
"description": "The Oracle SQL workbench for VSCode",
|
"description": "The Oracle SQL workbench for VSCode",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"publisher": "todie",
|
"publisher": "todie",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.17.0"
|
"vscode": "^1.17.0"
|
||||||
|
@@ -34,10 +34,11 @@ export class SessionManager {
|
|||||||
public set currentConnection(c : ConnectionNode) {
|
public set currentConnection(c : ConnectionNode) {
|
||||||
this.statusBarItem.text = c.name;
|
this.statusBarItem.text = c.name;
|
||||||
if (this.dbSession) this.closeSession();
|
if (this.dbSession) this.closeSession();
|
||||||
|
this._currentConnection = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get currentConnection() : ConnectionNode {
|
public get currentConnection() : ConnectionNode {
|
||||||
return this.currentConnection;
|
return this._currentConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public isSessionActive() : boolean {
|
public isSessionActive() : boolean {
|
||||||
@@ -51,10 +52,10 @@ export class SessionManager {
|
|||||||
this.dbSession = null;
|
this.dbSession = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public check() {
|
public check() : boolean {
|
||||||
if (!this.currentConnection) {
|
if (!this.currentConnection) {
|
||||||
vscode.window.showWarningMessage('No connection selected');
|
vscode.window.showWarningMessage('No connection selected');
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let extPath = vscode.extensions.getExtension("todie.frog").extensionPath;
|
let extPath = vscode.extensions.getExtension("todie.frog").extensionPath;
|
||||||
@@ -129,10 +130,11 @@ export class SessionManager {
|
|||||||
this.dbSession = null;
|
this.dbSession = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public execute(text : string, rowLimit : number) {
|
public execute(text : string, rowLimit : number) {
|
||||||
this.check();
|
if (!this.check()) return;
|
||||||
|
|
||||||
this.outputChannel.append("-- " + new Date() + " -------------------------------\n"); //Executing: '" + text + "'\n");
|
this.outputChannel.append("-- " + new Date() + " -------------------------------\n"); //Executing: '" + text + "'\n");
|
||||||
let input = { "sql": text, "rowLimit": rowLimit };
|
let input = { "sql": text, "rowLimit": rowLimit };
|
||||||
|
Reference in New Issue
Block a user