Java 类com.intellij.psi.impl.light.LightVariableBuilder 实例源码

项目:manifold-ij    文件:ManLightParameterImpl.java   
public ManLightParameterImpl( String name, PsiType type, PsiElement declarationScope, Language language )
{
  super( name, type, declarationScope, language );
  PsiManager manager = declarationScope.getManager();
  myNameIdentifier = new LightIdentifier( manager, name );
  ReflectionUtil.setFinalFieldPerReflection( LightVariableBuilder.class, this, LightModifierList.class,
                                             new ManLightModifierListImpl( manager, language ) );
}
项目:sqlitemagic    文件:SqliteMagicLightParameter.java   
public SqliteMagicLightParameter(@NotNull String name, @NotNull PsiType type, PsiElement declarationScope, Language language) {
  super(name, type, declarationScope, language);
  myName = name;
  PsiManager manager = declarationScope.getManager();
  myNameIdentifier = new SqliteMagicLightIdentifier(manager, name);
  ReflectionUtil.setFinalFieldPerReflection(LightVariableBuilder.class, this, LightModifierList.class,
      new SqliteMagicLightModifierList(manager, language));
}
项目:lombok-intellij-plugin    文件:LombokLightParameter.java   
public LombokLightParameter(@NotNull String name, @NotNull PsiType type, PsiElement declarationScope, Language language) {
  super(name, type, declarationScope, language);
  myName = name;
  PsiManager manager = declarationScope.getManager();
  myNameIdentifier = new LombokLightIdentifier(manager, name);
  ReflectionUtil.setFinalFieldPerReflection(LightVariableBuilder.class, this, LightModifierList.class,
    new LombokLightModifierList(manager, language));
}
项目:manifold-ij    文件:ManLightParameterImpl.java   
public ManLightParameterImpl setModifiers( String... modifiers )
{
  ManLightModifierListImpl modifierList = new ManLightModifierListImpl( getManager(), getLanguage(), modifiers );
  ReflectionUtil.setFinalFieldPerReflection( LightVariableBuilder.class, this, LightModifierList.class, modifierList );
  return this;
}
项目:intellij-ce-playground    文件:GantMemberContributor.java   
@Override
public void processDynamicElements(@NotNull PsiType qualifierType,
                                   PsiClass aClass,
                                   @NotNull PsiScopeProcessor processor,
                                   @NotNull PsiElement place,
                                   @NotNull ResolveState state) {
  if (aClass != null && ClassUtil.getSuperClassesWithCache(aClass).containsKey("groovy.util.AntBuilder")) {
    processAntTasks(processor, place, state);
    return;
  }

  if (!(place instanceof GrReferenceExpression) || ((GrReferenceExpression)place).isQualified()) {
    return;
  }

  GrClosableBlock closure = PsiTreeUtil.getContextOfType(place, GrClosableBlock.class, true);

  boolean antTasksProcessed = false;
  while (closure != null) {
    final PsiElement parent = closure.getParent();
    if (parent instanceof GrMethodCall) {
      final PsiMethod method = ((GrMethodCall)parent).resolveMethod();
      if (method instanceof AntBuilderMethod) {
        antTasksProcessed = true;
        if (!processAntTasks(processor, place, state)) {
          return;
        }
        if (!((AntBuilderMethod)method).processNestedElements(processor)) {
          return;
        }
        break;
      }
    }

    closure = PsiTreeUtil.getContextOfType(closure, GrClosableBlock.class, true);
  }

  // ------- gant-specific

  PsiFile file = place.getContainingFile();
  if (file == null || !GroovyScriptUtil.isSpecificScriptFile(file, GantScriptType.INSTANCE)) {
    return;
  }

  if (aClass instanceof GroovyScriptClass) {
    for (GrArgumentLabel label : GantUtils.getScriptTargets((GroovyFile)file)) {
      final String targetName = label.getName();
      if (targetName != null) {
        final PsiNamedElement variable = new LightVariableBuilder(targetName, GroovyCommonClassNames.GROOVY_LANG_CLOSURE, label).
          setBaseIcon(JetgroovyIcons.Groovy.Gant_target);
        if (!ResolveUtil.processElement(processor, variable, state)) {
          return;
        }
      }
    }
  }

  if (!antTasksProcessed) {
    processAntTasks(processor, place, state);
  }
}
项目:sqlitemagic    文件:SqliteMagicLightParameter.java   
public SqliteMagicLightParameter setModifiers(String... modifiers) {
  SqliteMagicLightModifierList modifierList = new SqliteMagicLightModifierList(getManager(), getLanguage(), modifiers);
  ReflectionUtil.setFinalFieldPerReflection(LightVariableBuilder.class, this, LightModifierList.class, modifierList);
  return this;
}
项目:tools-idea    文件:GantMemberContributor.java   
@Override
public void processDynamicElements(@NotNull PsiType qualifierType,
                                   PsiClass aClass,
                                   PsiScopeProcessor processor,
                                   PsiElement place,
                                   ResolveState state) {
  if (aClass != null && TypesUtil.getSuperClassesWithCache(aClass).containsKey("groovy.util.AntBuilder")) {
    processAntTasks(processor, place, state);
    return;
  }

  if (!(place instanceof GrReferenceExpression) || ((GrReferenceExpression)place).isQualified()) {
    return;
  }

  GrClosableBlock closure = PsiTreeUtil.getContextOfType(place, GrClosableBlock.class, true);

  boolean antTasksProcessed = false;
  while (closure != null) {
    final PsiElement parent = closure.getParent();
    if (parent instanceof GrMethodCall) {
      final PsiMethod method = ((GrMethodCall)parent).resolveMethod();
      if (method instanceof AntBuilderMethod) {
        antTasksProcessed = true;
        if (!processAntTasks(processor, place, state)) {
          return;
        }
        if (!((AntBuilderMethod)method).processNestedElements(processor)) {
          return;
        }
        break;
      }
    }

    closure = PsiTreeUtil.getContextOfType(closure, GrClosableBlock.class, true);
  }

  // ------- gant-specific

  PsiFile file = place.getContainingFile();
  if (file == null || !GroovyScriptTypeDetector.isSpecificScriptFile(file, GantScriptType.INSTANCE)) {
    return;
  }

  if (aClass instanceof GroovyScriptClass) {
    for (GrArgumentLabel label : GantUtils.getScriptTargets((GroovyFile)file)) {
      final String targetName = label.getName();
      if (targetName != null) {
        final PsiNamedElement variable = new LightVariableBuilder(targetName, GroovyCommonClassNames.GROOVY_LANG_CLOSURE, label).
          setBaseIcon(JetgroovyIcons.Groovy.Gant_target);
        if (!ResolveUtil.processElement(processor, variable, state)) {
          return;
        }
      }
    }
  }

  if (!antTasksProcessed) {
    processAntTasks(processor, place, state);
  }
}
项目:lombok-intellij-plugin    文件:LombokLightParameter.java   
public LombokLightParameter setModifiers(String... modifiers) {
  LombokLightModifierList modifierList = new LombokLightModifierList(getManager(), getLanguage(), modifiers);
  ReflectionUtil.setFinalFieldPerReflection(LightVariableBuilder.class, this, LightModifierList.class, modifierList);
  return this;
}