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

Consider not activating the extension until a go file is open or a user explicitly requests (command/setting) #2164

Closed
hyangah opened this issue Apr 5, 2022 · 3 comments
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Apr 5, 2022

Currently this extension is enabled automatically if there is a go file in the workspace.
In mono-repo cases, or where users use go as supporting languages (e.g. scripts, etc), this is too invasive.
Variety of notifications, survey prompts, and errors (often, gopls wouldn't be configured sufficiently for a large mono-repo) will be annoying. Activation of test explorer UIs, and repo scanning will cause the whole vscode sluggish or unpleasant.

The only concern is the delay when a Go user opens a Go file. How bad could it be?

cc @golang/tools-team

@gopherbot gopherbot added this to the Untriaged milestone Apr 5, 2022
@suzmue suzmue modified the milestones: Untriaged, On Deck Apr 7, 2022
@lijunsong
Copy link

lijunsong commented Sep 18, 2023

I found this problem annoying for big repos.

I found a commit 50b13f1 where the fix made the problem introduced only when the top 2 most subdirectories contain go files.

That was a solution but a weird one:

  1. for a small repo, the gopls loads super fast so it's OK to activate the extension only when a go file is opened.
  2. for a huge repo, where the repo usually contains many other languages and projects, It should activate the extension only when a go file is opened.

So for majority of the scenarios, the activationEvents shouldn't contain the workspaceContains instrument.

What do you think?

@findleyr
Copy link
Contributor

findleyr commented Nov 8, 2023

I think we should do this. My understanding is that the current behavior is an outlier among VS Code extensions and LSP clients.

One advantage of starting the extension earlier is that it is available to use workspace/symbol requests to jump to the first Go file. But in my experience with other editors (neovim), this is not a big deal: I am used to jumping to an arbitrary Go file to initiate the session, then jumping to symbols.

@hyangah hyangah modified the milestones: vscode-go/backlog, v0.41.0 Nov 22, 2023
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/545136 mentions this issue: package.json: remove 'workspaceContains' from activation events

@hyangah hyangah modified the milestones: v0.41.0, v0.40.1 Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants