From 38606b3e25eb72862f76be310866a530f298892c Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Thu, 27 Jul 2023 12:01:05 -0400 Subject: [PATCH] gopls/internal/lsp/cache: keep analysis progress reports on one line VS Code exposes only one line for progress reports; as pointed out in golang/go#61352, multi-line reports cause a broken UI. Fixes golang/go#61352 Change-Id: I0b5864f9a0dbb0bd9d191075b6c1cf0c7285f4bc Reviewed-on: https://go-review.googlesource.com/c/tools/+/513735 Run-TryBot: Robert Findley TryBot-Result: Gopher Robot Reviewed-by: Hyang-Ah Hana Kim gopls-CI: kokoro --- gopls/internal/lsp/cache/analysis.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gopls/internal/lsp/cache/analysis.go b/gopls/internal/lsp/cache/analysis.go index 196991a0326..dd15843bc19 100644 --- a/gopls/internal/lsp/cache/analysis.go +++ b/gopls/internal/lsp/cache/analysis.go @@ -354,8 +354,7 @@ func (snapshot *snapshot) Analyze(ctx context.Context, pkgs map[PackageID]unit, if now.Sub(lastReport) > reportEvery { lastReport = now // Trailing space is intentional: some LSP clients strip newlines. - msg := fmt.Sprintf(`Constructing index of analysis facts... (%d/%d packages). -(Set "analysisProgressReporting" to false to disable notifications.)`, + msg := fmt.Sprintf(`Indexed %d/%d packages. (Set "analysisProgressReporting" to false to disable notifications.)`, completed, len(nodes)) pct := 100 * float64(completed) / float64(len(nodes)) wd.Report(ctx, msg, pct)