Replace URL and use vscode.URI on local paths (#11624)

* Use vscode.URI for local paths

* Use vscode.uri file method to set the name for remotebookfull path compressed file

* Add await on extract tar function

* Replace remote paths too

* Use vscode.uri.file instead of parse for local paths
This commit is contained in:
Barbara Valdez
2020-08-04 13:22:28 -07:00
committed by GitHub
parent 9df51b9936
commit e7ec278ef2
6 changed files with 37 additions and 38 deletions

View File

@@ -8,9 +8,9 @@ import * as utils from '../common/utils';
import { IAsset } from './remoteBookController';
export abstract class RemoteBook {
protected _localPath: URL;
protected _localPath: vscode.Uri;
constructor(public remotePath: URL, public outputChannel: vscode.OutputChannel, protected _asset?: IAsset) {
constructor(public remotePath: vscode.Uri, public outputChannel: vscode.OutputChannel, protected _asset?: IAsset) {
this.remotePath = remotePath;
}
@@ -21,10 +21,10 @@ export abstract class RemoteBook {
if (vscode.workspace.workspaceFolders !== undefined) {
// Get workspace root path
let folders = vscode.workspace.workspaceFolders;
this._localPath = new URL(folders[0].uri.fsPath);
this._localPath = vscode.Uri.file(folders[0].uri.fsPath);
} else {
//If no workspace folder is opened then path is Users directory
this._localPath = new URL(utils.getUserHome());
this._localPath = vscode.Uri.file(utils.getUserHome());
}
}
}