| import * as vscode from 'vscode';
|
|
|
| |
| |
| |
| |
| |
|
|
|
|
| let outputChannel: vscode.OutputChannel;
|
| let statusBarItem: vscode.StatusBarItem;
|
|
|
| export function activate(context: vscode.ExtensionContext) {
|
| outputChannel = vscode.window.createOutputChannel('VS Code Extension: API Contract Testing and Mock Server Generator');
|
| outputChannel.appendLine(`VS Code Extension: API Contract Testing and Mock Server Generator v1.0.0 activated`);
|
|
|
|
|
| statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100);
|
| statusBarItem.text = '$(zap) 515f177e';
|
| statusBarItem.tooltip = 'VS Code Extension: API Contract Testing and Mock Server Generator';
|
| statusBarItem.command = '515f177e.activate';
|
| statusBarItem.show();
|
| context.subscriptions.push(statusBarItem);
|
|
|
|
|
| let cmd0 = vscode.commands.registerCommand('515f177e.activate', () => {
|
| vscode.window.showInformationMessage('VS Code Extension: API Contract Testing and Mock Server Generator: VS Code Extension: API Contract Testing and Mock Server Generator: Activate executed');
|
| outputChannel.appendLine(`[INFO] Command executed: VS Code Extension: API Contract Testing and Mock Server Generator: Activate`);
|
| });
|
| let cmd1 = vscode.commands.registerCommand('515f177e.settings', () => {
|
| vscode.window.showInformationMessage('VS Code Extension: API Contract Testing and Mock Server Generator: VS Code Extension: API Contract Testing and Mock Server Generator: Open Settings executed');
|
| outputChannel.appendLine(`[INFO] Command executed: VS Code Extension: API Contract Testing and Mock Server Generator: Open Settings`);
|
| });
|
| let cmd2 = vscode.commands.registerCommand('515f177e.run', () => {
|
| vscode.window.showInformationMessage('VS Code Extension: API Contract Testing and Mock Server Generator: VS Code Extension: API Contract Testing and Mock Server Generator: Run executed');
|
| outputChannel.appendLine(`[INFO] Command executed: VS Code Extension: API Contract Testing and Mock Server Generator: Run`);
|
| });
|
| context.subscriptions.push(cmd0);
|
| context.subscriptions.push(cmd1);
|
| context.subscriptions.push(cmd2);
|
|
|
|
|
| context.subscriptions.push(
|
| vscode.workspace.onDidChangeConfiguration(e => {
|
| if (e.affectsConfiguration('515f177e')) {
|
| const config = vscode.workspace.getConfiguration('515f177e');
|
| const enabled = config.get<boolean>('enabled', true);
|
| if (enabled) {
|
| statusBarItem.show();
|
| } else {
|
| statusBarItem.hide();
|
| }
|
| outputChannel.appendLine(`[INFO] Configuration updated`);
|
| }
|
| })
|
| );
|
|
|
| outputChannel.appendLine(`[INFO] VS Code Extension: API Contract Testing and Mock Server Generator ready`);
|
| vscode.window.showInformationMessage('VS Code Extension: API Contract Testing and Mock Server Generator is now active!');
|
| }
|
|
|
| export function deactivate() {
|
| outputChannel?.appendLine('VS Code Extension: API Contract Testing and Mock Server Generator deactivated');
|
| outputChannel?.dispose();
|
| statusBarItem?.dispose();
|
| }
|
|
|