void (@NotNull final CompletionParameters parameters, @NotNull final CompletionResultSet result) { if (parameters.getInvocationCount() == 0) { return; } final PsiFile file = parameters.getOriginalFile(); final Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file); if (document != null) { JComboBox comboBox = document.getUserData(StringComboboxEditor.COMBO_BOX_KEY); if (comboBox != null) { String substring = document.getText().substring(0, parameters.getOffset()); boolean plainPrefixMatcher = Boolean.TRUE.equals(document.getUserData(StringComboboxEditor.USE_PLAIN_PREFIX_MATCHER)); final CompletionResultSet resultSet = plainPrefixMatcher ? result.withPrefixMatcher(new PlainPrefixMatcher(substring)) : result.withPrefixMatcher(substring); final LookupElementProvider lookupElementProvider = LOOKUP_ELEMENT_PROVIDER_KEY.get(document, LookupElementProvider.DEFAULT); final int count = comboBox.getItemCount(); for (int i = 0; i < count; i++) { final Object o = comboBox.getItemAt(i); if (o instanceof String) { resultSet.addElement(PrioritizedLookupElement.withPriority(lookupElementProvider.createLookupElement((String)o), count - i)); } } if (!Boolean.TRUE.equals(document.getUserData(CONTINUE_RUN_COMPLETION))) { result.stopHere(); } } } }