Skip to content

Commit 2c524db

Browse files
authored
Merge pull request #389 from jpogran/GH-373-convert-to-features
(GH-373) Convert Commands to Features
2 parents e5ff241 + 54de673 commit 2c524db

12 files changed

+247
-349
lines changed

src/PuppetStatusBar.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ export class PuppetStatusBar {
88
statusBarItem: vscode.StatusBarItem;
99
private logger: ILogger;
1010

11-
constructor(langID: string, logger: ILogger) {
11+
constructor(langID: string, context:vscode.ExtensionContext, logger: ILogger) {
1212
this.logger = logger;
13+
context.subscriptions.push(vscode.commands.registerCommand(PuppetCommandStrings.PuppetShowConnectionMenuCommandId,
14+
() => { PuppetStatusBar.showConnectionMenu(); }
15+
));
1316
this.statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 1);
1417
this.statusBarItem.command = PuppetCommandStrings.PuppetShowConnectionMenuCommandId;
1518
this.statusBarItem.show();

src/commands/pdk/pdkNewClassCommand.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/commands/pdk/pdkNewModuleCommand.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/commands/pdk/pdkNewTaskCommand.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/commands/pdk/pdkTestCommand.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/commands/pdk/pdkValidateCommand.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/commands/pdkcommands.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/commands/puppetcommands.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/connection.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { PuppetStatusBar } from './PuppetStatusBar';
99
import { PuppetLanguageClient } from './PuppetLanguageClient';
1010
import { ConnectionConfiguration } from './configuration';
1111
import { reporter } from './telemetry/telemetry';
12-
import { PuppetVersionRequest } from './messages';
12+
import { PuppetVersionRequest, PuppetCommandStrings } from './messages';
1313

1414
const langID = 'puppet'; // don't change this
1515
const documentSelector = { scheme: 'file', language: langID };
@@ -44,6 +44,13 @@ export class ConnectionManager implements IConnectionManager {
4444
this.connectionStatus = ConnectionStatus.NotStarted;
4545
this.statusBarItem = statusBar;
4646
this.connectionConfiguration = connectionConfiguration;
47+
context.subscriptions.push(vscode.commands.registerCommand(PuppetCommandStrings.PuppetShowConnectionLogsCommandId,
48+
() => { this.showLogger(); }
49+
));
50+
51+
context.subscriptions.push(vscode.commands.registerCommand(PuppetCommandStrings.PuppetRestartSessionCommandId,
52+
() => { this.restartConnection(); }
53+
));
4754
}
4855

4956
public get status(): ConnectionStatus {

0 commit comments

Comments
 (0)