-
Notifications
You must be signed in to change notification settings - Fork 770
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
gopls/vulncheck: use result from gopls.vulncheck, rather than gopls.fetch_vulncheck_result #3572
Comments
Decisions, from our meeting:
In pseudocode:
In this case, the header has a single piece of metadata: |
FWIW this is the upstream issue for the LSP protocol change that would make this unnecessary: (Which will happen first: this proposal getting approved, or the sun exhausting its nonmetallic fuel? Only time will tell!) |
I don't know what is the current status of gopls. |
Shoot, I forgot to fix this before the -pre.1 release. I'll fix now, and we can cut -pre.2. |
Change https://go.dev/cl/627556 mentions this issue: |
As described in golang/vscode-go#3572 this CL reverts the behavior of the gopls.run_govulncheck command to be asynchronous. Instead, we introduce a new gopls.vulncheck command to run synchronously. We also introduce a new "vulncheck" codelens setting to control the availability of codelenses for this new command. For expedience, the command handler is simply copied rather than refactored, and minimal tests are added/modified to test the new command. Hopefully we can migrate everything to the new command soon, and delete the old command. For golang/vscode-go#3572 Change-Id: Ib3cffd5fd038813680087fa1916127663f377581 Reviewed-on: https://go-review.googlesource.com/c/tools/+/627556 Reviewed-by: Alan Donovan <[email protected]> Auto-Submit: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
As described in golang/vscode-go#3572 this CL reverts the behavior of the gopls.run_govulncheck command to be asynchronous. Instead, we introduce a new gopls.vulncheck command to run synchronously. We also introduce a new "vulncheck" codelens setting to control the availability of codelenses for this new command. For expedience, the command handler is simply copied rather than refactored, and minimal tests are added/modified to test the new command. Hopefully we can migrate everything to the new command soon, and delete the old command. For golang/vscode-go#3572 Change-Id: Ib3cffd5fd038813680087fa1916127663f377581 Reviewed-on: https://go-review.googlesource.com/c/tools/+/627556 Reviewed-by: Alan Donovan <[email protected]> Auto-Submit: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Hi @findleyr I have done some reading in vscode-go side but I need more clarification on this issue. Based on my understanding, the current state is:
The end goal of this is:
Other things:
|
Thanks, @h9jiang, I think that sounds approximately correct. Responses below.
You mean, this is how it currently behaves, right?
Good point. Do you want to start by adding support to VS Code for detecting "style=log", and then add this to gopls? Perhaps we should inject a setting into the gopls initialization options to indicate that the client support this type of progress redirection. That way, we don't show this in other clients. |
Today, the current implementation is limited only for vulncheck. It's kind of customized for vulncheck. What I'm asking is, should generalize this kind of customization so it can be used for other async calls that gopls may support in the future? We have some pre-defined text customize for vulncheck, to generalize this, these text would be better to integrated in gopls instead of pre-defining them in vscode-go. Like Code. My intention here is, minimum customization logic in vscode-go so it's more generalize. This means gopls will need to report some extra text back to vscode-go.
Sure. I will start working on this. But maybe one step at a time,
Thank you for the clarification. |
Generalizing sounds good. In that case, should we include the command that is running in the structured initial progress message?
|
Change https://go.dev/cl/644896 mentions this issue: |
Change https://go.dev/cl/645116 mentions this issue: |
Change https://go.dev/cl/645695 mentions this issue: |
The client (vscode-go) need token to correlate the executeCommand response with the workDoneProgress. vscode-go will surface both the $/progress.Message and executeCommand.Res in the same terminal. For golang/vscode-go#3572 Change-Id: Idb9b0c36783817d6c9f6d672e82b39ae9c501a21 Reviewed-on: https://go-review.googlesource.com/c/tools/+/644896 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Hongxiang Jiang <[email protected]>
The client need to indicate the message style it support for work done progress message in ClientCapabilities.experimental['progress-message-style'] = ['log', ...] Gopls will keep track of the supported styling formats from client and will only embed style metadata in WorkDoneProgressBegin's message field as "style: ${STYLE}\n\n${MESSAGE}" only if the client support them. At this point, gopls will only send message without styling or with log styling. VSCode-Go side change CL 645116. For golang/vscode-go#3572 Change-Id: I792211fd5885c8ef932e054fe46cf75b2695f47a Reviewed-on: https://go-review.googlesource.com/c/tools/+/645695 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
If the $/progress's begin message start with style: log, the all message for this progress token will be streamed to a terminal. Because executeCommand extends workDoneProgress, if response from executeCommand contains progress token, the result will be streamed to the same terminal. Gopls side change CL 645695. For #3572 Change-Id: I3ad4db2604423a2285a7c0f57b8a4d66d2c1933a Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/645116 kokoro-CI: kokoro <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Madeline Kalil <[email protected]>
In https://go.dev/cl/621055, I added support async request handling to gopls, using it to make long running command handlers run asynchronous to other LSP requests. This means that we no longer need our hacky gopls.fetch_vulncheck_result command to collect vulncheck results: the client can simply await the command result.
I didn't remove the gopls.fetch_vulncheck_result command. However, there IS an observable change in behavior for vulncheck integration in gopls: previously the gopls.run_vulncheck command would return quickly. Now it does not.
Therefore, we need to:
The text was updated successfully, but these errors were encountered: