Skip to content

Commit db14d38

Browse files
Copilotgarrytrinder
andcommitted
Fix storage key handling for workspace recommendations prompt
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
1 parent 607689a commit db14d38

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/utils/workspace-recommendations.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ export async function addExtensionToRecommendations(): Promise<boolean> {
104104
*/
105105
export async function promptForWorkspaceRecommendation(context: vscode.ExtensionContext): Promise<void> {
106106
// Check if we've already prompted for this workspace
107-
const workspaceKey = vscode.workspace.workspaceFolders?.[0]?.uri.toString() ?? '';
108-
const storageKey = `recommendation-prompted-${workspaceKey}`;
107+
const workspaceKey = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '';
108+
// Use a safe storage key by replacing path separators with underscores
109+
const storageKey = `recommendation-prompted-${workspaceKey.replace(/[/\\:]/g, '_')}`;
109110

110111
if (context.globalState.get(storageKey)) {
111112
// Already prompted for this workspace

0 commit comments

Comments
 (0)