-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: workspace/configuration
clarification
#38819
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
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
Actually, it's worse than that. If my gopls settings are these: {
"hoverKind": "Structured",
"fuzzyMatching": false
} Then I do get structured hover. However, the {
"gopls": {
"hoverKind": "Structured",
"fuzzyMatching": false
}
} In which case I get default hover kind and my client runs into a This just further makes it really hard to properly implement |
Sorry about the lack of documentation. Lots of things are still in flux, which is why we've been hesitant to formalize them. The
Regarding your second question, the example given in that document is actually an example of how the settings might look in VS Code. Written above that snippet is:
That is definitely not a clear phrase, so I'll make a note to fix it, and thank you for pointing it out. The correct response should look like the one in your first example. However, a user of your LSP client may have a |
I happened to exchange some messages with @findleyr on this yesterday. I think there are two issues we should look to solve with the current server-to-client
|
Considering So far, the only two servers that I tested RA wants clients to do something like this:
This approach clearly wouldn't work with gopls, since even Considering microsoft/language-server-protocol#676, I believe RA is correct here. |
I'm sorry, @bstaletic, but I'm not entirely sure I understand your comment. Are you saying that you expect your client to send settings that looks like your second example? {
"gopls": {
"hoverKind": "Structured",
"fuzzyMatching": false
}
} Effectively, all There is also no requirement that the user's settings look a certain way; the client can have different names for these settings or a different format, as long as it "translates" them into something that |
My client doesn't yet support workspace/configuration. I am looking for a way to implement it in a generic way, so it works with all servers. With rust-analyzer and gopls having different client-side expectations, right now that seems impossible. At least without "translating" settings, as you have put it, which requires server specific knowledge. |
I'm still not sure that I understand what your request is - what do the configurations look like for rust-analyzer? |
For rust-analyzer they look like this:
And the server sends the request with |
This behavior is not defined in the LSP spec, so I'm not inclined to change it here. The
The intent is to make the mapping between sections and results clear, meaning that servers need not require the name of the section in the result. I'm sorry, but unless something is in the LSP spec, we will likely not modify our behavior. |
Rust-analyzer isn't expecting the name of the sections in the response either. It's expecting the value of the key named the same as the section - i.e. the value for the Anyway, thanks for your time. I realize that this part of the protocol is impossible to implement correctly. |
This isn't really a bug report, just a question. If you still need me to fill out the issue template, I will.
Today I tried to implement
workspace/configuration
support in my client. As far as I understand the intent of this request, based on microsoft/language-server-protocol#676workspace/configuration
requests as necessary.This basically means that the client should respond with a list of
setting[ 'some_key' ]
values, where'some_key'
comes fromsection
fieldrequest[ 'params' ][ 'items' ]
list. So far, so good.Gopls sends a
workspace/configuration
request that looks like this:The configuration docs only ever mention the
gopls
key/section. So how is the client supposed to respond togopls-go_module
section?The text was updated successfully, but these errors were encountered: