Improve check error performance by off-loading to worker thread w/ incremental compilation (#575)
This commit is contained in:
@@ -40,7 +40,7 @@ import { Worker } from "worker_threads";
|
||||
import { createFromTemplate } from "./createFromTemplate";
|
||||
import { gitCommit } from "../utils/git_utils";
|
||||
import { safeSend } from "../utils/safe_sender";
|
||||
import { normalizePath } from "../processors/normalizePath";
|
||||
import { normalizePath } from "../../../shared/normalizePath";
|
||||
|
||||
async function copyDir(
|
||||
source: string,
|
||||
|
||||
@@ -22,10 +22,7 @@ import { getDyadAppPath } from "../../paths/paths";
|
||||
import { readSettings } from "../../main/settings";
|
||||
import type { ChatResponseEnd, ChatStreamParams } from "../ipc_types";
|
||||
import { extractCodebase, readFileWithCache } from "../../utils/codebase";
|
||||
import {
|
||||
getDyadAddDependencyTags,
|
||||
processFullResponseActions,
|
||||
} from "../processors/response_processor";
|
||||
import { processFullResponseActions } from "../processors/response_processor";
|
||||
import { streamTestResponse } from "./testing_chat_handlers";
|
||||
import { getTestResponse } from "./testing_chat_handlers";
|
||||
import { getModelClient, ModelClient } from "../utils/get_model_client";
|
||||
@@ -51,7 +48,13 @@ import { safeSend } from "../utils/safe_sender";
|
||||
import { cleanFullResponse } from "../utils/cleanFullResponse";
|
||||
import { generateProblemReport } from "../processors/tsc";
|
||||
import { createProblemFixPrompt } from "@/shared/problem_prompt";
|
||||
import { AsyncVirtualFileSystem } from "@/utils/VirtualFilesystem";
|
||||
import { AsyncVirtualFileSystem } from "../../../shared/VirtualFilesystem";
|
||||
import {
|
||||
getDyadAddDependencyTags,
|
||||
getDyadWriteTags,
|
||||
getDyadDeleteTags,
|
||||
getDyadRenameTags,
|
||||
} from "../utils/dyad_tag_parser";
|
||||
import { fileExists } from "../utils/file_utils";
|
||||
|
||||
type AsyncIterableStream<T> = AsyncIterable<T> & ReadableStream<T>;
|
||||
@@ -708,7 +711,14 @@ ${problemReport.problems
|
||||
readFile: (fileName: string) => readFileWithCache(fileName),
|
||||
},
|
||||
);
|
||||
virtualFileSystem.applyResponseChanges(fullResponse);
|
||||
const writeTags = getDyadWriteTags(fullResponse);
|
||||
const renameTags = getDyadRenameTags(fullResponse);
|
||||
const deletePaths = getDyadDeleteTags(fullResponse);
|
||||
virtualFileSystem.applyResponseChanges({
|
||||
deletePaths,
|
||||
renameTags,
|
||||
writeTags,
|
||||
});
|
||||
|
||||
const { formattedOutput: codebaseInfo, files } =
|
||||
await extractCodebase({
|
||||
|
||||
@@ -9,16 +9,16 @@ import { messages, chats } from "../../db/schema";
|
||||
import { desc, eq, and } from "drizzle-orm";
|
||||
import path from "node:path"; // Import path for basename
|
||||
// Import tag parsers
|
||||
import { processFullResponseActions } from "../processors/response_processor";
|
||||
import {
|
||||
getDyadAddDependencyTags,
|
||||
getDyadChatSummaryTag,
|
||||
getDyadWriteTags,
|
||||
getDyadRenameTags,
|
||||
getDyadDeleteTags,
|
||||
getDyadExecuteSqlTags,
|
||||
getDyadRenameTags,
|
||||
getDyadWriteTags,
|
||||
getDyadAddDependencyTags,
|
||||
getDyadChatSummaryTag,
|
||||
getDyadCommandTags,
|
||||
processFullResponseActions,
|
||||
} from "../processors/response_processor";
|
||||
} from "../utils/dyad_tag_parser";
|
||||
import log from "electron-log";
|
||||
import { isServerFunction } from "../../supabase_admin/supabase_utils";
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { ipcMain, session } from "electron";
|
||||
import fs from "node:fs/promises";
|
||||
import { getTypeScriptCachePath } from "@/paths/paths";
|
||||
|
||||
export const registerSessionHandlers = () => {
|
||||
ipcMain.handle("clear-session-data", async (_event) => {
|
||||
@@ -8,5 +10,12 @@ export const registerSessionHandlers = () => {
|
||||
storages: ["cookies", "localstorage"],
|
||||
});
|
||||
console.info(`[IPC] All session data cleared for default session`);
|
||||
|
||||
// Clear custom cache data (like tsbuildinfo)
|
||||
try {
|
||||
await fs.rm(getTypeScriptCachePath(), { recursive: true, force: true });
|
||||
} catch {
|
||||
// Directory might not exist
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user