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: replace gopls.add_telemetry with a hidden gopls add_telemetry
command
#64428
Comments
Change https://go.dev/cl/546419 mentions this issue: |
Thank you for the CL, but as I said in the meeting, I want to have a light-weight hidden command for this and discuss general I am still not sure about
Most commands are designed to be used along with Code Lens, Code Action, and Diagnostics. That allowed us to change API of the custom commands (e.g. we can change |
The gopls CLI is no more supported or stable an interface than the various commands supported through the ExecuteCommand service method, so I'm not worried about increasing exposure through the CLI tool. You're right that many of the commands are low-level, internal, or redundant with other features, but they are often the only the way (short of writing code) to test an LSP-level feature in isolation while trying to minimize a reproducible test case for a user-reported issue---that's the main reason I've been adding commands recently, and I have wanted this 'gopls execute' on several occasions. At some point we should think about designing the command-line interface that we really want and committing to support it, because gopls is currently the only way for Go users to script various operations (such as renaming) that used to have a dedicated command-line tool. But that's not on our plans yet. When that happens, any existing command that we don't want to publish can be pushed beneath an "experimental" subcommand. |
It looks like |
Are there any counters that VS Code would want to update with high frequency? I.e., is there any performance advantage for an LSP command? I understand not now, but perhaps in the future? As described, the advantage of an add_telemetry command is that it need not involve any session initialization. I'm fine with both |
The 'gopls execute' command now exists and could be used for this purpose, but in discussion with @hyangah today she was inclined towards a Go-based helper program in the vscode-go project that would include any features that need to be implemented in Go (such as telemetry) but have nothing to do with LSP or gopls. That also seems like reasonable solution. |
We added gopls.add_telemetry to allow vscode-go to collect editor metrics through gopls. However, this LSP command works only gopls is up and running, which limits its utility. Instead, I propose to have a gopls subcommand, and vscode-go invokes that as a separate process. That will allow vscode-go to collect telemetry even when the language server is disabled.
The text was updated successfully, but these errors were encountered: