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 ) ); }
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)); }
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)); }
public ManLightParameterImpl setModifiers( String... modifiers ) { ManLightModifierListImpl modifierList = new ManLightModifierListImpl( getManager(), getLanguage(), modifiers ); ReflectionUtil.setFinalFieldPerReflection( LightVariableBuilder.class, this, LightModifierList.class, modifierList ); return this; }
@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); } }
public SqliteMagicLightParameter setModifiers(String... modifiers) { SqliteMagicLightModifierList modifierList = new SqliteMagicLightModifierList(getManager(), getLanguage(), modifiers); ReflectionUtil.setFinalFieldPerReflection(LightVariableBuilder.class, this, LightModifierList.class, modifierList); return this; }
@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); } }
public LombokLightParameter setModifiers(String... modifiers) { LombokLightModifierList modifierList = new LombokLightModifierList(getManager(), getLanguage(), modifiers); ReflectionUtil.setFinalFieldPerReflection(LightVariableBuilder.class, this, LightModifierList.class, modifierList); return this; }