Skip to content

Commit

Permalink
feat(language-client): round progress percentage (#4916)
Browse files Browse the repository at this point in the history
elm-language-server may returns `"percentage":100.00000000000155`
  • Loading branch information
fannheyward authored Mar 1, 2024
1 parent 7f8ae84 commit bd303cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/language-client/progressPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export class ProgressPart {
let msg: { message?: string, increment?: number } = {}
if (params.message) msg.message = params.message
if (validPercent(params.percentage)) {
msg.increment = params.percentage - this._percent
this._percent = params.percentage
msg.increment = Math.round(params.percentage) - this._percent
this._percent = Math.round(params.percentage)
}
if (Object.keys(msg).length > 0) {
this.progress.report(msg)
Expand Down

0 comments on commit bd303cf

Please sign in to comment.