diff --git a/core/commands/slash/share.ts b/core/commands/slash/share.ts index f60638582..d840f7db1 100644 --- a/core/commands/slash/share.ts +++ b/core/commands/slash/share.ts @@ -1,4 +1,7 @@ +import fs from "fs"; import { homedir } from "node:os"; +import { fileURLToPath } from "node:url"; +import path from "path"; import { languageForFilepath } from "../../autocomplete/constants/AutocompleteLanguageInfo.js"; import { SlashCommand } from "../../index.js"; @@ -77,7 +80,7 @@ const ShareSlashCommand: SlashCommand = { // folders are included. We default to using the first item in the list, if // it exists. const workspaceDirectory = workspaceDirs?.[0] || ""; - outputDir = outputDir.replace(/^./, workspaceDirectory); + outputDir = outputDir.replace(/^./, fileURLToPath(workspaceDirectory)); } if (!fs.existsSync(outputDir)) { diff --git a/core/commands/util.ts b/core/commands/util.ts index a136d4df4..de7b6b97c 100644 --- a/core/commands/util.ts +++ b/core/commands/util.ts @@ -59,7 +59,3 @@ export function ctxItemToRifWithContents( return rif; } - -// export function codeContextItemToMarkdownSource( -// item: ContextItemWithId, -// ): string {} diff --git a/core/core.ts b/core/core.ts index 3b1136451..faf58fc82 100644 --- a/core/core.ts +++ b/core/core.ts @@ -732,21 +732,18 @@ export class Core { // URI TODO is this equality statement valid? const filePath = getFullPath(uri); if (filePath === getConfigJsonPath()) { - // Trigger a toast notification to provide UI feedback that config - // has been updated + // Trigger a toast notification to provide UI feedback that config has been updated const showToast = this.globalContext.get("showConfigUpdateToast") ?? true; if (showToast) { - void this.ide.showToast("info", "Config updated"); - - // URI TODO - this is a small regression - add core -> toast functionality that handles responses to update global context here - // vscode.window - // .showInformationMessage("Config updated", "Don't show again") - // .then((selection) => { - // if (selection === "Don't show again") { - // this.globalContext.update("showConfigUpdateToast", false); - // } - // }); + const selection = await this.ide.showToast( + "info", + "Config updated", + "Don't show again", + ); + if (selection === "Don't show again") { + this.globalContext.update("showConfigUpdateToast", false); + } } }