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

Cancelling compilation doesn't always cancel compilation #5251

Closed
ckipp01 opened this issue May 21, 2023 · 2 comments
Closed

Cancelling compilation doesn't always cancel compilation #5251

ckipp01 opened this issue May 21, 2023 · 2 comments
Milestone

Comments

@ckipp01
Copy link
Member

ckipp01 commented May 21, 2023

Describe the bug

I noticed that when working in codebases that take quite some time to compile, when I try the cancel compilation command it doesn't always work. For example I recently tried this in Dotty and looking at the LSP logs I see:

[Trace - 05:45:09 pm] Received request 'workspace/executeCommand - (30)'
Params: {
  "command": "metals.compile-cancel"
}


[Trace - 05:45:09 pm] Sending notification 'window/logMessage'
Params: {
  "type": 4,
  "message": "2023.05.21 17:45:09 INFO  compilation cancelled"
}


[Trace - 05:45:09 pm] Sending response 'workspace/executeCommand - (30)'. Processing request took 1ms
Result: {}

[Trace - 05:45:09 pm] Sending notification 'metals/status'
Params: {
  "text": "Compiling scala3-compiler 1m36s (0%)"
}

Notice that I'm still getting notifications about compilation after the "INFO compilation cancelled".

Expected behavior

I'd expect a cancel compilation request to cancel all ongoing compilation.

Operating system

macOS

Editor/Extension

Nvim (nvim-metals)

Version of Metals

0.11.12+61-88c5e82e-SNAPSHOT

Extra context or search terms

This was using sbt as my build server.

@tgodzik
Copy link
Contributor

tgodzik commented May 22, 2023

I think that cancelling i closely related to progress. So there is a check for cancel whenever work advances, there is no actual forcing of compilation stop.

Though I wonder whether this is Bloop or sbt? I think only Bloop has an actual support for cancelling. It should also get a notification about that. If it doesn't we might need to fix something on the Metals side.

@tgodzik
Copy link
Contributor

tgodzik commented Jan 5, 2024

Looks like this is the same issue as #5643 and we are waiting for the fix in dotty itself

@tgodzik tgodzik closed this as completed Jan 5, 2024
@tgodzik tgodzik closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2024
@kasiaMarek kasiaMarek added this to the Metals v1.2.1 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants