fix(editor): move large SQL analysis off the input path

This commit is contained in:
t8y2 committed 2026-09-28 07:24:23 +08:00
1 parent 0a6ab8d360
commit adaaec5a3c
30 files changed
+1241 -211

No files matched your search

@@ -0,0 +1,16 @@
import { SqlCompletionAnalysisEngine, type SqlCompletionAnalysisRequest } from "./sqlCompletionAnalysis";
interface SqlCompletionAnalysisWorkerRequest {
id: number;
input: SqlCompletionAnalysisRequest;
}
const engine = new SqlCompletionAnalysisEngine();
self.onmessage = (event: MessageEvent<SqlCompletionAnalysisWorkerRequest>) => {
try {
self.postMessage({ id: event.data.id, result: engine.analyze(event.data.input) });
} catch (error) {
self.postMessage({ id: event.data.id, error: error instanceof Error ? error.message : String(error) });
}
};