File size: 3,130 Bytes
01e510c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"use strict";
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();
}