congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
CodeCompletionHandlerBase.invokeCompletion
Code IndexAdd Tabnine to your IDE (free)

How to use
invokeCompletion
method
in
com.intellij.codeInsight.completion.CodeCompletionHandlerBase

Best Java code snippets using com.intellij.codeInsight.completion.CodeCompletionHandlerBase.invokeCompletion (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: hsz/idea-gitignore

/**
 * Handles QuickFix action invoked on {@link IgnoreSyntax}.
 *
 * @param project      the {@link Project} containing the working file
 * @param file         the {@link PsiFile} containing handled entry
 * @param startElement the {@link IgnoreSyntax} that will be selected and replaced
 * @param endElement   the {@link PsiElement} which is ignored in invoked action
 */
@Override
public void invoke(@NotNull Project project, @NotNull PsiFile file,
          @Nullable("is null when called from inspection") Editor editor,
          @NotNull PsiElement startElement, @NotNull PsiElement endElement) {
  if (startElement instanceof IgnoreSyntax) {
    PsiElement value = ((IgnoreSyntax) startElement).getValue();
    if (editor != null) {
      editor.getSelectionModel().setSelection(
          value.getTextOffset(),
          value.getTextOffset() + value.getTextLength()
      );
    }
    new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(project, editor);
  }
}
origin: Haehnchen/idea-php-symfony2-plugin

  @Override
  public void run() {
    final CodeCompletionHandlerBase handler = new CodeCompletionHandlerBase(CompletionType.BASIC) {
      @Override
      protected void completionFinished(final CompletionProgressIndicator indicator, boolean hasModifiers) {
        // find our lookup element
        final LookupElement lookupElement = ContainerUtil.find(indicator.getLookup().getItems(), new Condition<LookupElement>() {
          @Override
          public boolean value(LookupElement lookupElement) {
            return insert.match(lookupElement);
          }
        });
        if(lookupElement == null) {
          fail("No matching lookup element found");
        }
        // overwrite behavior and force completion + insertHandler
        CommandProcessor.getInstance().executeCommand(indicator.getProject(), new Runnable() {
          @Override
          public void run() {
            CommandProcessor.getInstance().setCurrentCommandGroupId("Completion" + indicator.hashCode());
            indicator.getLookup().finishLookup(Lookup.AUTO_INSERT_SELECT_CHAR, lookupElement);
          }
        }, "Autocompletion", null);
      }
    };
    Editor editor = InjectedLanguageUtil.getEditorForInjectedLanguageNoCommit(getEditor(), getFile());
    handler.invokeCompletion(getProject(), editor);
    PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
  }
}, null, null);
origin: Camelcade/Perl5-IDEA

 @Override
 public void handleInsert(@NotNull final InsertionContext context, @NotNull LookupElement item) {

  final Editor editor = context.getEditor();
  if ("returns".equals(item.getLookupString())) {
   EditorModificationUtil.insertStringAtCaret(editor, " ");

   context.setLaterRunnable(() -> new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(context.getProject(), editor, 1));
  }
 }
}
origin: Camelcade/Perl5-IDEA

 @Override
 public void handleInsert(@NotNull final InsertionContext context, @NotNull final LookupElement item) {
  // fixme this is bad check for auto-inserting, i belive
  if (context.getCompletionChar() != '\u0000') {
   context.setLaterRunnable(() -> {
    Editor editor = context.getEditor();
    new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(context.getProject(), editor, 1);
   });
  }
 }
}
origin: mustfun/mybatis-plus

  @Override
  public void run() {
    //当前文件是否最新,没有未提交的
    if (PsiDocumentManager.getInstance(project).isCommitted(editor.getDocument())) {
      //唤醒代码自动补全 , CompletionContributor
      new CodeCompletionHandlerBase(CompletionType.BASIC).invokeCompletion(project, editor, 1);
    }
  }
});
origin: google/ijaas

 handler.invokeCompletion(project, editor);
},
null,
com.intellij.codeInsight.completionCodeCompletionHandlerBaseinvokeCompletion

Popular methods of CodeCompletionHandlerBase

  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • BoxLayout (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now