Skip to content
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 @@ -25,7 +25,6 @@
import com.intellij.openapi.util.SystemInfo
import com.intellij.util.EnvironmentUtil
import com.intellij.util.io.DigestUtil
import com.intellij.util.io.await
import com.intellij.util.net.HttpConfigurable
import com.intellij.util.net.JdkProxyProvider
import com.intellij.util.net.ssl.CertificateManager
Expand All @@ -39,6 +38,7 @@
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.future.asCompletableFuture
import kotlinx.coroutines.future.await
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
Expand Down Expand Up @@ -717,15 +717,22 @@
override fun dispose() {
if (!launcherFuture.isDone) {
try {
languageServer.apply {
shutdown().thenRun { exit() }
}
// otherwise can deadlock waiting for frozen flare process
cs.launch {
languageServer.apply {
withTimeout(2000) {
shutdown().await()
exit()
}
}
}.asCompletableFuture()
.get(3000, TimeUnit.MILLISECONDS)

Check warning on line 729 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt#L721-L729

Added lines #L721 - L729 were not covered by tests
} catch (e: Exception) {
LOG.warn(e) { "LSP shutdown failed" }
launcherHandler.destroyProcess()
launcherHandler.killProcess()

Check warning on line 732 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt#L732

Added line #L732 was not covered by tests
}
} else if (!launcherHandler.isProcessTerminated) {
launcherHandler.destroyProcess()
launcherHandler.killProcess()

Check warning on line 735 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt#L735

Added line #L735 was not covered by tests
}
}

Expand Down
Loading