microsoft/compose-language-service

How to disable telemetry for clients other than VSCode?

gegoune opened this issue · 1 comments

I am using Neovim and its build in LSP client. That client allows me to pass in settings object that I believe are used to configure server. From documentation:

                  • settings: Map with language server specific settings.
                    These are returned to the language server if requested via
                    `workspace/configuration`. Keys are case-sensitive.

I have therefore configured it as such, based on https://github.com/microsoft/compose-language-service#telemetry:

vim.lsp.start {
    name = 'docker-compose',
    cmd = { 'docker-compose-langserver', '--stdio' },
    root_dir = vim.fs.dirname(vim.fs.find({ '.git' }, { upward = true })[1]),
    settings = { telemetry = { enableTelemetry = false } },
}

hoping that this will disable telemetry. It did not. Following events still get logged:

.../vim/lsp/rpc.lua:387    "rpc.receive"   {  jsonrpc = "2.0",  method = "telemetry/event",  params = {    eventName = "KeyHoverProvider",    groupingStrategy = "eventNameAndProperties",    measurements  […]

How should telemetry be disabled correctly? Thanks!

Hey @gegoune, that documentation refers to using the telemetry.enableTelemetry setting specifically within VSCode. It should be updated to reflect that. The language server protocol doesn't seem to have any way to configure telemetry in the client/server capabilities and settings exchange. However, the way the language server actually sends telemetry is to just send it to the client (VSCode or Vim), for the client to forward. If the Vim client ignores those messages, then nothing will happen. The telemetry.enableTelemetry setting in VSCode causes the VSCode language client (in this case, created by the Docker extension) to ignore those messages.