Skip to content

Commit 38606b3

Browse files
committed
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> gopls-CI: kokoro <[email protected]>
1 parent e8cdaf4 commit 38606b3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gopls/internal/lsp/cache/analysis.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,7 @@ func (snapshot *snapshot) Analyze(ctx context.Context, pkgs map[PackageID]unit,
354354
if now.Sub(lastReport) > reportEvery {
355355
lastReport = now
356356
// Trailing space is intentional: some LSP clients strip newlines.
357-
msg := fmt.Sprintf(`Constructing index of analysis facts... (%d/%d packages).
358-
(Set "analysisProgressReporting" to false to disable notifications.)`,
357+
msg := fmt.Sprintf(`Indexed %d/%d packages. (Set "analysisProgressReporting" to false to disable notifications.)`,
359358
completed, len(nodes))
360359
pct := 100 * float64(completed) / float64(len(nodes))
361360
wd.Report(ctx, msg, pct)

0 commit comments

Comments
 (0)