void () { CodeFenceLanguageProvider.EP_NAME.getPoint().registerExtension(new CodeFenceLanguageProvider() { @Nullable @Override public Language getLanguageByInfoString(@NotNull String infoString) { return null; } @NotNull @Override public List<LookupElement> getCompletionVariantsForInfoString(@NotNull CompletionParameters parameters) { return Collections.singletonList(LookupElementBuilder.create("{json is a great lang}") .withInsertHandler((context, item) -> { context.getDocument().insertString(context.getEditor().getCaretModel().getOffset(), "Customized insertion"); context.getEditor().getCaretModel().moveCaretRelatively("Customized insertion".length(), 0, true, false, true); })); } }, myFixture.getTestRootDisposable()); configure(); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "json", "{json is a great lang}"); myFixture.type("g\t"); checkResult(); }