Search in sources :

Example 1 with CompletionItemDTO

use of org.eclipse.che.api.languageserver.shared.lsapi.CompletionItemDTO in project che by eclipse.

the class LanguageServerCodeAssistProcessor method computeProposals.

private void computeProposals(String currentWord, int offset, CodeAssistCallback callback) {
    List<CompletionProposal> proposals = newArrayList();
    for (CompletionItemDTO item : latestCompletionResult.getCompletionList().getItems()) {
        List<Match> highlights = filter(currentWord, item);
        if (highlights != null) {
            proposals.add(new CompletionItemBasedCompletionProposal(item, documentServiceClient, latestCompletionResult.getDocumentId(), resources, imageProvider.getIcon(item.getKind()), serverCapabilities, highlights, offset));
        }
    }
    callback.proposalComputed(proposals);
}
Also used : CompletionProposal(org.eclipse.che.ide.api.editor.codeassist.CompletionProposal) CompletionItemDTO(org.eclipse.che.api.languageserver.shared.lsapi.CompletionItemDTO) Match(org.eclipse.che.plugin.languageserver.ide.filters.Match)

Aggregations

CompletionItemDTO (org.eclipse.che.api.languageserver.shared.lsapi.CompletionItemDTO)1 CompletionProposal (org.eclipse.che.ide.api.editor.codeassist.CompletionProposal)1 Match (org.eclipse.che.plugin.languageserver.ide.filters.Match)1