Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build/taskProgress aren't forwarded when status bar is "off" #6187

Closed
ckipp01 opened this issue Mar 1, 2024 · 1 comment · Fixed by #6144
Closed

build/taskProgress aren't forwarded when status bar is "off" #6187

ckipp01 opened this issue Mar 1, 2024 · 1 comment · Fixed by #6144
Labels
bug Something that is making a piece of functionality unusable
Milestone

Comments

@ckipp01
Copy link
Member

ckipp01 commented Mar 1, 2024

Describe the bug

When turning off the status bar an LSP client isn't forwarded the actual progress updates from the build server. You can see here:

statusBar.trackFuture(
s"Compiling $name",
promise.future,
showTimer = true,
progress = Some(compilation.progress),
)

That when the task start happens it finds the compilation and calls trackFuture. It's in here that the actual check for "off" is and the progess is created and both the create and notify is done one right after the other:

if (clientConfig.statusBarState == StatusBarState.Off) {
val uuid = UUID.randomUUID().toString()
val token = messages.Either.forLeft[String, Integer](uuid)
val begin = new WorkDoneProgressBegin()
begin.setTitle(message)
val notification =
messages.Either.forLeft[WorkDoneProgressNotification, Object](
begin
)
client.createProgress(new WorkDoneProgressCreateParams(token))
client.notifyProgress(new ProgressParams(token, notification))
value.map { result =>
val end = messages.Either.forLeft[WorkDoneProgressNotification, Object](
new WorkDoneProgressEnd()
)
client.notifyProgress(new ProgressParams(token, end))
result
}
} else {
items.add(Progress(message, value, showTimer, progress))
tickIfHidden()
value
}

Notice that the end is sent once the promise is completed. If you then look at what happens when a build/taskProgress comes in:

report.progress.update(params.getProgress, newTotal = 100)

The progress gets updated, but this will never actual be forwarded to the LSP client since there is no mechanism to check the queue and send them. There is a tick mechanism that at times updates the metals status, but doesn't send progress notifications.

Expected behavior

I'd expect that upon receiving a build/taskProgress with a compilation % that it would be forwarded to the LSP client.

Operating system

macOS

Editor/Extension

Nvim (nvim-metals)

Version of Metals

1.2.2+55-9855505a-SNAPSHOT

Extra context or search terms

No response

@tgodzik tgodzik added the bug Something that is making a piece of functionality unusable label Mar 1, 2024
@tgodzik tgodzik added this to Triage in Metals Issue Board via automation Mar 1, 2024
@kasiaMarek
Copy link
Contributor

kasiaMarek commented Mar 1, 2024

I think this: #6144 will resolve that issue as well. So if you feel like reviewing, I encourage you.

@kasiaMarek kasiaMarek moved this from Triage to In progress in Metals Issue Board Mar 14, 2024
Metals Issue Board automation moved this from In progress to Done Apr 19, 2024
@tgodzik tgodzik added this to the Metals v1.3.1 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable
Projects
Development

Successfully merging a pull request may close this issue.

3 participants