@Test void testCustomize() { CompletionItem item = new CompletionItem(LABEL); CompletionItem actual = provider.customize(item); assertEquals(LABEL, actual.getLabel()); assertEquals(INSERT_TEXT, actual.getInsertText()); assertEquals(InsertTextFormat.Snippet, actual.getInsertTextFormat()); }
@Nonnull @Override public CompletionItem customize(@Nonnull CompletionItem item) { item.setInsertText(snippets.getInformationFor(item.getLabel())); item.setInsertTextFormat(InsertTextFormat.Snippet); return item; }
SnippetCompletion implements Completion { @Nonnull @Override public CompletionItem customize(@Nonnull CompletionItem item) { item.setInsertText(snippets.getInformationFor(item.getLabel())); item.setInsertTextFormat(InsertTextFormat.Snippet); return item; } }
SnippetCompletion implements Completion { @Nonnull @Override public CompletionItem customize(@Nonnull CompletionItem item) { item.setInsertText(snippets.getInformationFor(item.getLabel())); item.setInsertTextFormat(InsertTextFormat.Snippet); return item; } @Inject  SnippetCompletion(@Named("Snippets") CompletionStorage snippets); }
SnippetCompletion implements Completion { @Nonnull @Override public CompletionItem customize(@Nonnull CompletionItem item) { item.setInsertText(snippets.getInformationFor(item.getLabel())); item.setInsertTextFormat(InsertTextFormat.Snippet); return item; } @Inject  SnippetCompletion(@Named("Snippets") CompletionStorage snippets); @Nonnull @Override Collection<String> getCompletionSource(MyDocumentModel document); @Nullable @Override String tryResolve(@Nonnull String label); @Nonnull @Override String getSortOrderPrefix(); @Nonnull @Override CompletionItem customize(@Nonnull CompletionItem item); @Nonnull @Override CompletionItemKind getKind(); }
SnippetCompletion implements Completion { @Nonnull @Override public CompletionItem customize(@Nonnull CompletionItem item) { item.setInsertText(snippets.getInformationFor(item.getLabel())); item.setInsertTextFormat(InsertTextFormat.Snippet); return item; } @Inject  SnippetCompletion(@Named("Snippets") CompletionStorage snippets); @Nonnull @Override Collection<String> getCompletionSource(MyDocumentModel document); @Nullable @Override String tryResolve(@Nonnull String label); @Nonnull @Override String getSortOrderPrefix(); @Nonnull @Override CompletionItem customize(@Nonnull CompletionItem item); @Nonnull @Override CompletionItemKind getKind();  }