8951: internal: migrate to vscode.FileSystem API r=matklad a=wxb1ank

I encountered an error where `bootstrap()` attempts to create a directory with the path `C:\C:\...`. I couldn't find this reported anywhere else. Using the `vscode.FileSystem` API instead of the `fs` one works here. I assume the latter automatically prepends `C:\` to paths whereas the former does not. I don't know if this suggests `vscode.FileSystem` should be used in more places for consistency.

Co-authored-by: wxb1ank <wxblank@gmail.com>
This commit is contained in:
bors[bot] 2021-06-14 10:30:10 +00:00 committed by GitHub
commit 388a91c8a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 47 deletions

View file

@ -31,10 +31,10 @@ export class Config {
enableProposedApi: boolean | undefined;
} = vscode.extensions.getExtension(this.extensionId)!.packageJSON;
readonly globalStoragePath: string;
readonly globalStorageUri: vscode.Uri;
constructor(ctx: vscode.ExtensionContext) {
this.globalStoragePath = ctx.globalStorageUri.fsPath;
this.globalStorageUri = ctx.globalStorageUri;
vscode.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, ctx.subscriptions);
this.refreshLogging();
}