[clangd] Fix data type of WorkDoneProgressReport::percentage

According to the specification, this should be an unsigned integer.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D101616
This commit is contained in:
Christian Kandeler 2021-05-10 14:56:55 +02:00 committed by Kadir Cetinkaya
parent 9ad9f0c731
commit f088af37e6
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
2 changed files with 2 additions and 2 deletions

View File

@ -1606,7 +1606,7 @@ void ClangdLSPServer::onBackgroundIndexProgress(
if (Stats.Completed < Stats.Enqueued) {
assert(Stats.Enqueued > Stats.LastIdle);
WorkDoneProgressReport Report;
Report.percentage = 100.0 * (Stats.Completed - Stats.LastIdle) /
Report.percentage = 100 * (Stats.Completed - Stats.LastIdle) /
(Stats.Enqueued - Stats.LastIdle);
Report.message =
llvm::formatv("{0}/{1}", Stats.Completed - Stats.LastIdle,

View File

@ -631,7 +631,7 @@ struct WorkDoneProgressReport {
///
/// The value should be steadily rising. Clients are free to ignore values
/// that are not following this rule.
llvm::Optional<double> percentage;
llvm::Optional<unsigned> percentage;
};
llvm::json::Value toJSON(const WorkDoneProgressReport &);
//