irongit

A Regex file extension that makes it way easier to edit large regex.

removed wasm stuff

huncholanehuncholaneauthored
parent aba335ecommit 69c610908e9872b9b327204bfeae0d96020225bbBrowse files

2 files changed, +22 -2

+0-2src/extension.ts
@@ -3,11 +3,9 @@ import { output } from "./output";
33 import { editorsContainRegexFile } from "./utils";
44 import { regexButtons } from "./regexButtons";
55 import { highlighter } from "./highlighter";
6-import * as wasm from "./wasm/pkg/regex_processor";
76
87 export async function activate(context: vscode.ExtensionContext) {
98 output.activate();
10- output.log("WASM loaded");
119 regexButtons.activate(context);
1210 highlighter.activate(context);
1311
+22-0src/wasm/index.ts
@@ -0,0 +1,22 @@
1+import { output } from "../output";
2+import * as wasmImport from "./pkg/regex_processor";
3+
4+class WASM {
5+ loaded = false;
6+ async default() {
7+ wasmImport
8+ .default()
9+ .then(() => {
10+ output.log("WASM loaded");
11+ })
12+ .catch((err) => {
13+ output.log(`Error loading WASM: ${err}`);
14+ });
15+ }
16+
17+ runRegex(pattern: string, text: string) {
18+ return wasmImport.find_matches(pattern, text);
19+ }
20+}
21+
22+export const wasm = new WASM();