@@ -41,6 +41,8 @@ export interface IConnectionManager {
4141 status : ConnectionStatus ;
4242 languageClient : LanguageClient ;
4343 showConnectionMenu ( ) ;
44+ showLogger ( ) ;
45+ restartConnection ( connectionConfig ?: IConnectionConfiguration ) ;
4446}
4547
4648export class ConnectionManager implements IConnectionManager {
@@ -60,6 +62,9 @@ export class ConnectionManager implements IConnectionManager {
6062 public get languageClient ( ) : LanguageClient {
6163 return this . languageServerClient ;
6264 }
65+ public showLogger ( ) {
66+ this . logger . show ( )
67+ }
6368
6469 constructor ( context : vscode . ExtensionContext , logger : Logger ) {
6570 this . logger = logger ;
@@ -387,10 +392,12 @@ export class ConnectionManager implements IConnectionManager {
387392 } ) ;
388393 }
389394
390-
391- private restartConnection ( connectionConfig ?: IConnectionConfiguration ) {
392- this . stop ( ) ;
393- this . start ( connectionConfig ) ;
395+ public restartConnection ( connectionConfig ?: IConnectionConfiguration ) {
396+ if ( connectionConfig == undefined ) {
397+ connectionConfig = new ConnectionConfiguration ( this . extensionContext ) ;
398+ }
399+ this . stop ( ) ;
400+ this . start ( connectionConfig ) ;
394401 }
395402
396403 private createStatusBarItem ( ) {
@@ -413,21 +420,16 @@ export class ConnectionManager implements IConnectionManager {
413420 public showConnectionMenu ( ) {
414421 var menuItems : ConnectionMenuItem [ ] = [ ] ;
415422
416- let currentConnectionConfig = this . connectionConfiguration ;
417-
418423 menuItems . push (
419424 new ConnectionMenuItem (
420425 "Restart Current Puppet Session" ,
421- ( ) => {
422- let configuration = new ConnectionConfiguration ( this . extensionContext ) ;
423- this . restartConnection ( configuration ) ;
424- } ) ,
426+ ( ) => { vscode . commands . executeCommand ( messages . PuppetCommandStrings . PuppetRestartSessionCommandId ) ; } ) ,
425427 )
426428
427429 menuItems . push (
428430 new ConnectionMenuItem (
429431 "Show Puppet Session Logs" ,
430- ( ) => { this . logger . show ( ) ; } ) ,
432+ ( ) => { vscode . commands . executeCommand ( messages . PuppetCommandStrings . PuppetShowConnectionLogsCommandId ) ; } ) ,
431433 )
432434
433435 vscode
0 commit comments