congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CodeCompletionHandlerBase
Code IndexAdd Tabnine to your IDE (free)

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

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

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: google/ijaas

 handler.invokeCompletion(project, editor);
},
null,
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: 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: 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));
  }
 }
}
com.intellij.codeInsight.completionCodeCompletionHandlerBase

Most used methods

  • invokeCompletion
  • <init>

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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