A Regex file extension that makes it way easier to edit large regex.
removed wasm stuff
2 files changed, +22 -2
+0-2src/extension.ts
| @@ -3,11 +3,9 @@ import { output } from "./output"; | ||
| 3 | 3 | import { editorsContainRegexFile } from "./utils"; |
| 4 | 4 | import { regexButtons } from "./regexButtons"; |
| 5 | 5 | import { highlighter } from "./highlighter"; |
| 6 | -import * as wasm from "./wasm/pkg/regex_processor"; | |
| 7 | 6 | |
| 8 | 7 | export async function activate(context: vscode.ExtensionContext) { |
| 9 | 8 | output.activate(); |
| 10 | - output.log("WASM loaded"); | |
| 11 | 9 | regexButtons.activate(context); |
| 12 | 10 | highlighter.activate(context); |
| 13 | 11 |
+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(); |