Spaces:
No application file
No application file
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.activate = activate; | |
| exports.deactivate = deactivate; | |
| const vscode = require("vscode"); | |
| /** | |
| * DevOps Infrastructure Code Snippets Extension | |
| * | |
| * Features: | |
| */ | |
| let outputChannel; | |
| let statusBarItem; | |
| function activate(context) { | |
| outputChannel = vscode.window.createOutputChannel('DevOps Infrastructure Code Snippets Extension'); | |
| outputChannel.appendLine(`DevOps Infrastructure Code Snippets Extension v1.0.0 activated`); | |
| // Status bar | |
| statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100); | |
| statusBarItem.text = '$(zap) 01b0940d'; | |
| statusBarItem.tooltip = 'DevOps Infrastructure Code Snippets Extension'; | |
| statusBarItem.command = '01b0940d.activate'; | |
| statusBarItem.show(); | |
| context.subscriptions.push(statusBarItem); | |
| // Register commands | |
| let cmd0 = vscode.commands.registerCommand('01b0940d.activate', () => { | |
| vscode.window.showInformationMessage('DevOps Infrastructure Code Snippets Extension: DevOps Infrastructure Code Snippets Extension: Activate executed'); | |
| outputChannel.appendLine(`[INFO] Command executed: DevOps Infrastructure Code Snippets Extension: Activate`); | |
| }); | |
| let cmd1 = vscode.commands.registerCommand('01b0940d.settings', () => { | |
| vscode.window.showInformationMessage('DevOps Infrastructure Code Snippets Extension: DevOps Infrastructure Code Snippets Extension: Open Settings executed'); | |
| outputChannel.appendLine(`[INFO] Command executed: DevOps Infrastructure Code Snippets Extension: Open Settings`); | |
| }); | |
| let cmd2 = vscode.commands.registerCommand('01b0940d.run', () => { | |
| vscode.window.showInformationMessage('DevOps Infrastructure Code Snippets Extension: DevOps Infrastructure Code Snippets Extension: Run executed'); | |
| outputChannel.appendLine(`[INFO] Command executed: DevOps Infrastructure Code Snippets Extension: Run`); | |
| }); | |
| context.subscriptions.push(cmd0); | |
| context.subscriptions.push(cmd1); | |
| context.subscriptions.push(cmd2); | |
| // Configuration change listener | |
| context.subscriptions.push( | |
| vscode.workspace.onDidChangeConfiguration(e => { | |
| if (e.affectsConfiguration('01b0940d')) { | |
| const config = vscode.workspace.getConfiguration('01b0940d'); | |
| const enabled = config.get('enabled', true); | |
| if (enabled) { | |
| statusBarItem.show(); | |
| } else { | |
| statusBarItem.hide(); | |
| } | |
| outputChannel.appendLine(`[INFO] Configuration updated`); | |
| } | |
| }) | |
| ); | |
| outputChannel.appendLine(`[INFO] DevOps Infrastructure Code Snippets Extension ready`); | |
| vscode.window.showInformationMessage('DevOps Infrastructure Code Snippets Extension is now active!'); | |
| } | |
| function deactivate() { | |
| outputChannel?.appendLine('DevOps Infrastructure Code Snippets Extension deactivated'); | |
| outputChannel?.dispose(); | |
| statusBarItem?.dispose(); | |
| } | |