Merge pull request #3608 from continuedev/dallin/open-local-config

Open local config: use file URL
This commit is contained in:
Nate Sesti 2025-01-07 15:24:54 -08:00 • committed by GitHub
commit 87d1c19cb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -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/",

View file

@ -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 [];
};