Skip to content

Commit d2afd7d

Browse files
committed
src/goTest/resolve: fix nested packageDisplayMode handling on win32
To use path module, use Uri.fsPath, not Uri.path. For #832 For #1788 Change-Id: Ic07e19f2f83cc4b05b3be750de4be7bcdb6e6656 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/418547 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 47f6dfa commit d2afd7d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/goTest/resolve.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,16 @@ export class GoTestResolver {
328328
}
329329

330330
if (nested) {
331-
const bits = parent.uri ? path.relative(parent.uri.path, uri.path).split(path.sep) : [];
331+
const bits = parent.uri ? path.relative(parent.uri.fsPath, uri.fsPath).split(path.sep) : [];
332332
while (bits.length > 1) {
333333
if (!parent.uri?.path) continue;
334334
const dir = bits.shift();
335335
if (!dir) continue;
336-
const dirUri = uri.with({ path: path.join(parent.uri.path, dir), query: '', fragment: '' });
336+
const dirUri = uri.with({
337+
path: Uri.file(path.join(parent.uri.fsPath, dir)).path,
338+
query: '',
339+
fragment: ''
340+
});
337341
parent = this.getOrCreateItem(parent, dir, dirUri, 'package');
338342
}
339343
}

test/integration/goTest.explore.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import * as config from '../../src/config';
1515
import { GoTestResolver } from '../../src/goTest/resolve';
1616
import * as testUtils from '../../src/testUtils';
1717
import { GoTest } from '../../src/goTest/utils';
18-
import { affectedByIssue832 } from './testutils';
1918

2019
type Files = Record<string, string | { contents: string; language: string }>;
2120

@@ -225,9 +224,6 @@ suite('Go Test Explorer', () => {
225224
});
226225

227226
suite('settings', () => {
228-
if (affectedByIssue832()) {
229-
return;
230-
}
231227
const sandbox = sinon.createSandbox();
232228

233229
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)