This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Round WorkDoneProgressBegin.percentage down
AbandonedPublic

Authored by kbobyrev on Mar 4 2020, 5:41 AM.

Details

Reviewers
sammccall
Summary

When showing job progression in the text editors, it is hard to read
"precise" percentage numbers. This patch rounds
WorkDoneProgressBegin.percentage to 2 decimal places to improve readability.
While plugins might have different heuristics on how to display those numbers,
many of them will just show the value server provided and therefore it's easier
to do "formatting" on our side.

Diff Detail

Event Timeline

kbobyrev created this revision.Mar 4 2020, 5:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2020, 5:41 AM
kbobyrev updated this revision to Diff 248164.Mar 4 2020, 6:09 AM

%s/ceil/floor/g

sammccall added inline comments.Mar 4 2020, 2:28 PM
clang-tools-extra/clangd/ClangdLSPServer.cpp
1409

Yikes, rounding a float value in the protocol is pretty weird and would deserve more of a comment.

Also this seems like a fairly... improbable bug, in that it's trivial to fix in the editor and would usually be visible if the implementer tried the feature even once.

Which editors specifically are you seeing bad display in? Can we just send them a PR?

kbobyrev abandoned this revision.Mar 5 2020, 12:45 AM
kbobyrev marked an inline comment as done.
kbobyrev added inline comments.
clang-tools-extra/clangd/ClangdLSPServer.cpp
1409

Okay, makes sense. I saw this in coc.nvim and I can just fix it there, but I thought it might also happen in other editors. I also thought we do not care too much about precision here, but I'm OK with fixing it on the editor side.