fix project tree tests failing on windows (#14759)

* fix project tree tests failing on windows

* add back test

* Addressing comments

* change to doc comment

* remove unnecessary change

* undo other change
This commit is contained in:
Kim Santiago
2021-03-18 17:14:00 -07:00
committed by GitHub
parent c65c856d2f
commit 8068de5938
7 changed files with 47 additions and 49 deletions

View File

@@ -10,11 +10,12 @@ import * as path from 'path';
* Base class for an item that appears in the ADS project tree
*/
export abstract class BaseProjectTreeItem {
uri: vscode.Uri;
/** Project-relative URI that's compatible with the project tree */
projectUri: vscode.Uri;
parent?: BaseProjectTreeItem;
constructor(uri: vscode.Uri, parent?: BaseProjectTreeItem) {
this.uri = uri;
this.projectUri = uri;
this.parent = parent;
}
@@ -23,7 +24,7 @@ export abstract class BaseProjectTreeItem {
abstract get treeItem(): vscode.TreeItem;
public get friendlyName(): string {
return path.parse(this.uri.path).base;
return path.parse(this.projectUri.path).base;
}
public get root() {
@@ -44,7 +45,7 @@ export class MessageTreeItem extends BaseProjectTreeItem {
private message: string;
constructor(message: string, parent?: BaseProjectTreeItem) {
super(vscode.Uri.file(path.join(parent?.uri.path ?? 'Message', message)), parent);
super(vscode.Uri.file(path.join(parent?.projectUri.path ?? 'Message', message)), parent);
this.message = message;
}