Java 类com.intellij.psi.impl.source.PsiLabelReference 实例源码

项目:intellij-ce-playground    文件:PsiBreakStatementImpl.java   
@Override
@NotNull
public PsiReference[] getReferences() {
  if (getLabelIdentifier() == null)
    return PsiReference.EMPTY_ARRAY;
  return new PsiReference[]{new PsiLabelReference(this, getLabelIdentifier())};
}
项目:intellij-ce-playground    文件:PsiContinueStatementImpl.java   
@Override
@NotNull
public PsiReference[] getReferences() {
  if (getLabelIdentifier() == null)
    return PsiReference.EMPTY_ARRAY;
  return new PsiReference[]{new PsiLabelReference(this, getLabelIdentifier())};
}
项目:intellij-ce-playground    文件:LabelReferenceCompletion.java   
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
                              ProcessingContext context,
                              @NotNull CompletionResultSet result) {
  PsiReference ref = parameters.getPosition().getContainingFile().findReferenceAt(parameters.getOffset());
  if (ref instanceof PsiLabelReference) {
    processLabelReference(result, (PsiLabelReference)ref);
  }
}
项目:tools-idea    文件:PsiBreakStatementImpl.java   
@Override
@NotNull
public PsiReference[] getReferences() {
  if (getLabelIdentifier() == null)
    return PsiReference.EMPTY_ARRAY;
  return new PsiReference[]{new PsiLabelReference(this, getLabelIdentifier())};
}
项目:tools-idea    文件:PsiContinueStatementImpl.java   
@Override
@NotNull
public PsiReference[] getReferences() {
  if (getLabelIdentifier() == null)
    return PsiReference.EMPTY_ARRAY;
  return new PsiReference[]{new PsiLabelReference(this, getLabelIdentifier())};
}
项目:consulo-java    文件:PsiBreakStatementImpl.java   
@Override
@NotNull
public PsiReference[] getReferences() {
  if (getLabelIdentifier() == null)
    return PsiReference.EMPTY_ARRAY;
  return new PsiReference[]{new PsiLabelReference(this, getLabelIdentifier())};
}
项目:consulo-java    文件:PsiContinueStatementImpl.java   
@Override
@NotNull
public PsiReference[] getReferences() {
  if (getLabelIdentifier() == null)
    return PsiReference.EMPTY_ARRAY;
  return new PsiReference[]{new PsiLabelReference(this, getLabelIdentifier())};
}
项目:consulo-java    文件:LabelReferenceCompletion.java   
@RequiredReadAction
@Override
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet result)
{
    PsiReference ref = parameters.getPosition().getContainingFile().findReferenceAt(parameters.getOffset());
    if(ref instanceof PsiLabelReference)
    {
        result.addAllElements(processLabelReference((PsiLabelReference) ref));
    }
}
项目:intellij-ce-playground    文件:LabelReferenceCompletion.java   
static void processLabelReference(CompletionResultSet result, PsiLabelReference ref) {
  for (String s : ref.getVariants()) {
    result.addElement(TailTypeDecorator.withTail(LookupElementBuilder.create(s), TailType.SEMICOLON));
  }
}
项目:tools-idea    文件:JavaCompletionContributor.java   
static void processLabelReference(CompletionResultSet result, PsiLabelReference ref) {
  for (String s : ref.getVariants()) {
    result.addElement(TailTypeDecorator.withTail(LookupElementBuilder.create(s), TailType.SEMICOLON));
  }
}
项目:consulo-java    文件:LabelReferenceCompletion.java   
static List<LookupElement> processLabelReference(PsiLabelReference ref)
{
    return ContainerUtil.map(ref.getVariants(), s -> TailTypeDecorator.withTail(LookupElementBuilder.create(s), TailType.SEMICOLON));
}