Making the progress an integer, as per the specification (#739)

This commit is contained in:
Jan Lahoda 2020-12-26 21:30:53 +01:00 committed by GitHub
parent 4c66fdf09d
commit 4ff22e6603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ struct WorkDoneProgress {
const char *kind; const char *kind;
std::optional<std::string> title; std::optional<std::string> title;
std::optional<std::string> message; std::optional<std::string> message;
std::optional<double> percentage; std::optional<int> percentage;
}; };
struct WorkDoneProgressParam { struct WorkDoneProgressParam {
const char *token; const char *token;

View File

@ -729,7 +729,7 @@ void mainLoop() {
(Twine(completed - last_idle) + "/" + Twine(enqueued - last_idle)) (Twine(completed - last_idle) + "/" + Twine(enqueued - last_idle))
.str(); .str();
param.value.percentage = param.value.percentage =
100.0 * (completed - last_idle) / (enqueued - last_idle); 100 * (completed - last_idle) / (enqueued - last_idle);
notify("$/progress", param); notify("$/progress", param);
} else if (in_progress) { } else if (in_progress) {
stats.last_idle.store(enqueued, std::memory_order_relaxed); stats.last_idle.store(enqueued, std::memory_order_relaxed);