Add .continuerc file to config directory on activation to prevent it's indexing. (#1733)
This commit is contained in:
parent
b38ec0e615
commit
6fb331f1e7
2 changed files with 22 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue