fix: replace 'ProcessCancelledException' with 'CancellationException'

This commit is contained in:
Akash Yadav
2023-12-02 23:42:59 +05:30
parent 4de1a6acb2
commit 5d1faba441
7 changed files with 22 additions and 54 deletions
@@ -25,12 +25,12 @@ import com.itsaky.androidide.lsp.models.FailureType.COMPLETION
import com.itsaky.androidide.lsp.models.LSPFailure
import com.itsaky.androidide.lsp.util.setupLookupForCompletion
import com.itsaky.androidide.models.Position
import com.itsaky.androidide.progress.ProcessCancelledException
import com.itsaky.androidide.utils.ILogger
import io.github.rosemoe.sora.lang.completion.CompletionCancelledException
import io.github.rosemoe.sora.text.CharPosition
import io.github.rosemoe.sora.text.ContentReference
import java.nio.file.Path
import java.util.concurrent.CancellationException
/**
* Common implementation of completion provider which requests completions to provided language
@@ -75,12 +75,12 @@ internal class CommonCompletionProvider(
server.complete(params)
} catch (e: Throwable) {
if (e is ProcessCancelledException) {
if (e is CancellationException) {
log.debug("Completion process cancelled")
}
// Do not log if completion was interrupted or cancelled
if (!(e is ProcessCancelledException || e is CompletionCancelledException)) {
if (!(e is CancellationException || e is CompletionCancelledException)) {
if (!server.handleFailure(LSPFailure(COMPLETION, e))) {
log.error("Unable to compute completions", e)
}