Skip to content

Commit

Permalink
Merge pull request #3608 from continuedev/dallin/open-local-config
Browse files Browse the repository at this point in the history
Open local config: use file URL
  • Loading branch information
sestinj authored Jan 7, 2025
2 parents fcc4c99 + 1fb430d commit 87d1c19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion core/config/ConfigHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
ProfileDescription,
ProfileLifecycleManager,
} from "./ProfileLifecycleManager.js";
import { pathToFileURL } from "url";

export type { ProfileDescription };

Expand Down Expand Up @@ -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/",
Expand Down
8 changes: 4 additions & 4 deletions core/tools/implementations/createNewFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
};

0 comments on commit 87d1c19

Please sign in to comment.