Skip to content

Commit 7300d28

Browse files
Anonymous941tydonelson
authored andcommitted
fix: vscode workspaceState bug workaround
see #301 for writeup, microsoft/vscode@06c07d2 introduces a subtle backwards compatibility issue which causes the extension to be unusable
1 parent 2fd1033 commit 7300d28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/workspaceHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function findSkillFoldersInWs(): Promise<vscode.Uri[]> {
3131
const askResources = await vscode.workspace.findFiles("**/ask-resources.json");
3232
const skillFolders: vscode.Uri[] = [];
3333
askResources.forEach((resourceFileUri) => {
34-
skillFolders.push(vscode.Uri.file(path.dirname(resourceFileUri.fsPath)));
34+
skillFolders.push(vscode.Uri.file(path.dirname(resourceFileUri.fsPath)).toJSON());
3535
});
3636
return skillFolders;
3737
}
@@ -40,7 +40,7 @@ export function getSkillFolderInWs(context: vscode.ExtensionContext): vscode.Uri
4040
Logger.verbose("Calling method: getSkillFolderInWs");
4141
const skillFolders: vscode.Uri[] | undefined = context.workspaceState.get(EXTENSION_STATE_KEY.WS_SKILLS);
4242
if (doesWorkSpaceExist() && skillFolders) {
43-
return skillFolders.length > 0 ? skillFolders[0] : undefined;
43+
return skillFolders.length > 0 ? vscode.Uri.from(skillFolders[0]) : undefined;
4444
}
4545
return undefined;
4646
}

0 commit comments

Comments
 (0)