diff --git a/extension/CHANGELOG.md b/extension/CHANGELOG.md index e7c2527f46..6f4f3db44b 100644 --- a/extension/CHANGELOG.md +++ b/extension/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.41.1 - 22 Feb, 2024 + +This release is a point release to skip `vscgo` installation on Windows +([Issue 3182](https://github.com/golang/vscode-go/issues/3182)). +For a detailed list of changes, refer to the complete +[commit history](https://github.com/golang/vscode-go/compare/v0.41.0...v0.41.1). + ## v0.41.0 - 14 Feb, 2024 This release introduces significant updates to the extension's UI. diff --git a/extension/src/goInstallTools.ts b/extension/src/goInstallTools.ts index 8d570c7949..490e77573c 100644 --- a/extension/src/goInstallTools.ts +++ b/extension/src/goInstallTools.ts @@ -893,7 +893,7 @@ export async function maybeInstallVSCGO( : `@v${extensionVersion}`; // build from source acquired from the module proxy if this is a non-preview version. try { - const args = ['install', `${importPath}${version}`]; + const args = ['install', '-trimpath', `${importPath}${version}`]; console.log(`installing vscgo: ${args.join(' ')}`); await execFile(getBinPath('go'), args, { cwd, env }); return progPath; diff --git a/extension/src/goMain.ts b/extension/src/goMain.ts index b1221e4bbb..73265bdd85 100644 --- a/extension/src/goMain.ts +++ b/extension/src/goMain.ts @@ -102,15 +102,18 @@ export async function activate(ctx: vscode.ExtensionContext): Promise telemetryReporter.setTool(path)) - .catch((reason) => console.error(reason)); + if (process.platform !== 'win32') { + // skip windows until Windows Defender issue reported in golang/vscode-go#3182 can be addressed + maybeInstallVSCGO( + ctx.extensionMode, + ctx.extension.id, + extensionInfo.version || '', + ctx.extensionPath, + extensionInfo.isPreview + ) + .then((path) => telemetryReporter.setTool(path)) + .catch((reason) => console.error(reason)); + } const registerCommand = commands.createRegisterCommand(ctx, goCtx); registerCommand('go.languageserver.restart', commands.startLanguageServer); diff --git a/extension/test/gopls/telemetry.test.ts b/extension/test/gopls/telemetry.test.ts index 6f409d1938..32dc1fcbc7 100644 --- a/extension/test/gopls/telemetry.test.ts +++ b/extension/test/gopls/telemetry.test.ts @@ -173,9 +173,7 @@ function testTelemetryPrompt(tc: testCase, wantPrompt: boolean) { } describe('# telemetry reporter using vscgo', async function () { - if (os.platform() === 'win32') { - this.timeout(10000); // go install is slow on windows builder. - } + this.timeout(10000); // go install can be slow. // installVSCGO expects // {extensionPath}/vscgo: vscgo source code for testing. // {extensionPath}/bin: where compiled vscgo will be stored.