Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension is being loaded in non-go projects #2962

Closed
ThaDaVos opened this issue Sep 6, 2023 · 11 comments
Closed

Extension is being loaded in non-go projects #2962

ThaDaVos opened this issue Sep 6, 2023 · 11 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@ThaDaVos
Copy link

ThaDaVos commented Sep 6, 2023

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • Not installed (I only have it installed in my WSL environment)
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • Not installed (I only have it installed in my WSL environment)
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • Version: 1.81.1 (user setup)
      Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
      Date: 2023-08-09T22:22:42.175Z
      Electron: 22.3.18
      ElectronBuildId: 22689846
      Chromium: 108.0.5359.215
      Node.js: 16.17.1
      V8: 10.8.168.25-electron.0
      OS: Windows_NT x64 10.0.25941
  • Check your installed extensions to get the version of the VS Code Go extension
    • Latest
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    • Not installed (I only have it installed in my WSL environment)

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

Describe the bug

A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.

When opening VSCode and loading a non-go project, the extension is still being loaded - in my current environment this causes the error "GO binary not found" - rather than installing GO in my windows environment too, I rather have the GO extension not being loaded in non-go projects, I know this is possible as other extensions do it too - so why doesn't this one?

Steps to reproduce the behavior:

  1. Open a non-go project, for example a DotNet project
  2. The GO extension still gets enabled/loaded into vscode even though it won't be used

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

@gopherbot gopherbot added this to the Untriaged milestone Sep 6, 2023
@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 6, 2023

FYI: I de-installed the extension on my Windows Side for now - really curious how it got installed there though as I only installed it when connected to WSL - but maybe it's one of those extensions which needs to be installed on the host side

@hyangah
Copy link
Contributor

hyangah commented Sep 7, 2023

Is the repository an open source one?

vscode-go/package.json

Lines 96 to 111 in d9015c1

"activationEvents": [
"onLanguage:go",
"workspaceContains:*.go",
"workspaceContains:*/*.go",
"workspaceContains:*/*/*.go",
"onCommand:go.gopath",
"onCommand:go.goroot",
"onCommand:go.tools.install",
"onCommand:go.locate.tools",
"onCommand:go.show.commands",
"onCommand:go.run.modinit",
"onDebugInitialConfigurations",
"onDebugResolve:go",
"onWebviewPanel:welcomeGo",
"onView:go.test.profile"
],
specifies the list of events that trigger the extension activation (e.g. having a go file somewhere, having a go file open, or some other extensions invoke one of the commands this extension implements). Can you please check the log in "Output: Show Output Channels..." -> "Extension Host" and see what event caused 'golang.go' activation?

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 7, 2023
@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 8, 2023

It happened on all my projects - even just created folders - but I'll check

@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 8, 2023

Here's the log, I added numbers to the lines - see line 58:

1  | 2023-09-08 09:14:07.105 [info] ExtensionService#_doActivateExtension ms-vscode.test-adapter-converter, startup: true, activationEvent: '*', root cause: hbenl.vscode-test-explorer
2  | 2023-09-08 09:14:07.108 [info] ExtensionService#_doActivateExtension jameslan.yaclock, startup: true, activationEvent: '*'
3  | 2023-09-08 09:14:07.109 [info] ExtensionService#_doActivateExtension johnpapa.vscode-peacock, startup: true, activationEvent: '*'
4  | 2023-09-08 09:14:07.112 [info] ExtensionService#_doActivateExtension L13RARY.l13-projects, startup: true, activationEvent: '*'
5  | 2023-09-08 09:14:07.117 [info] ExtensionService#_doActivateExtension lihui.vs-color-picker, startup: true, activationEvent: '*'
6  | 2023-09-08 09:14:07.119 [info] ExtensionService#_doActivateExtension mtxr.sqltools, startup: true, activationEvent: '*'
7  | 2023-09-08 09:14:07.148 [info] ExtensionService#_doActivateExtension nhoizey.gremlins, startup: true, activationEvent: '*'
8  | 2023-09-08 09:14:07.149 [info] ExtensionService#_doActivateExtension nitayneeman.git-semantic-commit, startup: true, activationEvent: '*'
9  | 2023-09-08 09:14:07.156 [info] ExtensionService#_doActivateExtension spmeesseman.vscode-taskexplorer, startup: true, activationEvent: '*'
10 | 2023-09-08 09:14:07.205 [info] ExtensionService#_doActivateExtension stkb.rewrap, startup: true, activationEvent: '*'
11 | 2023-09-08 09:14:07.404 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
12 | 2023-09-08 09:14:07.428 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
13 | 2023-09-08 09:14:07.436 [info] ExtensionService#_doActivateExtension eservice-online.vs-sharper, startup: false, activationEvent: 'onLanguage:csharp'
14 | 2023-09-08 09:14:07.472 [info] ExtensionService#_doActivateExtension ms-dotnettools.vscode-dotnet-runtime, startup: false, activationEvent: 'onLanguage:csharp', root cause: ms-dotnettools.csdevkit
15 | 2023-09-08 09:14:07.520 [info] ExtensionService#_doActivateExtension ms-dotnettools.vscode-dotnet-pack, startup: false, activationEvent: 'onLanguage:csharp'
16 | 2023-09-08 09:14:07.542 [info] ExtensionService#_doActivateExtension nromanov.dotnet-meteor, startup: false, activationEvent: 'onLanguage:csharp'
17 | 2023-09-08 09:14:07.553 [info] ExtensionService#_doActivateExtension poohcom1.csharp-prettier-docs, startup: false, activationEvent: 'onLanguage:csharp'
18 | 2023-09-08 09:14:10.550 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
19 | 2023-09-08 09:14:10.554 [info] ExtensionService#_doActivateExtension 42Crunch.vscode-openapi, startup: true, activationEvent: '*'
20 | 2023-09-08 09:14:10.758 [info] ExtensionService#_doActivateExtension hbenl.vscode-test-explorer, startup: true, activationEvent: '*'
21 | 2023-09-08 09:14:11.412 [info] ExtensionService#_doActivateExtension ms-dotnettools.csharp, startup: false, activationEvent: 'onLanguage:csharp', root cause: ms-dotnettools.csdevkit
22 | 2023-09-08 09:14:11.512 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
23 | 2023-09-08 09:14:11.539 [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
24 | 2023-09-08 09:14:11.551 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
25 | 2023-09-08 09:14:11.644 [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
26 | 2023-09-08 09:14:11.661 [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
27 | 2023-09-08 09:14:11.661 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
28 | 2023-09-08 09:14:11.705 [info] ExtensionService#_doActivateExtension ms-dotnettools.csdevkit, startup: false, activationEvent: 'onLanguage:csharp'
29 | 2023-09-08 09:14:11.856 [info] ExtensionService#_doActivateExtension ms-dotnettools.dotnet-maui, startup: false, activationEvent: 'onLanguage:csharp'
30 | 2023-09-08 09:14:11.891 [info] ExtensionService#_doActivateExtension ms-dotnettools.vscodeintellicode-csharp, startup: false, activationEvent: 'onLanguage:csharp'
31 | 2023-09-08 09:14:12.871 [info] Eager extensions activated
32 | 2023-09-08 09:14:12.873 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
33 | 2023-09-08 09:14:12.875 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
34 | 2023-09-08 09:14:12.883 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
35 | 2023-09-08 09:14:12.890 [info] ExtensionService#_doActivateExtension actboy168.tasks, startup: false, activationEvent: 'onStartupFinished'
36 | 2023-09-08 09:14:12.892 [info] ExtensionService#_doActivateExtension bierner.emojisense, startup: false, activationEvent: 'onStartupFinished'
37 | 2023-09-08 09:14:12.899 [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
38 | 2023-09-08 09:14:13.054 [info] ExtensionService#_doActivateExtension equinusocio.vsc-material-theme-icons, startup: false, activationEvent: 'onStartupFinished'
39 | 2023-09-08 09:14:13.094 [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
40 | 2023-09-08 09:14:13.125 [info] ExtensionService#_doActivateExtension genieai.chatgpt-vscode, startup: false, activationEvent: 'onStartupFinished'
41 | 2023-09-08 09:14:13.141 [info] ExtensionService#_doActivateExtension maptz.regionfolder, startup: false, activationEvent: 'onStartupFinished'
42 | 2023-09-08 09:14:13.155 [info] ExtensionService#_doActivateExtension moshfeu.compare-folders, startup: false, activationEvent: 'onStartupFinished'
43 | 2023-09-08 09:14:13.325 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
44 | 2023-09-08 09:14:13.361 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onStartupFinished'
45 | 2023-09-08 09:14:13.377 [info] ExtensionService#_doActivateExtension ms-vscode.remote-server, startup: false, activationEvent: 'onStartupFinished'
46 | 2023-09-08 09:14:13.383 [info] ExtensionService#_doActivateExtension PeterSchmalfeldt.explorer-exclude, startup: false, activationEvent: 'onStartupFinished'
47 | 2023-09-08 09:14:13.394 [info] ExtensionService#_doActivateExtension PKief.material-icon-theme, startup: false, activationEvent: 'onStartupFinished'
48 | 2023-09-08 09:14:13.399 [info] ExtensionService#_doActivateExtension ritwickdey.LiveServer, startup: false, activationEvent: 'onStartupFinished'
49 | 2023-09-08 09:14:13.413 [info] ExtensionService#_doActivateExtension ryu1kn.partial-diff, startup: false, activationEvent: 'onStartupFinished'
50 | 2023-09-08 09:14:13.419 [info] ExtensionService#_doActivateExtension streetsidesoftware.code-spell-checker, startup: false, activationEvent: 'onStartupFinished'
51 | 2023-09-08 09:14:13.517 [info] ExtensionService#_doActivateExtension vsls-contrib.codetour, startup: false, activationEvent: 'onStartupFinished'
52 | 2023-09-08 09:14:13.522 [info] ExtensionService#_doActivateExtension WallabyJs.console-ninja, startup: false, activationEvent: 'onStartupFinished'
53 | 2023-09-08 09:14:13.849 [info] ExtensionService#_doActivateExtension vscode.grunt, startup: false, activationEvent: 'onTaskType:grunt'
54 | 2023-09-08 09:14:13.853 [info] ExtensionService#_doActivateExtension vscode.gulp, startup: false, activationEvent: 'onTaskType:gulp'
55 | 2023-09-08 09:14:13.858 [info] ExtensionService#_doActivateExtension vscode.jake, startup: false, activationEvent: 'onTaskType:jake'
56 | 2023-09-08 09:14:13.864 [info] ExtensionService#_doActivateExtension vscode.npm, startup: false, activationEvent: 'onTaskType:npm'
57 | 2023-09-08 09:14:13.885 [info] ExtensionService#_doActivateExtension Dart-Code.dart-code, startup: false, activationEvent: 'onTaskType:dart'
58 | 2023-09-08 09:14:14.057 [info] ExtensionService#_doActivateExtension golang.go, startup: false, activationEvent: 'onTaskType:go'
59 | 2023-09-08 09:14:14.130 [info] ExtensionService#_doActivateExtension ms-azuretools.vscode-docker, startup: false, activationEvent: 'onTaskType:docker-build'
60 | 2023-09-08 09:14:14.455 [error] Activating extension golang.go failed due to an error:
61 | 2023-09-08 09:14:14.455 [error] undefined
62 | 2023-09-08 09:14:14.589 [info] ExtensionService#_doActivateExtension streetsidesoftware.code-spell-checker-dutch, startup: false, activationEvent: 'onStartupFinished'
63 | 2023-09-08 09:14:14.729 [info] ExtensionService#_doActivateExtension mechatroner.rainbow-csv, startup: false, activationEvent: 'onLanguage:plaintext'
64 | 2023-09-08 09:14:14.735 [info] ExtensionService#_doActivateExtension Vue.volar, startup: false, activationEvent: 'onLanguage:plaintext'
65 | 2023-09-08 09:14:34.318 [info] ExtensionService#_doActivateExtension emilast.LogFileHighlighter, startup: false, activationEvent: 'onLanguage:log'

@hyangah
Copy link
Contributor

hyangah commented Sep 8, 2023

Thanks. From the log it is obvious that something was triggering the 'go' type task.

[info] ExtensionService#_doActivateExtension golang.go, startup: false, activationEvent: 'onTaskType:go'

In fact, golang.go isn't the only one. It seems like grunt, gulp, jake, npm, dart, docker extensions that offer default Tasks were all activated. Just golang.go extension's activation became more visible because it requires go during activation and fails hard if it cannot find go.

Looks like microsoft/vscode#192043 is related.

@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 9, 2023

But the thing is - the above log is on opening of the project - haven't run any tasks yet - for me it happens just on loading of the project, not even started debugging etc

@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 9, 2023

Something is doing a scan for tasks at startup and I bet this is the culprit - thing is, Extension Bisect didn't find what did it

@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 9, 2023

Apparently that was caused by Task Explorer extension - but disabling it didn't solve the issue:
https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer

@ThaDaVos
Copy link
Author

ThaDaVos commented Sep 9, 2023

@hyangah
Copy link
Contributor

hyangah commented Sep 12, 2023

Thanks @ThaDaVos for sharing your finding with other users.
Closing since this is an issue between vscode and other extensions.

@hyangah hyangah closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@ThaDaVos
Copy link
Author

Please help by upvoting: microsoft/vscode#192657

@golang golang locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants