Spaces:
No application file
No application file
| import * as vscode from 'vscode'; | |
| /** | |
| * AI Code Review Assistant VS Code Extension | |
| * | |
| * Features: | |
| */ | |
| let outputChannel: vscode.OutputChannel; | |
| let statusBarItem: vscode.StatusBarItem; | |
| export function activate(context: vscode.ExtensionContext) { | |
| outputChannel = vscode.window.createOutputChannel('AI Code Review Assistant VS Code Extension'); | |
| outputChannel.appendLine(`AI Code Review Assistant VS Code Extension v1.0.0 activated`); | |
| // Status bar | |
| statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100); | |
| statusBarItem.text = '$(zap) 8ffe362c'; | |
| statusBarItem.tooltip = 'AI Code Review Assistant VS Code Extension'; | |
| statusBarItem.command = '8ffe362c.activate'; | |
| statusBarItem.show(); | |
| context.subscriptions.push(statusBarItem); | |
| // Register commands | |
| let cmd0 = vscode.commands.registerCommand('8ffe362c.activate', () => { | |
| vscode.window.showInformationMessage('AI Code Review Assistant VS Code Extension: AI Code Review Assistant VS Code Extension: Activate executed'); | |
| outputChannel.appendLine(`[INFO] Command executed: AI Code Review Assistant VS Code Extension: Activate`); | |
| }); | |
| let cmd1 = vscode.commands.registerCommand('8ffe362c.settings', () => { | |
| vscode.window.showInformationMessage('AI Code Review Assistant VS Code Extension: AI Code Review Assistant VS Code Extension: Open Settings executed'); | |
| outputChannel.appendLine(`[INFO] Command executed: AI Code Review Assistant VS Code Extension: Open Settings`); | |
| }); | |
| let cmd2 = vscode.commands.registerCommand('8ffe362c.run', () => { | |
| vscode.window.showInformationMessage('AI Code Review Assistant VS Code Extension: AI Code Review Assistant VS Code Extension: Run executed'); | |
| outputChannel.appendLine(`[INFO] Command executed: AI Code Review Assistant VS Code 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('8ffe362c')) { | |
| const config = vscode.workspace.getConfiguration('8ffe362c'); | |
| const enabled = config.get<boolean>('enabled', true); | |
| if (enabled) { | |
| statusBarItem.show(); | |
| } else { | |
| statusBarItem.hide(); | |
| } | |
| outputChannel.appendLine(`[INFO] Configuration updated`); | |
| } | |
| }) | |
| ); | |
| outputChannel.appendLine(`[INFO] AI Code Review Assistant VS Code Extension ready`); | |
| vscode.window.showInformationMessage('AI Code Review Assistant VS Code Extension is now active!'); | |
| } | |
| export function deactivate() { | |
| outputChannel?.appendLine('AI Code Review Assistant VS Code Extension deactivated'); | |
| outputChannel?.dispose(); | |
| statusBarItem?.dispose(); | |
| } | |