2023-10-19 11:13:16 +02:00
|
|
|
import * as vscode from 'vscode';
|
|
|
|
|
import { Search } from './search';
|
|
|
|
|
import { ComponentDefinitionProvider } from './definiton_providers';
|
2023-11-02 13:33:20 +01:00
|
|
|
import { OpenDirection } from './utils';
|
2023-10-19 11:13:16 +02:00
|
|
|
|
|
|
|
|
export async function activate(context: vscode.ExtensionContext) {
|
|
|
|
|
const search = new Search();
|
|
|
|
|
|
2023-11-02 13:33:20 +01:00
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('owl-vision.switch', () => search.switch()));
|
|
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('owl-vision.switch-besides', () => search.switch(OpenDirection.Besides)));
|
|
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('owl-vision.switch-below', () => search.switch(OpenDirection.Below)));
|
2023-10-19 11:13:16 +02:00
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('owl-vision.find-component', () => search.findComponentCommand()));
|
|
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('owl-vision.find-template', () => search.findTemplateCommand()));
|
|
|
|
|
|
|
|
|
|
const componentDefProvider = new ComponentDefinitionProvider(search);
|
|
|
|
|
context.subscriptions.push(vscode.languages.registerDefinitionProvider({ language: 'xml' }, componentDefProvider));
|
|
|
|
|
context.subscriptions.push(vscode.languages.registerDefinitionProvider({ language: 'javascript' }, componentDefProvider));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function deactivate() { }
|