diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/LSContentAssistProcessor.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/LSContentAssistProcessor.java index 4d550ad45..2017d0c26 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/LSContentAssistProcessor.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/LSContentAssistProcessor.java @@ -18,6 +18,7 @@ import com.intellij.codeInsight.lookup.LookupElementBuilder; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; @@ -76,6 +77,8 @@ public void fillCompletionVariants(@NotNull CompletionParameters parameters, @No } } + } catch (ProcessCanceledException cancellation){ + throw cancellation; } catch (RuntimeException | InterruptedException e) { LOGGER.warn(e.getLocalizedMessage(), e); result.addElement(createErrorProposal(offset, e)); @@ -88,7 +91,7 @@ private Collection toProposals(Project project, Editor CompletionList> completion, LanguageServer languageServer) { if (completion != null) { List items = completion.isLeft()?completion.getLeft():completion.getRight().getItems(); - boolean isIncomplete = completion.isLeft()?false:completion.getRight().isIncomplete(); + boolean isIncomplete = completion.isRight() && completion.getRight().isIncomplete(); return items.stream().map(item -> createLookupItem(project, editor, offset, item, isIncomplete, languageServer)). filter(item -> item.validate(document, offset, null)). map(item -> PrioritizedLookupElement.withGrouping(item, item.getItem().getKind().getValue())).