|
|
|
@ -143,18 +143,26 @@ export function activate(context: vscode.ExtensionContext) {
|
|
|
|
|
|
|
|
|
|
context.subscriptions.push(disposable, registration);
|
|
|
|
|
|
|
|
|
|
function changeSession(node: ConnectionNode) {
|
|
|
|
|
currentConnection = node;
|
|
|
|
|
statusBarItem.text = node.name;
|
|
|
|
|
if (dbSession) {
|
|
|
|
|
dbSession.stdin.end();
|
|
|
|
|
dbSession = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vscode.commands.registerCommand('selectConnection', (node: ConnectionNode) => {
|
|
|
|
|
vscode.window.showInformationMessage(`You want to change the connection to '${node.name}'. Sure?`, 'Yes')
|
|
|
|
|
.then( (selection) => {
|
|
|
|
|
if (selection == 'Yes') {
|
|
|
|
|
currentConnection = node;
|
|
|
|
|
statusBarItem.text = node.name;
|
|
|
|
|
if (dbSession) {
|
|
|
|
|
dbSession.stdin.end();
|
|
|
|
|
dbSession = null;
|
|
|
|
|
if (!dbSession) {
|
|
|
|
|
changeSession(node)
|
|
|
|
|
} else {
|
|
|
|
|
vscode.window.showInformationMessage(`You want to change the connection to '${node.name}'. Sure?`, 'Yes')
|
|
|
|
|
.then( (selection) => {
|
|
|
|
|
if (selection == 'Yes') {
|
|
|
|
|
changeSession(node);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, (reason) => {})
|
|
|
|
|
}, (reason) => {})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|