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

activation: extension sometimes gets activated for a workspace without any go code #1894

Closed
hyangah opened this issue Nov 15, 2021 · 3 comments

Comments

@hyangah
Copy link
Contributor

hyangah commented Nov 15, 2021

Reported externally.

It happens when I re-start VSCode, because the check whether go files exist (recursively) times out

Go extension activated on three of them (the fourth was a flat folder, pretty much), Dart on two of them (checks up to four-deep, instead of **/). Those were the only two that activated because of that timeout.

Relevant upstream issue - microsoft/vscode#73656

The python extension had "contains **/*.py" ahead ago and after receiving multiple complaints, they only have "onlanguage" (which causes confusion among students). Eventually, I found out that their workaround was to look for an empty file ("mspythonconfig.yaml" or sth -- confusing name, don't think it serves any other purpose) in root folder only..

[2021-11-15 10:56:42.759] [exthost] [info] Extension host with pid 828056 started
[2021-11-15 10:56:42.760] [exthost] [info] Skipping acquiring lock for /home/user/.config/Code/User/workspaceStorage/4bd77312219e9d8f35e159b7431dfc25.
[2021-11-15 10:56:43.909] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
[2021-11-15 10:56:43.969] [exthost] [info] ExtensionService#_doActivateExtension polymer.polymer-ide, startup: false, activationEvent: 'onLanguage:plaintext'
[2021-11-15 10:56:44.017] [exthost] [info] ExtensionService#_doActivateExtension ms-python.python, startup: false, activationEvent: 'onLanguage:python', root cause: ms-python.vscode-pylance
[2021-11-15 10:56:44.969] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter, startup: false, activationEvent: 'onLanguage:python'
[2021-11-15 10:56:46.146] [exthost] [info] ExtensionService#_doActivateExtension njpwerner.autodocstring, startup: false, activationEvent: 'onLanguage:python'
[2021-11-15 10:56:46.246] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.274] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*', root cause: vscode.github
[2021-11-15 10:56:46.506] [exthost] [info] ExtensionService#_doActivateExtension bierner.emojisense, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.566] [exthost] [info] ExtensionService#_doActivateExtension christian-kohler.path-intellisense, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.643] [exthost] [info] ExtensionService#_doActivateExtension ecmel.vscode-html-css, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.775] [exthost] [info] ExtensionService#_doActivateExtension EditorConfig.EditorConfig, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.839] [exthost] [info] ExtensionService#_doActivateExtension Equinusocio.vsc-material-theme, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.870] [exthost] [info] ExtensionService#_doActivateExtension equinusocio.vsc-material-theme-icons, startup: true, activationEvent: '*'
[2021-11-15 10:56:46.897] [exthost] [info] ExtensionService#_doActivateExtension GitHub.vscode-pull-request-github, startup: true, activationEvent: '*'
[2021-11-15 10:56:47.188] [exthost] [info] ExtensionService#_doActivateExtension HookyQR.beautify, startup: true, activationEvent: '*'
[2021-11-15 10:56:47.297] [exthost] [info] ExtensionService#_doActivateExtension lostintangent.wikilens, startup: true, activationEvent: '*'
[2021-11-15 10:56:47.454] [exthost] [info] ExtensionService#_doActivateExtension ms-vsliveshare.vsliveshare, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.314] [exthost] [info] ExtensionService#_doActivateExtension oderwat.indent-rainbow, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.324] [exthost] [info] ExtensionService#_doActivateExtension PKief.material-icon-theme, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.381] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.cpptools, startup: true, activationEvent: '*', root cause: platformio.platformio-ide
[2021-11-15 10:56:49.600] [exthost] [info] ExtensionService#_doActivateExtension rusnasonov.vscode-hugo, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.755] [exthost] [info] ExtensionService#_doActivateExtension stkb.rewrap, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.832] [exthost] [info] ExtensionService#_doActivateExtension vscode-icons-team.vscode-icons, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.962] [exthost] [info] ExtensionService#_doActivateExtension vsls-contrib.codetour, startup: true, activationEvent: '*'
[2021-11-15 10:56:49.996] [exthost] [info] ExtensionService#_doActivateExtension vsls-contrib.gistfs, startup: true, activationEvent: '*'
[2021-11-15 10:56:50.104] [exthost] [info] ExtensionService#_doActivateExtension vsls-contrib.gitdoc, startup: true, activationEvent: '*'
[2021-11-15 10:56:50.894] [exthost] [info] ExtensionService#_doActivateExtension Dart-Code.dart-code, startup: true, activationEvent: 'workspaceContainsTimeout:*/pubspec.yaml,*/*/pubspec.yaml,*.dart,*/*.dart,*/*/*.dart'
[2021-11-15 10:56:51.212] [exthost] [info] ExtensionService#_doActivateExtension golang.go, startup: true, activationEvent: 'workspaceContainsTimeout:**/*.go'
[2021-11-15 10:56:53.209] [exthost] [info] ExtensionService#_doActivateExtension codespaces-contrib.codeswing, startup: false, activationEvent: 'api', root cause: vsls-contrib.gistfs
[2021-11-15 10:56:55.758] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
[2021-11-15 10:56:56.959] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[2021-11-15 10:56:56.965] [exthost] [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint, startup: false, activationEvent: 'onStartupFinished'
[2021-11-15 10:56:57.142] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
[2021-11-15 10:56:57.747] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
[2021-11-15 10:56:58.039] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'
[2021-11-15 10:56:58.047] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2021-11-15 10:56:58.269] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2021-11-15 10:56:58.503] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter-renderers, startup: false, activationEvent: 'api', root cause: ms-toolsai.jupyter
[2021-11-15 10:57:00.055] [exthost] [info] ExtensionService#_doActivateExtension ms-python.vscode-pylance, startup: false, activationEvent: 'onLanguage:python'
[2021-11-15 10:57:22.264] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
[2021-11-15 10:57:22.277] [exthost] [info] ExtensionService#_doActivateExtension platformio.platformio-ide, startup: true, activationEvent: '*'
[2021-11-15 10:57:22.649] [exthost] [info] Eager extensions activated

Looking into the history of the Go extension, I found this rule was added by microsoft/vscode-go#2859 to address microsoft/vscode-go#2821

  • User-visible impact

    • gopls is getting activated and starts scanning the folders. Not sure whether the gopls will complain or not.
    • unnecessary UI components popping up: welcome page, go status bar items.
    • nagging popups for tool installation
  • Internal impact

    • spurious gopls update requests
    • spurious survey popup for users who do not develop in Go
  • Workaround for affected users - explicitly enable/disable the go extension for the workspace based on need through the extension view.

@gopherbot gopherbot added this to the Untriaged milestone Nov 15, 2021
@findleyr
Copy link
Contributor

Per microsoft/vscode#73656 (comment), maybe we could try limiting the depth of our search. Frankly, if no go files are contained within a few layers of directories, we'd probably be better of not starting the extension (I assume it would be started when the first Go file is opened).

@hyangah how do you want to prioritize this?

@hyangah
Copy link
Contributor Author

hyangah commented Nov 22, 2021

@findleyr's suggestion is reasonable and we can change this to Dart's approach (only look at only a couple of layers).

Reading the original issue microsoft/vscode-go#2821
I think the fix should've been just adding more "onCommand:..." commands instead of eager loading.

We should consider to drop this eager loading like Python - however, currently, gopls's initial package loading may not be prompt enough for a large project so we will continue to activate the extension if .go files are found in the top levels.

@hyangah hyangah modified the milestones: Untriaged, Unplanned Nov 22, 2021
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/366916 mentions this issue: package.json: limit file search scope for extension activation

@hyangah hyangah modified the milestones: Unplanned, v0.30.0 Dec 9, 2021
@golang golang locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants