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

x/tools/gopls: clarify the expectation on workspace/configuration #41966

Open
hyangah opened this issue Oct 14, 2020 · 2 comments
Open

x/tools/gopls: clarify the expectation on workspace/configuration #41966

hyangah opened this issue Oct 14, 2020 · 2 comments

Comments

@hyangah
Copy link
Contributor

@hyangah hyangah commented Oct 14, 2020

For each folder in workspace, gopls currently sends a workspace/configuration request asking for two sections (gopls and gopls-<foldername>). For example, this is the configuration request/response trace when there are two folders (hello and hello2).

[Trace - 23:40:23.343 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/hello","section":"gopls"},{"scopeUri":"file:///Users/hakim/hello","section":"gopls-hello"}]}

[Trace - 23:40:23.349 PM] Sending response 'workspace/configuration - (2)' in 5ms.
Result: [{"env":{}},null]

...

[Trace - 23:40:23.467 PM] Received request 'workspace/configuration - (4)'.
Params: {"items":[{"scopeUri":"file:///Users/hakim/hello2","section":"gopls"},{"scopeUri":"file:///Users/hakim/hello2","section":"gopls-hello2"}]}

[Trace - 23:40:23.495 PM] Sending response 'workspace/configuration - (4)' in 28ms.
Result: [null,null]

I was told the gopls-<foldername> section is to allow per-folder configuration. However, given that gopls issues multiple configuration requests for each folder, I am not sure about this.

In case of vscode, it computes the effective configuration for the requested sections in the context of the requested scopeUri (by merging global+workspace+folder configuration) and returns the merged values. Even though this additional section request is not harmful and vscode-go can keep returning null, documenting the purpose and the expected client behavior would be nice.

@gopherbot gopherbot added this to the Unreleased milestone Oct 14, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Oct 14, 2020
@myitcv
Copy link
Member

@myitcv myitcv commented Oct 14, 2020

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 19, 2020

Change https://golang.org/cl/263524 mentions this issue: internal/lsp: remove per-workspace configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.