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

Kill and make sure that the presentation compiler is interrupted befo… #1272

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scala.tools.nsc.interactive

import java.util.logging.Level

import scala.tools.nsc.util.WorkScheduler
import scala.util.control.NonFatal

import scala.meta.internal.pc.ScalafixGlobal
Expand Down Expand Up @@ -29,8 +30,8 @@ trait ScalafixGlobalProxy { this: ScalafixGlobal =>
private def newRunnerThread(): Thread = {
if (compileRunner.isAlive) {
try {
val re = askForResponse(() => throw ShutdownReq)
re.get
this.askShutdown()
while (compileRunner.isAlive) Thread.sleep(0)
} catch {
case NonFatal(e) =>
println(
Expand All @@ -40,6 +41,7 @@ trait ScalafixGlobalProxy { this: ScalafixGlobal =>
)
}
}
this.scheduler = new WorkScheduler
compileRunner = new ScalafixGlobalThread(this, "Metals")
compileRunner.setDaemon(true)
compileRunner.start()
Expand Down