1 import * as vscode from 'vscode';
3 import {registerMLIRExtensions} from './MLIR/mlir';
4 import {MLIRContext} from './mlirContext';
5 import {registerPDLLExtensions} from './PDLL/pdll';
8 * This method is called when the extension is activated. The extension is
9 * activated the very first time a command is executed.
11 export function activate(context: vscode.ExtensionContext) {
12 const outputChannel = vscode.window.createOutputChannel('MLIR');
13 context.subscriptions.push(outputChannel);
15 const mlirContext = new MLIRContext();
16 context.subscriptions.push(mlirContext);
18 // Initialize the commands of the extension.
19 context.subscriptions.push(
20 vscode.commands.registerCommand('mlir.restart', async () => {
21 // Dispose and reactivate the context.
22 mlirContext.dispose();
23 await mlirContext.activate(outputChannel);
25 registerMLIRExtensions(context, mlirContext);
26 registerPDLLExtensions(context, mlirContext);
28 mlirContext.activate(outputChannel);