Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
32,800
String () { return myOriginalInfo; }
getOriginInfo
32,801
void (String originalInfo) { myOriginalInfo = originalInfo; }
setOriginalInfo
32,802
String () { return mySource; }
getSource
32,803
PsiClass () { return myClass; }
getSourceClass
32,804
String () { return myOriginalInfo; }
getOriginInfo
32,805
void (String originalInfo) { myOriginalInfo = originalInfo; }
setOriginalInfo
32,806
PsiType (@NotNull GrFunctionalExpression expression, int index) { final PsiElement parent = expression.getParent(); if (parent instanceof GrNamedArgument) { final Pair<PsiMethod, PsiSubstitutor> pair = getOverriddenMethod((GrNamedArgument)parent); if (pair != null) { final PsiParameter[] parameters = pair.first.getParameterList().getParameters(); if (parameters.length > index) { return pair.second.substitute(parameters[index].getType()); } return null; } } return null; }
getClosureParameterType
32,807
PsiType[] (final Pair<PsiMethod, PsiSubstitutor> pair) { return ContainerUtil.map2Array(pair.first.getParameterList().getParameters(), PsiType.class, psiParameter -> pair.second.substitute(psiParameter.getType())); }
getParameterTypes
32,808
boolean (PsiMethod method) { return method.getModifierList().hasAnnotation("org.mbte.groovypp.runtime.HasDefaultImplementation"); }
hasTraitImplementation
32,809
List<TypeConstraint> (@NotNull GrExpression expression) { final PsiElement parent = expression.getParent(); if (parent instanceof GrListOrMap list) { if (!list.isMap()) { final PsiType listType = list.getType(); if (!(listType instanceof GrTupleType)) { return Collections.emptyList(); } return addExpectedConstructorParameters(list, expression); } } return Collections.emptyList(); }
calculateTypeConstraints
32,810
List<TypeConstraint> (GrListOrMap list, GrExpression arg) { GroovyConstructorReference reference = list.getConstructorReference(); if (reference == null) { return Collections.emptyList(); } GrExpression[] args = list.getInitializers(); List<TypeConstraint> result = new ArrayList<>(); for (GroovyResolveResult constructorResult : reference.resolve(false)) { final Map<GrExpression, Pair<PsiParameter, PsiType>> map = GrClosureSignatureUtil.mapArgumentsToParameters( constructorResult, list, false, true, GrNamedArgument.EMPTY_ARRAY, args, GrClosableBlock.EMPTY_ARRAY ); if (map == null) { continue; } final Pair<PsiParameter, PsiType> pair = map.get(arg); if (pair == null) { continue; } result.add(SubtypeConstraint.create(pair.second)); } return result; }
addExpectedConstructorParameters
32,811
boolean (PsiElement element) { return element instanceof PsiFile; }
isStopElement
32,812
boolean (@NotNull Project project, Editor editor, PsiFile file) { return findMatchingElement(file, editor) != null; }
isAvailable
32,813
boolean () { return true; }
startInWriteAction
32,814
String () { final Class<? extends Intention> aClass = getClass(); final String name = aClass.getSimpleName(); final StringBuilder buffer = new StringBuilder(name.length() + 10); buffer.append(Character.toLowerCase(name.charAt(0))); for (int i = 1; i < name.length(); i++) { final char c = name.charAt(i); if (Character.isUpperCase(c)) { buffer.append('.'); buffer.append(Character.toLowerCase(c)); } else { buffer.append(c); } } return buffer.toString(); }
getPrefix
32,815
String () { return GroovyIntentionsBundle.message(getPrefix() + ".family.name"); }
getFamilyName
32,816
ModCommand (@NotNull ActionContext context) { final PsiElement matchingElement = findMatchingElement(context); if (matchingElement == null) { return ModCommand.nop(); } return ModCommand.psiUpdate(matchingElement, (e, updater) -> processIntention(e, context, updater)); }
perform
32,817
boolean (PsiElement element) { return element instanceof PsiFile; }
isStopElement
32,818
String () { final Class<? extends GrPsiUpdateIntention> aClass = getClass(); final String name = aClass.getSimpleName(); final StringBuilder buffer = new StringBuilder(name.length() + 10); buffer.append(Character.toLowerCase(name.charAt(0))); for (int i = 1; i < name.length(); i++) { final char c = name.charAt(i); if (Character.isUpperCase(c)) { buffer.append('.'); buffer.append(Character.toLowerCase(c)); } else { buffer.append(c); } } return buffer.toString(); }
getPrefix
32,819
String () { return GroovyIntentionsBundle.message(getPrefix() + ".family.name"); }
getFamilyName
32,820
void (@NotNull PsiType qualifierType, @Nullable PsiClass clazz, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (clazz == null) return; String name = ResolveUtil.getNameHint(processor); if (name == null) return; if (!ResolveUtilKt.shouldProcessDynamicMethods(processor)) return; processDynamicMethods(qualifierType, clazz, name, place, e -> processor.execute(e, state)); }
processDynamicElements
32,821
String () { return "groovy.json.StreamingJsonBuilder"; }
getParentClassName
32,822
String () { return "groovy.json.StreamingJsonBuilder.StreamingJsonDelegate"; }
getDelegateClassName
32,823
GrLightMethodBuilder (@NotNull String name, @NotNull PsiElement place, @NotNull PsiType returnType, @NotNull PsiClass clazz) { GrLightMethodBuilder method = new GrLightMethodBuilder(place.getManager(), name); method.setModifiers(GrModifierFlags.PUBLIC_MASK); method.setReturnType(returnType); UtilsKt.setContainingClass(method, clazz); method.setOriginInfo(ORIGIN_INFO); return method; }
createMethod
32,824
void (GrLightMethodBuilder method) { GrLightParameter closureParam = method.addAndGetParameter("closure", GROOVY_LANG_CLOSURE); closureParam.putUserData(DELEGATES_TO_TYPE_KEY, getDelegateClassName()); closureParam.putUserData(DELEGATES_TO_STRATEGY_KEY, Closure.OWNER_FIRST); }
addClosureParameter
32,825
String () { return FQN; }
getParentClassName
32,826
GrLightMethodBuilder (@NotNull String name, @NotNull PsiClass clazz, @NotNull PsiElement context) { GrLightMethodBuilder method = new GrLightMethodBuilder(context.getManager(), name); method.setOriginInfo(ORIGIN_INFO); method.addModifier(PsiModifier.PUBLIC); method.setReturnType(JAVA_UTIL_MAP, context.getResolveScope()); UtilsKt.setContainingClass(method, clazz); return method; }
createMethod
32,827
String () { return getDelegateClassName(); }
getParentClassName
32,828
GrLightMethodBuilder (@NotNull String name, @NotNull PsiElement place, @NotNull PsiClass clazz) { GrLightMethodBuilder method = new GrLightMethodBuilder(place.getManager(), name); method.setModifiers(GrModifierFlags.PUBLIC_MASK); method.setReturnType(TypesUtil.getJavaLangObject(place)); UtilsKt.setContainingClass(method, clazz); method.setOriginInfo(StreamingJsonBuilderContributor.ORIGIN_INFO); return method; }
createMethod
32,829
String () { return DELEGATE_FQN; }
getParentClassName
32,830
GrLightMethodBuilder (@NotNull String name, @NotNull PsiClass clazz, @NotNull PsiElement context) { GrLightMethodBuilder method = new GrLightMethodBuilder(context.getManager(), name); method.setOriginInfo(JsonBuilderContributor.ORIGIN_INFO); method.addModifier(PsiModifier.PUBLIC); UtilsKt.setContainingClass(method, clazz); return method; }
createMethod
32,831
String () { return FQN; }
getParentClassName
32,832
GrLightMethodBuilder (@NotNull String name, @NotNull PsiClass clazz, @NotNull PsiElement place) { GrLightMethodBuilder res = new GrLightMethodBuilder(place.getManager(), name); res.setReturnType(JAVA_LANG_STRING, place.getResolveScope()); res.setOriginInfo(ORIGIN_INFO); UtilsKt.setContainingClass(res, clazz); return res; }
createMethod
32,833
GroovyApplicationSettings () { return this; }
getState
32,834
void (@NotNull GroovyApplicationSettings groovyApplicationSettings) { XmlSerializerUtil.copyBean(groovyApplicationSettings, this); }
loadState
32,835
GroovyApplicationSettings () { return ApplicationManager.getApplication().getService(GroovyApplicationSettings.class); }
getInstance
32,836
GroovyConfigUtils () { return ourGroovyConfigUtils; }
getInstance
32,837
boolean (@NotNull String name) { return GROOVY_ALL_JAR_PATTERN.matcher(name).matches() && !name.contains("src") && !name.contains("doc"); }
matchesGroovyAll
32,838
boolean (@NotNull PsiElement element) { return getInstance().isVersionAtLeast(element, GROOVY2_5); }
isAtLeastGroovy25
32,839
boolean (@NotNull PsiElement element) { return getInstance().isVersionAtLeast(element, GROOVY4_0); }
isAtLeastGroovy40
32,840
boolean (Library library) { if (library == null) return false; return LibrariesUtil.getGroovyLibraryHome(library.getFiles(OrderRootType.CLASSES)) != null; }
isSDKLibrary
32,841
String (@NotNull final Module module) { return GroovyConfigUtilsKt.getSdkVersion(module); }
getSDKVersion
32,842
boolean (PsiElement psiElement, String version) { return isVersionAtLeast(psiElement, version, true); }
isVersionAtLeast
32,843
boolean (PsiElement psiElement, String version, boolean unknownResult) { Module module = ModuleUtilCore.findModuleForPsiElement(psiElement); if (module == null) return unknownResult; final String sdkVersion = getSDKVersion(module); if (sdkVersion == null) return unknownResult; return compareSdkVersions(sdkVersion, version) >= 0; }
isVersionAtLeast
32,844
int (@NotNull String leftVersion, @NotNull String rightVersion) { String[] leftVersionParts = leftVersion.split("[.-]"); String[] rightVersionParts = rightVersion.split("[.-]"); int sizes = Math.max(leftVersionParts.length, rightVersionParts.length); for (int i = 0; i < sizes; ++i) { int leftNumber = getVersionPart(leftVersionParts, i); int rightNumber = getVersionPart(rightVersionParts, i); if (leftNumber < rightNumber) { return -1; } else if (leftNumber > rightNumber) { return 1; } } return 0; }
compareSdkVersions
32,845
boolean (@NotNull String version) { return version.contains(ALPHA) || version.contains(BETA) || version.contains(RC); }
isUnstable
32,846
int (String[] parts, int index) { String part = index < parts.length ? parts[index] : "-4"; return switch (part) { case SNAPSHOT -> 999; case ALPHA -> -3; case BETA -> -2; case RC -> -1; default -> { try { yield Integer.parseInt(part); } catch (NumberFormatException __) { yield -4; } } }; }
getVersionPart
32,847
String (PsiElement psiElement) { final Module module = ModuleUtilCore.findModuleForPsiElement(psiElement); if (module == null) { return NO_VERSION; } final String s = getSDKVersion(module); return s != null ? s : NO_VERSION; }
getSDKVersion
32,848
boolean (VirtualFile file) { if (file != null && file.isDirectory()) { final String path = file.getPath(); GroovyHomeKind kind = GroovyHomeKind.fromString(path); return kind != null; } return false; }
isSDKHome
32,849
Collection<String> (Library[] libraries) { return ContainerUtil.map(libraries, library -> getSDKVersion(LibrariesUtil.getGroovyLibraryHome(library))); }
getSDKVersions
32,850
String (@NlsSafe @NotNull String path) { String version = getSDKVersionOrNull(path); return version == null ? UNDEFINED_VERSION : version; }
getSDKVersion
32,851
String (String jarPath, final String jarRegex, String manifestPath) { return getSDKJarVersion(jarPath, Pattern.compile(jarRegex), manifestPath); }
getSDKJarVersion
32,852
String (String jarPath, final Pattern jarPattern, String manifestPath) { return getSDKJarVersion(jarPath, jarPattern, manifestPath, VERSION_GROUP_NAME); }
getSDKJarVersion
32,853
String (String jarPath, final Pattern jarPattern, String manifestPath, String versionGroupName) { try { File[] jars = LibrariesUtil.getFilesInDirectoryByPattern(jarPath, jarPattern); if (jars.length == 0) { return null; } if (jars.length > 1) { Arrays.sort(jars); } try (JarFile jarFile = new JarFile(jars[0])) { JarEntry jarEntry = jarFile.getJarEntry(manifestPath); if (jarEntry == null) { return null; } Manifest manifest; try (InputStream inputStream = jarFile.getInputStream(jarEntry)) { manifest = new Manifest(inputStream); } final String version = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION); if (version != null) { return version; } final Matcher matcher = jarPattern.matcher(jars[0].getName()); if (matcher.matches()) { try { return matcher.group(versionGroupName); } catch (IllegalArgumentException e) { LOG.error(e); } } return null; } } catch (Exception e) { LOG.debug(e); return null; } }
getSDKJarVersion
32,854
Library[] (Project project) { if (project == null || project.isDisposed()) return Library.EMPTY_ARRAY; final LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable(project); final List<Library> all = ContainerUtil.findAll(table.getLibraries(), LIB_SEARCH_CONDITION); return all.toArray(Library.EMPTY_ARRAY); }
getProjectSDKLibraries
32,855
Library[] (@Nullable Project project) { return ArrayUtil.mergeArrays(getGlobalSDKLibraries(), getProjectSDKLibraries(project)); }
getAllSDKLibraries
32,856
Library[] (Project project) { final List<Library> libraries = new ArrayList<>(); for (Module module : ModuleManager.getInstance(project).getModules()) { libraries.addAll(Arrays.asList(getSDKLibrariesByModule(module))); } return libraries.toArray(Library.EMPTY_ARRAY); }
getAllUsedSDKLibraries
32,857
Library[] () { return LibrariesUtil.getGlobalLibraries(LIB_SEARCH_CONDITION); }
getGlobalSDKLibraries
32,858
Library[] (final Module module) { return LibrariesUtil.getLibrariesByCondition(module, LIB_SEARCH_CONDITION); }
getSDKLibrariesByModule
32,859
boolean (PsiScopeProcessor processor, PsiElement place, ResolveState state) { JavaPsiFacade facade = JavaPsiFacade.getInstance(place.getProject()); PsiClass browserClass = facade.findClass("geb.Browser", place.getResolveScope()); if (browserClass != null) { if (!browserClass.processDeclarations(processor, state, null, place)) return false; PsiClass pageClass = facade.findClass("geb.Page", place.getResolveScope()); if (pageClass != null) { if (!pageClass.processDeclarations(processor, state, null, place)) return false; } } return true; }
contributeMembersInsideTest
32,860
PsiField (@NotNull PsiClass pageOrModuleClass, @NotNull PsiType objectType, String name, @NotNull GrExpression invokedExpression, @NotNull GrClosableBlock block) { GrLightField field = new GrLightField(pageOrModuleClass, name, objectType, invokedExpression) { @Override @NotNull public PsiType getType() { PsiType type = block.getReturnType(); return type != null ? type : super.getType(); } @Override public PsiType getDeclaredType() { return null; } }; field.getModifierList().addModifier(GrModifierFlags.STATIC_MASK); return field; }
extractFieldForContent
32,861
PsiType () { PsiType type = block.getReturnType(); return type != null ? type : super.getType(); }
getType
32,862
PsiType () { return null; }
getDeclaredType
32,863
PsiMethod (@NotNull PsiClass pageOrModuleClass, @NotNull String name, @NotNull GrExpression invokedExpression, @NotNull GrClosableBlock block) { GrLightMethodBuilder method = new GrLightMethodBuilder(pageOrModuleClass.getManager(), name) { @Override public PsiType getReturnType() { return block.getReturnType(); } }; method.setContainingClass(pageOrModuleClass); method.addModifier(GrModifierFlags.STATIC_MASK); method.setNavigationElement(invokedExpression); for (GrParameter parameter : block.getAllParameters()) { method.addParameter(parameter); } return method; }
extractMethodForContent
32,864
PsiType () { return block.getReturnType(); }
getReturnType
32,865
String () { return "geb.Browser"; }
getParentClassName
32,866
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (aClass == null) return; PsiClass pageClass = JavaPsiFacade.getInstance(aClass.getProject()).findClass("geb.Page", place.getResolveScope()); if (pageClass != null) { pageClass.processDeclarations(processor, state, null, place); } }
processDynamicElements
32,867
String () { return "geb.Module"; }
getParentClassName
32,868
String () { return "geb.Page"; }
getParentClassName
32,869
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (!ResolveUtilKt.shouldProcessMethods(processor) && !ResolveUtilKt.shouldProcessProperties(processor)) return; if (aClass == null) return; PsiElement grCall = place.getParent(); if (grCall instanceof GrMethodCall) { PsiElement grClosure = grCall.getParent(); if (grClosure instanceof GrClosableBlock) { PsiElement contentField = grClosure.getParent(); if (contentField instanceof GrField f) { if ("content".equals(f.getName()) && f.hasModifierProperty(PsiModifier.STATIC) && f.getContainingClass() == aClass) { Map<String, PsiMember> elements = GebUtil.getContentElements(aClass); for (PsiMember element : elements.values()) { if (element.getNavigationElement() == place) { return; // Don't resolve definition. } } } } } } processPageElements(processor, aClass, state.put(sorryCannotKnowElementKind, true)); }
processDynamicElements
32,870
boolean (PsiScopeProcessor processor, @NotNull PsiClass pageClass, ResolveState state) { Map<String, PsiClass> supers = ClassUtil.getSuperClassesWithCache(pageClass); String nameHint = ResolveUtil.getNameHint(processor); for (PsiClass psiClass : supers.values()) { Map<String, PsiMember> contentElements = GebUtil.getContentElements(psiClass); if (nameHint == null) { for (Map.Entry<String, PsiMember> entry : contentElements.entrySet()) { if (!processor.execute(entry.getValue(), state)) return false; } } else { PsiMember element = contentElements.get(nameHint); if (element != null) { return processor.execute(element, state); } } } return true; }
processPageElements
32,871
String () { return "geb.spock.GebSpec"; }
getParentClassName
32,872
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { GebUtil.contributeMembersInsideTest(processor, place, state); }
processDynamicElements
32,873
String () { return "geb.junit4.GebTest"; }
getParentClassName
32,874
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { GebUtil.contributeMembersInsideTest(processor, place, state); }
processDynamicElements
32,875
String () { return "geb.testng.GebTest"; }
getParentClassName
32,876
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { GebUtil.contributeMembersInsideTest(processor, place, state); }
processDynamicElements
32,877
void (@NotNull PsiElement element, int offsetInElement, @NotNull Consumer<? super PomTarget> consumer) { PsiElement grCall = element.getParent(); if (!(grCall instanceof GrMethodCall)) return; PsiElement grClosure = grCall.getParent(); if (!(grClosure instanceof GrClosableBlock)) return; PsiElement contentField = grClosure.getParent(); if (!(contentField instanceof GrField field)) return; if (!"content".equals(field.getName()) || !field.hasModifierProperty(PsiModifier.STATIC)) return; PsiClass containingClass = field.getContainingClass(); if (!InheritanceUtil.isInheritor(containingClass, "geb.Page") && !InheritanceUtil.isInheritor(containingClass, "geb.Module")) return; Map<String, PsiMember> contentElements = GebUtil.getContentElements(containingClass); for (PsiMember contentElement : contentElements.values()) { if (contentElement.getNavigationElement() == element && contentElement instanceof PomTarget) { consumer.consume((PomTarget)contentElement); return; } } }
findDeclarationsAt
32,878
void (@NotNull GrCall call, @NotNull GroovyResolveResult resolveResult, @Nullable String argumentName, boolean forCompletion, @NotNull Map<String, NamedArgumentDescriptor> result) { PsiElement resolve = resolveResult.getElement(); PsiType returnType = resolve == null ? null : ((PsiMethod)resolve).getReturnType(); PsiClass aClass = PsiTypesUtil.getPsiClass(returnType); if (aClass == null) return; Map<String, Pair<PsiType, PsiElement>> typeMap = null; if (!forCompletion) { typeMap = new HashMap<>(); } PsiManager manager = aClass.getManager(); for (PsiMethod method : aClass.getAllMethods()) { String methodName = method.getName(); String propertyName = GroovyPropertyUtils.getPropertyNameBySetterName(methodName); if (propertyName != null) { if (argumentName != null && !argumentName.equals(propertyName)) continue; PsiType methodReturnType = method.getReturnType(); if (methodReturnType != null && !PsiTypes.voidType().equals(methodReturnType)) continue; PsiParameter[] parameters = method.getParameterList().getParameters(); if (parameters.length != 1) continue; if (forCompletion) { // optimization, don't calculate types. result.put(propertyName, NamedArgumentDescriptor.SIMPLE_ON_TOP); } else { PsiType newType = parameters[0].getType(); Pair<PsiType, PsiElement> oldPair = typeMap.get(propertyName); if (oldPair == null) { typeMap.put(propertyName, new Pair<>(newType, method)); } else { typeMap.put(propertyName, new Pair<>(newType, null)); } } } else { PsiType closureType = null; if (methodName.startsWith("add")) { PsiParameter[] parameters = method.getParameterList().getParameters(); if (parameters.length != 1) continue; PsiClass paramClass = PsiTypesUtil.getPsiClass(parameters[0].getType()); if (paramClass == null || !InheritanceUtil.isInheritor(paramClass, "java.util.EventListener")) continue; for (PsiMethod psiMethod : paramClass.getMethods()) { if (!psiMethod.hasModifierProperty(PsiModifier.ABSTRACT)) continue; if (forCompletion) { result.put(psiMethod.getName(), NamedArgumentDescriptor.SIMPLE_ON_TOP); } else { if (closureType == null) { closureType = JavaPsiFacade.getElementFactory(manager.getProject()).createTypeByFQClassName(GroovyCommonClassNames.GROOVY_LANG_CLOSURE, call.getResolveScope()); } result.put(psiMethod.getName(), new TypeCondition(closureType, method)); } } } } } if (!forCompletion) { for (Map.Entry<String, Pair<PsiType, PsiElement>> entry : typeMap.entrySet()) { result.put(entry.getKey(), new TypeCondition(entry.getValue().first, entry.getValue().second)); } } }
getNamedArguments
32,879
PsiElement () { PsiElement res = super.getNavigationElement(); if (res != this || myNavigationClass == null) return res; PsiClass aClass = JavaPsiFacade.getInstance(getProject()).findClass(myNavigationClass, getResolveScope()); if (aClass == null) return res; PsiMethod[] methods = aClass.findMethodsByName("newInstance", false); if (methods.length != 1) return aClass; return methods[0]; }
getNavigationElement
32,880
void (String navigationClass) { myNavigationClass = navigationClass; }
setNavigationClass
32,881
PsiType (@NotNull String typeName) { PsiType res = myTypeMap.get(typeName); if (res == null) { res = myFactory.createTypeByFQClassName(typeName, myResolveScope); myTypeMap.put(typeName, res); } return res; }
type
32,882
void (@NotNull PsiMethod method) { myResult.putValue(method.getName(), method); }
add
32,883
MyMethodBuilder (String name, String returnType, @Nullable String navigationClass) { MyMethodBuilder res = new MyMethodBuilder(myManager, name); res.setModifiers(GrModifierFlags.PUBLIC_MASK); res.setReturnType(type(returnType)); res.setContainingClass(mySwingBuilderClass); if (navigationClass != null) { assert navigationClass.startsWith("groovy.swing."); // NON-NLS res.setNavigationClass(navigationClass); } return res; }
method
32,884
void (@NlsSafe String name, String returnType, @Nullable String navigationClass) { methodObject(name, returnType, navigationClass, null); }
methodObject
32,885
void (@NlsSafe String name, @NlsSafe String returnType, @Nullable String navigationClass, @Nullable Map<@NlsSafe String, NamedArgumentDescriptor> namedArg) { MyMethodBuilder method = method(name, returnType, navigationClass); method.addParameter("map", type(CommonClassNames.JAVA_UTIL_MAP), true); method.addParameter("params", MANY_OBJECTS); if (namedArg != null) { method.setNamedParameters(namedArg); } add(method); }
methodObject
32,886
void (String name, String realMethodName) { for (PsiMethod method : mySwingBuilderClass.findMethodsByName(realMethodName, false)) { add(GrMethodWrapper.wrap(method)); } }
registerExplicitMethod
32,887
void () { // registerSupportNodes() methodObject("action", "javax.swing.Action", "groovy.swing.factory.ActionFactory"); methodObject("actions", CommonClassNames.JAVA_UTIL_LIST, "groovy.swing.factory.CollectionFactory"); methodObject("map", CommonClassNames.JAVA_UTIL_MAP, "groovy.swing.factory.MapFactory"); methodObject("imageIcon", "javax.swing.ImageIcon", "groovy.swing.factory.ImageIconFactory", Map.of( "image", new TypeCondition(type("java.awt.Image")), "url", new TypeCondition(type("java.net.URL")), "file", NamedArgumentDescriptor.SIMPLE_ON_TOP, "resource", NamedArgumentDescriptor.SIMPLE_ON_TOP, "class", NamedArgumentDescriptor.SIMPLE_ON_TOP, "description", NamedArgumentDescriptor.TYPE_STRING)); methodObject("buttonGroup", "javax.swing.BoxLayout", "groovy.swing.factory.ButtonGroupFactory"); methodObject("noparent", CommonClassNames.JAVA_UTIL_LIST, "groovy.swing.factory.CollectionFactory"); registerExplicitMethod("keyStrokeAction", "createKeyStrokeAction"); //registerExplicitMethod("shortcut", "shortcut"); // registerBinding() methodObject("bind", "org.codehaus.groovy.binding.FullBinding", "groovy.swing.factory.BindFactory", Map.ofEntries( Map.entry("source", NamedArgumentDescriptor.SIMPLE_ON_TOP), Map.entry("target", NamedArgumentDescriptor.SIMPLE_ON_TOP), Map.entry("update", NamedArgumentDescriptor.SIMPLE_ON_TOP), Map.entry("targetProperty", NamedArgumentDescriptor.TYPE_STRING), Map.entry("mutual", NamedArgumentDescriptor.SIMPLE_ON_TOP), Map.entry("sourceEvent", NamedArgumentDescriptor.TYPE_STRING), Map.entry("sourceValue", NamedArgumentDescriptor.TYPE_CLOSURE), Map.entry("sourceProperty", NamedArgumentDescriptor.TYPE_STRING), Map.entry("value", NamedArgumentDescriptor.SIMPLE_ON_TOP), Map.entry("bind", NamedArgumentDescriptor.SIMPLE_ON_TOP), Map.entry("group", NamedArgumentDescriptor.SIMPLE_ON_TOP))); methodObject("bindProxy", "org.codehaus.groovy.binding.BindingProxy", "groovy.swing.factory.BindProxyFactory", ImmutableMap.of("bind", NamedArgumentDescriptor.SIMPLE_ON_TOP)); methodObject("bindGroup", "org.codehaus.groovy.binding.AggregateBinding", "groovy.swing.factory.BindGroupFactory", ImmutableMap.of("bind", NamedArgumentDescriptor.SIMPLE_ON_TOP)); // registerPassThruNodes() methodObject("widget", "java.awt.Component", "groovy.swing.factory.WidgetFactory", ImmutableMap .of("widget", new TypeCondition(type("java.awt.Component")))); methodObject("container", "java.awt.Component", "groovy.swing.factory.WidgetFactory", ImmutableMap .of("container", new TypeCondition(type("java.awt.Component")))); methodObject("bean", CommonClassNames.JAVA_LANG_OBJECT, "groovy.swing.factory.WidgetFactory", ImmutableMap.of("bean", NamedArgumentDescriptor.SIMPLE_ON_TOP)); // registerWindows() methodObject("dialog", "javax.swing.JDialog", "groovy.swing.factory.DialogFactory", Map.of("owner", NamedArgumentDescriptor.SIMPLE_ON_TOP, "defaultButtonProperty", NamedArgumentDescriptor.SIMPLE_ON_TOP, "pack", NamedArgumentDescriptor.SIMPLE_ON_TOP, "show", NamedArgumentDescriptor.SIMPLE_ON_TOP)); methodObject("fileChooser", "javax.swing.JFileChooser", null); methodObject("frame", "javax.swing.JFrame", "groovy.swing.factory.FrameFactory", Map .of("pack", NamedArgumentDescriptor.SIMPLE_ON_TOP, "show", NamedArgumentDescriptor.SIMPLE_ON_TOP)); methodObject("optionPane", "javax.swing.JOptionPane", null); methodObject("window", "javax.swing.JWindow", "groovy.swing.factory.WindowFactory", Map.of("pack", NamedArgumentDescriptor.SIMPLE_ON_TOP, "show", NamedArgumentDescriptor.SIMPLE_ON_TOP, "owner", NamedArgumentDescriptor.SIMPLE_ON_TOP)); // registerActionButtonWidgets() methodObject("button", "javax.swing.JButton", "groovy.swing.factory.RichActionWidgetFactory"); methodObject("checkBox", "javax.swing.JCheckBox", "groovy.swing.factory.RichActionWidgetFactory"); methodObject("checkBoxMenuItem", "javax.swing.JCheckBoxMenuItem", "groovy.swing.factory.RichActionWidgetFactory"); methodObject("menuItem", "javax.swing.JMenuItem", "groovy.swing.factory.RichActionWidgetFactory"); methodObject("radioButton", "javax.swing.JRadioButton", "groovy.swing.factory.RichActionWidgetFactory"); methodObject("radioButtonMenuItem", "javax.swing.JRadioButtonMenuItem", "groovy.swing.factory.RichActionWidgetFactory"); methodObject("toggleButton", "javax.swing.JToggleButton", "groovy.swing.factory.RichActionWidgetFactory"); // registerTextWidgets() methodObject("editorPane", "javax.swing.JEditorPane", "groovy.swing.factory.TextArgWidgetFactory"); methodObject("label", "javax.swing.JLabel", "groovy.swing.factory.TextArgWidgetFactory"); methodObject("passwordField", "javax.swing.JPasswordField", "groovy.swing.factory.TextArgWidgetFactory"); methodObject("textArea", "javax.swing.JTextArea", "groovy.swing.factory.TextArgWidgetFactory"); methodObject("textField", "javax.swing.JTextField", "groovy.swing.factory.TextArgWidgetFactory"); methodObject("textPane", "javax.swing.JTextPane", "groovy.swing.factory.TextArgWidgetFactory"); methodObject("formattedTextField", "javax.swing.JFormattedTextField", "groovy.swing.factory.FormattedTextFactory", ImmutableMap.of( "format", new TypeCondition(type("java.text.Format")), "value", NamedArgumentDescriptor.SIMPLE_ON_TOP)); // registerMDIWidgets() methodObject("desktopPane", "javax.swing.JDesktopPane", null); methodObject("internalFrame", "javax.swing.JInternalFrame", "groovy.swing.factory.InternalFrameFactory"); // registerBasicWidgets() methodObject("colorChooser", "javax.swing.JColorChooser", null); methodObject("comboBox", "javax.swing.JComboBox", "groovy.swing.factory.ComboBoxFactory", ImmutableMap.of("items", NamedArgumentDescriptor.SIMPLE_ON_TOP)); methodObject("list", "javax.swing.JList", "groovy.swing.factory.ListFactory", ImmutableMap.of("items", NamedArgumentDescriptor.SIMPLE_ON_TOP)); methodObject("progressBar", "javax.swing.JProgressBar", null); methodObject("separator", "javax.swing.JSeparator", "groovy.swing.factory.SeparatorFactory"); methodObject("scrollBar", "javax.swing.JScrollBar", null); methodObject("slider", "javax.swing.JSlider", null); methodObject("spinner", "javax.swing.JSpinner", null); methodObject("tree", "javax.swing.JTree", null); //registerMenuWidgets() methodObject("menu", "javax.swing.JMenu", null); methodObject("menuBar", "javax.swing.JMenuBar", null); methodObject("popupMenu", "javax.swing.JPopupMenu", null); // registerContainers() methodObject("panel", "javax.swing.JPanel", null); methodObject("scrollPane", "javax.swing.JScrollPane", "groovy.swing.factory.ScrollPaneFactory"); methodObject("splitPane", "javax.swing.JSplitPane", "groovy.swing.factory.SplitPaneFactory"); methodObject("tabbedPane", "javax.swing.JTabbedPane", "groovy.swing.factory.TabbedPaneFactory"); methodObject("toolBar", "javax.swing.JToolBar", null); methodObject("viewport", "javax.swing.JViewport", null); methodObject("layeredPane", "javax.swing.JLayeredPane", null); // registerDataModels() methodObject("boundedRangeModel", "javax.swing.DefaultBoundedRangeModel", null); methodObject("spinnerDateModel", "javax.swing.SpinnerDateModel", null); methodObject("spinnerListModel", "javax.swing.SpinnerListModel", null); methodObject("spinnerNumberModel", "javax.swing.SpinnerNumberModel", null); // registerTableComponents() methodObject("table", "javax.swing.JTable", "groovy.swing.factory.TableFactory"); methodObject("tableColumn", "javax.swing.table.TableColumn", null); methodObject("tableModel", "javax.swing.table.TableModel", "groovy.swing.factory.TableModelFactory", ImmutableMap.of( "tableModel", new TypeCondition(type("javax.swing.table.TableModel")), "model", new TypeCondition(type("groovy.model.ValueModel")), "list", NamedArgumentDescriptor.SIMPLE_ON_TOP )); methodObject("propertyColumn", "javax.swing.table.TableColumn", "groovy.swing.factory.PropertyColumnFactory", ImmutableMap.of( "propertyName", NamedArgumentDescriptor.TYPE_STRING, "header", NamedArgumentDescriptor.SIMPLE_ON_TOP, "type", new TypeCondition(type(CommonClassNames.JAVA_LANG_CLASS)), "editable", NamedArgumentDescriptor.SIMPLE_ON_TOP )); methodObject("closureColumn", "javax.swing.table.TableColumn", "groovy.swing.factory.ClosureColumnFactory", ImmutableMap.of( "header", NamedArgumentDescriptor.SIMPLE_ON_TOP, "read", new TypeCondition(type(GroovyCommonClassNames.GROOVY_LANG_CLOSURE)), "write", new TypeCondition(type(GroovyCommonClassNames.GROOVY_LANG_CLOSURE)), "type", new TypeCondition(type(CommonClassNames.JAVA_LANG_CLASS)) )); methodObject("columnModel", "javax.swing.table.TableColumnModel", "groovy.swing.factory.ColumnModelFactory"); methodObject("column", "javax.swing.table.TableColumn", "groovy.swing.factory.ColumnFactory", ImmutableMap.of("width", NamedArgumentDescriptor.SIMPLE_ON_TOP)); // registerBasicLayouts() methodObject("borderLayout", "java.awt.BorderLayout", "groovy.swing.factory.LayoutFactory"); methodObject("cardLayout", "java.awt.CardLayout", "groovy.swing.factory.LayoutFactory"); methodObject("flowLayout", "java.awt.FlowLayout", "groovy.swing.factory.LayoutFactory"); methodObject("gridLayout", "java.awt.GridLayout", "groovy.swing.factory.LayoutFactory"); methodObject("overlayLayout", "javax.swing.OverlayLayout", "groovy.swing.factory.LayoutFactory"); methodObject("springLayout", "javax.swing.SpringLayout", "groovy.swing.factory.LayoutFactory"); methodObject("gridBagLayout", "java.awt.GridBagLayout", "groovy.swing.factory.LayoutFactory"); methodObject("gridBagConstraints", "java.awt.GridBagConstraints", "groovy.swing.factory.LayoutFactory"); methodObject("gbc", "java.awt.GridBagConstraints", "groovy.swing.factory.LayoutFactory"); // registerBoxLayout() methodObject("boxLayout", "javax.swing.BoxLayout", "groovy.swing.factory.BoxLayoutFactory", ImmutableMap.of("axis", NamedArgumentDescriptor.SIMPLE_ON_TOP)); methodObject("box", "javax.swing.Box", "groovy.swing.factory.BoxFactory", ImmutableMap.of( "axis", new TypeCondition(type("java.lang.Number")))); methodObject("hbox", "javax.swing.Box", "groovy.swing.factory.HBoxFactory"); methodObject("hglue", "java.awt.Component", "groovy.swing.factory.HGlueFactory"); methodObject("hstrut", "java.awt.Component", "groovy.swing.factory.HStrutFactory", ImmutableMap.of( "width", new TypeCondition(type("java.lang.Number")))); methodObject("vbox", "javax.swing.Box", "groovy.swing.factory.VBoxFactory"); methodObject("vglue", "java.awt.Component", "groovy.swing.factory.VGlueFactory"); methodObject("vstrut", "java.awt.Component", "groovy.swing.factory.VStrutFactory", ImmutableMap.of( "height", new TypeCondition(type("java.lang.Number")))); methodObject("glue", "java.awt.Component", "groovy.swing.factory.GlueFactory"); methodObject("rigidArea", "java.awt.Component", "groovy.swing.factory.RigidAreaFactory", ImmutableMap.of( "size", new TypeCondition(type("java.awt.Dimension")), "height", new TypeCondition(type("java.lang.Number")), "width", new TypeCondition(type("java.lang.Number")) )); // registerTableLayout() methodObject("tableLayout", "groovy.swing.impl.TableLayout", "groovy.swing.factory.TableLayoutFactory"); methodObject("tr", "groovy.swing.impl.TableLayoutRow", "groovy.swing.factory.TRFactory"); methodObject("td", "groovy.swing.impl.TableLayoutCell", "groovy.swing.factory.TDFactory"); // registerBorders() methodObject("lineBorder", "javax.swing.border.LineBorder", "groovy.swing.factory.LineBorderFactory", ImmutableMap.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "color", NamedArgumentDescriptor.SIMPLE_ON_TOP, "thickness", NamedArgumentDescriptor.SIMPLE_ON_TOP, "roundedCorners", NamedArgumentDescriptor.SIMPLE_ON_TOP )); NamedArgumentDescriptor namedArgColor = new TypeCondition(type("java.awt.Color")); Map<@NlsSafe String, NamedArgumentDescriptor> m = Map.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "highlight", namedArgColor, "shadow", namedArgColor, "highlightOuter", namedArgColor, "highlightInner", namedArgColor, "shadowOuter", namedArgColor, "shadowInner", namedArgColor); methodObject("loweredBevelBorder", "javax.swing.border.Border", "groovy.swing.factory.BevelBorderFactory", m); methodObject("raisedBevelBorder", "javax.swing.border.Border", "groovy.swing.factory.BevelBorderFactory", m); m = Map.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "highlight", namedArgColor, "shadow", namedArgColor); methodObject("etchedBorder", "javax.swing.border.Border", "groovy.swing.factory.EtchedBorderFactory", m); methodObject("loweredEtchedBorder", "javax.swing.border.Border", "groovy.swing.factory.EtchedBorderFactory", m); methodObject("raisedEtchedBorder", "javax.swing.border.Border", "groovy.swing.factory.EtchedBorderFactory", m); methodObject("titledBorder", "javax.swing.border.TitledBorder", "groovy.swing.factory.TitledBorderFactory", Map.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "title", NamedArgumentDescriptor.SIMPLE_ON_TOP, "position", NamedArgumentDescriptor.SIMPLE_ON_TOP, "justification", NamedArgumentDescriptor.SIMPLE_ON_TOP, "border", new TypeCondition(type("javax.swing.border.Border")), "color", namedArgColor, "font", new TypeCondition(type("java.awt.Font")))); methodObject("emptyBorder", "javax.swing.border.Border", "groovy.swing.factory.EmptyBorderFactory"); methodObject("emptyBorder", "javax.swing.border.Border", "groovy.swing.factory.EmptyBorderFactory"); methodObject("emptyBorder", "javax.swing.border.Border", "groovy.swing.factory.EmptyBorderFactory", Map.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "top", NamedArgumentDescriptor.TYPE_INTEGER, "left", NamedArgumentDescriptor.TYPE_INTEGER, "bottom", NamedArgumentDescriptor.TYPE_INTEGER, "right", NamedArgumentDescriptor.TYPE_INTEGER )); methodObject("compoundBorder", "javax.swing.border.CompoundBorder", "groovy.swing.factory.CompoundBorderFactory", Map.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "inner", new TypeCondition(type("javax.swing.border.Border")), "outer", new TypeCondition(type("javax.swing.border.Border")) )); methodObject("matteBorder", "javax.swing.border.Border", "groovy.swing.factory.MatteBorderFactory", Map.of( "parent", NamedArgumentDescriptor.SIMPLE_ON_TOP, "icon", NamedArgumentDescriptor.SIMPLE_ON_TOP, "color", NamedArgumentDescriptor.SIMPLE_ON_TOP, "size", NamedArgumentDescriptor.SIMPLE_ON_TOP, "top", NamedArgumentDescriptor.SIMPLE_ON_TOP, "left", NamedArgumentDescriptor.SIMPLE_ON_TOP, "bottom", NamedArgumentDescriptor.SIMPLE_ON_TOP, "right", NamedArgumentDescriptor.SIMPLE_ON_TOP)); // registerRenderers() methodObject("tableCellRenderer", "groovy.swing.impl.ClosureRenderer", "groovy.swing.factory.RendererFactory"); methodObject("listCellRenderer", "groovy.swing.impl.ClosureRenderer", "groovy.swing.factory.RendererFactory"); methodObject("cellRenderer", "groovy.swing.impl.ClosureRenderer", "groovy.swing.factory.RendererFactory"); methodObject("headerRenderer", "groovy.swing.impl.ClosureRenderer", "groovy.swing.factory.RendererFactory"); methodObject("onRender", CommonClassNames.JAVA_UTIL_MAP, "groovy.swing.factory.RendererUpdateFactory"); // registerEditors() methodObject("cellEditor", "groovy.swing.impl.ClosureCellEditor", "groovy.swing.factory.CellEditorFactory"); methodObject("editorValue", CommonClassNames.JAVA_UTIL_MAP, "groovy.swing.factory.CellEditorGetValueFactory"); methodObject("prepareEditor", CommonClassNames.JAVA_UTIL_MAP, "groovy.swing.factory.CellEditorPrepareFactory"); }
generateMethods
32,888
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (aClass == null) return; if (!ResolveUtil.shouldProcessMethods(processor.getHint(ElementClassHint.KEY))) return; MultiMap<String, PsiMethod> methodMap = aClass.getUserData(KEY); if (methodMap == null) { MyBuilder builder = new MyBuilder(aClass); builder.generateMethods(); methodMap = ((UserDataHolderEx)aClass).putUserDataIfAbsent(KEY, builder.myResult); } String nameHint = ResolveUtil.getNameHint(processor); Collection<? extends PsiMethod> methods = nameHint == null ? methodMap.values() : methodMap.get(nameHint); for (PsiMethod method : methods) { if (!processor.execute(method, state)) return; } }
processDynamicElements
32,889
String () { return "groovy.swing.SwingBuilder"; }
getParentClassName
32,890
void (@NotNull GrCall call, @NotNull GroovyResolveResult resolveResult, @Nullable String argumentName, boolean forCompletion, @NotNull Map<String, NamedArgumentDescriptor> result) { GrArgumentList argumentList = call.getArgumentList(); if (argumentList == null) return; GrExpression[] expressionArguments = argumentList.getExpressionArguments(); if (expressionArguments.length > 1 || (expressionArguments.length == 1 && !(expressionArguments[0] instanceof GrReferenceExpression))) { return; } if (!PsiUtil.isTrustedMapConstructorResult(resolveResult)) return; for (PsiClass psiClass : getCorrespondingClasses(call, resolveResult)) { if (!isClassHasConstructorWithMap(psiClass)) continue; PsiClassType classType = JavaPsiFacade.getElementFactory(psiClass.getProject()).createType(psiClass); processClass(call, classType, argumentName, result); } }
getNamedArguments
32,891
void (@NotNull GrCall call, PsiClassType type, @Nullable String argumentName, final Map<String, NamedArgumentDescriptor> result) { if (argumentName == null) { final HashMap<String, Trinity<PsiType, PsiElement, PsiSubstitutor>> map = new HashMap<>(); MyPsiScopeProcessor processor = new MyPsiScopeProcessor() { @Override protected void addNamedArgument(String propertyName, PsiType type, PsiElement element, PsiSubstitutor substitutor) { if (result.containsKey(propertyName)) return; Trinity<PsiType, PsiElement, PsiSubstitutor> pair = map.get(propertyName); if (pair != null) { if (element instanceof PsiMethod && pair.second instanceof PsiField) { // methods should override fields } else { return; } } map.put(propertyName, Trinity.create(type, element, substitutor)); } }; processor.setResolveTargetKinds(ClassHint.RESOLVE_KINDS_METHOD_PROPERTY); ResolveUtil.processAllDeclarations(type, processor, ResolveState.initial(), call); for (Map.Entry<String, Trinity<PsiType, PsiElement, PsiSubstitutor>> entry : map.entrySet()) { result.put(entry.getKey(), new TypeCondition( entry.getValue().first, entry.getValue().getSecond(), entry.getValue().getThird(), NamedArgumentDescriptor.Priority.AS_LOCAL_VARIABLE )); } } else { MyPsiScopeProcessor processor = new MyPsiScopeProcessor() { @Override protected void addNamedArgument(String propertyName, PsiType type, PsiElement element, PsiSubstitutor substitutor) { if (result.containsKey(propertyName)) return; result.put(propertyName, new TypeCondition(type, element, substitutor, NamedArgumentDescriptor.Priority.AS_LOCAL_VARIABLE)); } }; processor.setResolveTargetKinds(ClassHint.RESOLVE_KINDS_METHOD); processor.setNameHint(GroovyPropertyUtils.getSetterName(argumentName)); ResolveUtil.processAllDeclarations(type, processor, ResolveState.initial(), call); processor.setResolveTargetKinds(ClassHint.RESOLVE_KINDS_PROPERTY); processor.setNameHint(argumentName); ResolveUtil.processAllDeclarations(type, processor, ResolveState.initial(), call); } }
processClass
32,892
void (String propertyName, PsiType type, PsiElement element, PsiSubstitutor substitutor) { if (result.containsKey(propertyName)) return; Trinity<PsiType, PsiElement, PsiSubstitutor> pair = map.get(propertyName); if (pair != null) { if (element instanceof PsiMethod && pair.second instanceof PsiField) { // methods should override fields } else { return; } } map.put(propertyName, Trinity.create(type, element, substitutor)); }
addNamedArgument
32,893
void (String propertyName, PsiType type, PsiElement element, PsiSubstitutor substitutor) { if (result.containsKey(propertyName)) return; result.put(propertyName, new TypeCondition(type, element, substitutor, NamedArgumentDescriptor.Priority.AS_LOCAL_VARIABLE)); }
addNamedArgument
32,894
boolean (PsiClass aClass) { PsiMethod[] constructors = aClass.getConstructors(); if (constructors.length == 0) return true; for (PsiMethod constructor : constructors) { PsiParameterList parameterList = constructor.getParameterList(); PsiParameter[] parameters = parameterList.getParameters(); if (parameters.length == 0) return true; final PsiParameter first = parameters[0]; if (InheritanceUtil.isInheritor(first.getType(), CommonClassNames.JAVA_UTIL_MAP)) return true; if (first instanceof GrParameter && ((GrParameter)first).getTypeGroovy() == null) return true; //if constructor has only optional parameters it can be used as default constructor with map args if (!PsiUtil.isConstructorHasRequiredParameters(constructor)) return true; } return false; }
isClassHasConstructorWithMap
32,895
boolean (@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof PsiMethod || element instanceof PsiField) { String propertyName; PsiType type; if (element instanceof PsiMethod method) { if (!myResolveTargetKinds.contains(DeclarationKind.METHOD)) return true; if (!GroovyPropertyUtils.isSimplePropertySetter(method)) return true; propertyName = GroovyPropertyUtils.getPropertyNameBySetter(method); if (propertyName == null) return true; type = method.getParameterList().getParameters()[0].getType(); } else { if (!myResolveTargetKinds.contains(DeclarationKind.FIELD)) return true; type = ((PsiField)element).getType(); propertyName = ((PsiField)element).getName(); } if (METACLASS.equals(propertyName)) return true; PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY); if (substitutor != null) { type = substitutor.substitute(type); } addNamedArgument(propertyName, type, element, substitutor); } return true; }
execute
32,896
boolean (@NotNull DeclarationKind kind) { return myResolveTargetKinds.contains(kind); }
shouldProcess
32,897
String (@NotNull ResolveState state) { return myNameHint; }
getName
32,898
void (String nameHint) { myNameHint = nameHint; }
setNameHint
32,899
void (EnumSet<DeclarationKind> resolveTargetKinds) { myResolveTargetKinds = resolveTargetKinds; }
setResolveTargetKinds