diff --git a/core/util/paths.ts b/core/util/paths.ts index 2764fa8be..3020c39bb 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -139,6 +139,24 @@ export function getTsConfigPath(): string { return tsConfigPath; } +export function getContinueRcPath(): string { + // Disable indexing of the config folder to prevent infinite loops + const continuercPath = path.join(getContinueGlobalPath(), ".continuerc.json"); + if (!fs.existsSync(continuercPath)) { + fs.writeFileSync( + continuercPath, + JSON.stringify( + { + disableIndexing: true, + }, + null, + 2, + ), + ); + } + return continuercPath; +} + export function devDataPath(): string { const sPath = path.join(getContinueGlobalPath(), "dev_data"); if (!fs.existsSync(sPath)) { @@ -302,4 +320,4 @@ export function readAllGlobalPromptFiles( }); return promptFiles; -} +} \ No newline at end of file diff --git a/extensions/vscode/src/activation/activate.ts b/extensions/vscode/src/activation/activate.ts index f4ba3e34b..529372814 100644 --- a/extensions/vscode/src/activation/activate.ts +++ b/extensions/vscode/src/activation/activate.ts @@ -1,4 +1,4 @@ -import { getTsConfigPath, migrate } from "core/util/paths"; +import { getTsConfigPath, getContinueRcPath, migrate } from "core/util/paths"; import { Telemetry } from "core/util/posthog"; import path from "node:path"; import * as vscode from "vscode"; @@ -13,6 +13,7 @@ import { setupInlineTips } from "./inlineTips"; export async function activateExtension(context: vscode.ExtensionContext) { // Add necessary files getTsConfigPath(); + getContinueRcPath(); // Register commands and providers registerQuickFixProvider(); @@ -61,4 +62,4 @@ export async function activateExtension(context: vscode.ExtensionContext) { extension: vscodeExtension, } : continuePublicApi; -} +} \ No newline at end of file