All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intellij.codeInsight.completion.XmlNameCompletionConfidence Maven / Gradle / Ivy

Go to download

A packaging of the IntelliJ Community Edition xml library. This is release number 1 of trunk branch 142.

The newest version!
package com.intellij.codeInsight.completion;

import com.intellij.lang.ASTNode;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.xml.XmlTokenType;
import com.intellij.util.ThreeState;
import org.jetbrains.annotations.NotNull;

/**
 * @author peter
 */
public class XmlNameCompletionConfidence extends CompletionConfidence{
  @NotNull
  @Override
  public ThreeState shouldFocusLookup(@NotNull CompletionParameters parameters) {
    final ASTNode node = parameters.getPosition().getNode();
    if (node == null) return ThreeState.UNSURE;

    final IElementType elementType = node.getElementType();
    if (elementType == XmlTokenType.XML_NAME || elementType == XmlTokenType.XML_TAG_NAME) {
      return ThreeState.YES;
    }
    return ThreeState.UNSURE;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy