From a80931dd2e6932a5eab323e4d8a8e56b359d40d4 Mon Sep 17 00:00:00 2001 From: Peter Weinberger Date: Tue, 15 Aug 2023 12:46:20 -0400 Subject: [PATCH] gopls/telemetry: accept vscode-insiders as a known editor Also, for unknown editors, increment a local counter in addition to gopls/client:other Change-Id: Id689343502f62b1479497eca81b0ef3944898d8c Reviewed-on: https://go-review.googlesource.com/c/tools/+/519735 TryBot-Result: Gopher Robot gopls-CI: kokoro Reviewed-by: Hyang-Ah Hana Kim Run-TryBot: Peter Weinberger --- gopls/internal/telemetry/telemetry.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gopls/internal/telemetry/telemetry.go b/gopls/internal/telemetry/telemetry.go index 62c89b7610d..d3a9f6388a2 100644 --- a/gopls/internal/telemetry/telemetry.go +++ b/gopls/internal/telemetry/telemetry.go @@ -27,6 +27,8 @@ func RecordClientInfo(params *protocol.ParamInitialize) { switch params.ClientInfo.Name { case "Visual Studio Code": client = "gopls/client:vscode" + case "Visual Studio Code - Insiders": + client = "gopls/client:vscode-insiders" case "VSCodium": client = "gopls/client:vscodium" case "code-server": @@ -47,6 +49,10 @@ func RecordClientInfo(params *protocol.ParamInitialize) { case "Sublime Text LSP": // https://github.com/sublimelsp/LSP/blob/e608f878e7e9dd34aabe4ff0462540fadcd88fcc/plugin/core/sessions.py#L493 client = "gopls/client:sublimetext" + default: + // at least accumulate the client name locally + counter.New(fmt.Sprintf("gopls/client-other:%s", params.ClientInfo.Name)).Inc() + // but also record client:other } } counter.Inc(client)