From 1fb430ddb3c1685ee8608981c9a3aea6bacf8eef Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sat, 4 Jan 2025 18:59:17 +0100 Subject: [PATCH] convert config json to file url for local config --- core/config/ConfigHandler.ts | 3 ++- core/tools/implementations/createNewFile.ts | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 9ef3cc8d29..2c91148ba0 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -25,6 +25,7 @@ import { ProfileDescription, ProfileLifecycleManager, } from "./ProfileLifecycleManager.js"; +import { pathToFileURL } from "url"; export type { ProfileDescription }; @@ -88,7 +89,7 @@ export class ConfigHandler { async openConfigProfile(profileId?: string) { let openProfileId = profileId || this.selectedProfileId; if (openProfileId === "local") { - await this.ide.openFile(getConfigJsonPath()); + await this.ide.openFile(pathToFileURL(getConfigJsonPath()).toString()); } else { await this.ide.openUrl( "https://app.continue.dev/", diff --git a/core/tools/implementations/createNewFile.ts b/core/tools/implementations/createNewFile.ts index 1b733da010..b5d5e6c1b9 100644 --- a/core/tools/implementations/createNewFile.ts +++ b/core/tools/implementations/createNewFile.ts @@ -3,13 +3,13 @@ import { inferResolvedUriFromRelativePath } from "../../util/ideUtils"; import { ToolImpl } from "."; export const createNewFileImpl: ToolImpl = async (args, extras) => { - const resolvedFilepath = await inferResolvedUriFromRelativePath( + const resolvedFileUri = await inferResolvedUriFromRelativePath( args.filepath, extras.ide, ); - if (resolvedFilepath) { - await extras.ide.writeFile(resolvedFilepath, args.contents); - await extras.ide.openFile(resolvedFilepath); + if (resolvedFileUri) { + await extras.ide.writeFile(resolvedFileUri, args.contents); + await extras.ide.openFile(resolvedFileUri); } return []; };