Skip to content

Commit

Permalink
fix(intellij): add try-catch for inline completion request. (#3416)
Browse files Browse the repository at this point in the history
  • Loading branch information
icycodes authored Nov 14, 2024
1 parent 13febf5 commit 3e4618b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ class InlineCompletionService(private val project: Project) : Disposable {
val server = getServer() ?: return@launch
logger.debug("Request inline completion: $params")
project.safeSyncPublisher(Listener.TOPIC)?.loadingStateChanged(true)
val inlineCompletionList = server.textDocumentFeature.inlineCompletion(params).await()
val inlineCompletionList = try {
server.textDocumentFeature.inlineCompletion(params).await()
} catch (e: Exception) {
logger.warn("Error while requesting inline completion", e)
null
}
val context = current
if (requestContext == context?.request) {
logger.debug("Request inline completion done: $inlineCompletionList")
Expand Down

0 comments on commit 3e4618b

Please sign in to comment.