Skip to content

Commit e42fdde

Browse files
authored
[BUG] Bad path entry in unittestbot.paths.sourceDirectories parameter on Windows OS #376 (#377)
* [BUG] Bad path entry in `unittestbot.paths.sourceDirectories` parameter on Windows OS #376 - change path -> fsPath when getting root location - change vs.Uri.parse -> vs.Uri.file
1 parent 6d24365 commit e42fdde

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

vscode-plugin/src/config/defaultValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class DefaultConfigValues {
6666
if (!rootPath) {
6767
return buildDirName;
6868
}
69-
await vs.workspace.fs.readDirectory(vs.Uri.parse(rootPath))
69+
await vs.workspace.fs.readDirectory(vs.Uri.file(rootPath))
7070
.then(resultArray => {
7171
resultArray.forEach(([name, type]) => {
7272
// add only non-hidden directories and not a build directory by default

vscode-plugin/src/explorer/utbotExplorer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class UTBotExplorer {
121121
}
122122
const initSourceDirectoriesNames: Array<string> = [];
123123
await clearSourceDirectories();
124-
await vs.workspace.fs.readDirectory(vs.Uri.parse(rootPath))
124+
await vs.workspace.fs.readDirectory(vs.Uri.file(rootPath))
125125
.then(resultArray => {
126126
resultArray.forEach(([name, type]) => {
127127
// add only non hidden directories and not a build directory by default

vscode-plugin/src/explorer/utbotExplorerElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class UTBotExplorerFolder extends vs.TreeItem {
1818
) {
1919
super(label, collapsibleState);
2020
this.tooltip = `${this.path}`;
21-
this.description = pathlib.relative(vsUtils.getProjectDirByOpenedFile().fsPath, vs.Uri.parse(this.path).fsPath);
21+
this.description = pathlib.relative(vsUtils.getProjectDirByOpenedFile().fsPath, vs.Uri.file(this.path).fsPath);
2222
}
2323

2424
contextValue = this.isUsed ? UTBotExplorerFolder.UTBOT_FOLDER_USED : UTBotExplorerFolder.UTBOT_FOLDER_NOT_USED;

vscode-plugin/src/utils/pathUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function getRealFilePath(editorPath: string, optionalClickedPath: vs.Uri
4848
}
4949

5050
export function getRootPath(): string | undefined {
51-
return vs.workspace.workspaceFolders?.[0].uri.path;
51+
return vs.workspace.workspaceFolders?.[0].uri.fsPath;
5252
}
5353

5454
export function fsJoin(...paths: string[]): string {

0 commit comments

Comments
 (0)