Pass connectionid to registered commands from command line (#3861)

* pass connectionid to registered commands from commandline

* remove blank lines

* fix commandline unit test
This commit is contained in:
David Shiflet
2019-01-30 18:18:25 -05:00
committed by GitHub
parent d1fef24723
commit 8a7bbd1795
3 changed files with 12 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ export class CommandLineService implements ICommandLineProcessing {
} else {
self._connectionManagementService.connectIfNotConnected(self._connectionProfile, 'connection', true)
.then(() => {
self._commandService.executeCommand(self._commandName, self._connectionProfile).then(() => resolve(), error => reject(error));
self._commandService.executeCommand(self._commandName, self._connectionProfile.id).then(() => resolve(), error => reject(error));
}, error => {
reject(error);
});

View File

@@ -246,7 +246,7 @@ suite('commandLineService tests', () => {
connectionManagementService.setup(c => c.connectIfNotConnected(TypeMoq.It.is<ConnectionProfile>(p => p.serverName === 'myserver'), 'connection', true))
.returns(() => new Promise<string>((resolve, reject) => { resolve('unused'); }))
.verifiable(TypeMoq.Times.once());
commandService.setup(c => c.executeCommand('mycommand', TypeMoq.It.is<ConnectionProfile>(p => p.serverName === 'myserver')))
commandService.setup(c => c.executeCommand('mycommand', TypeMoq.It.isAnyString()))
.returns(() => TPromise.wrap(1))
.verifiable(TypeMoq.Times.once());
const configurationService = getConfigurationServiceMock(true);