[release] prepare v0.28.0 release (4) - windows fix
171cc61 src/goToolPprof: execFile instead of exec
0ae12d0 src/goTest/resolve: fix Windows path handling
bff0d0a CHANGELOG.md: mention test explorer on Windows is a work-in-progress
Change-Id: Ie8fcd0c4cf2e55424b0b3e18ad3fddc9d8bca64c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7f87792..f7f53a6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,7 @@
This version requires VS Code 1.59 or newer.
-๐๐งช The extension implements [the Testing API of VS Code](https://code.visualstudio.com/api/extension-guides/testing). You can navigate and run/profile tests using the test explorer UI! Further work for better profiling and debugging support through the test explorer is underway. Please give it a try and provide feedback.
+๐๐งช The extension implements [the Testing API of VS Code](https://code.visualstudio.com/api/extension-guides/testing). You can navigate and run/profile tests using the test explorer UI! Windows support and further work for better profiling and debugging support through the test explorer is underway. Please give it a try and provide feedback.
A list of all issues and changes can be found in the [v0.28.0 milestone](https://github.com/golang/vscode-go/milestone/34) and [commit history](https://github.com/golang/vscode-go/compare/v0.27.2...v0.28.0).
diff --git a/src/goTest/resolve.ts b/src/goTest/resolve.ts
index b5e342a..ead2a47 100644
--- a/src/goTest/resolve.ts
+++ b/src/goTest/resolve.ts
@@ -304,11 +304,11 @@
let item: TestItem;
const nested = getGoConfig(uri).get('testExplorer.packageDisplayMode') === 'nested';
- const modDir = await getModFolderPath(uri, true);
+ const modDir = Uri.file(await getModFolderPath(uri, true)); // TODO support non-file schemes
const wsfolder = workspace.getWorkspaceFolder(uri);
if (modDir) {
// If the package is in a module, add it as a child of the module
- let parent = await this.getModule(uri.with({ path: modDir, query: '', fragment: '' }));
+ let parent = await this.getModule(modDir);
if (uri.path === parent.uri.path) {
return parent;
}
diff --git a/src/goToolPprof.ts b/src/goToolPprof.ts
index ef1bc91..d947006 100644
--- a/src/goToolPprof.ts
+++ b/src/goToolPprof.ts
@@ -2,7 +2,7 @@
* Copyright 2021 The Go Authors. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------*/
-import { exec } from 'child_process';
+import { execFile } from 'child_process';
import { window, CancellationToken, TextDocumentContentProvider, Uri } from 'vscode';
import { outputChannel } from './goStatus';
import { getBinPath } from './util';
@@ -15,7 +15,7 @@
private pprof(uri: Uri, token: CancellationToken) {
const goBin = getBinPath('go');
return new Promise<string | undefined>((resolve) => {
- const cp = exec(`${goBin} tool pprof -tree ${uri.fsPath}`, async (err, stdout, stderr) => {
+ const cp = execFile(goBin, ['tool', 'pprof', '-tree', uri.fsPath], async (err, stdout, stderr) => {
if (err || stderr) {
const m = 'Failed to execute `go tool pprof`';
if (err) outputChannel.appendLine(`${m}: ${err}`);