mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -49,7 +49,7 @@ def unpackJdks() {
|
||||
private void unpackJdk(File osDir, File jdkDir, String majorVersion) {
|
||||
def jdkFiles = osDir.listFiles().findAll { it.name.startsWith("jdk$majorVersion") }
|
||||
if (SystemInfo.isWindows) {
|
||||
def arch = "x64"
|
||||
def arch = System.getenv("ProgramFiles(x86)") != null ? "x64" : "x32"
|
||||
jdkFiles = jdkFiles.findAll { it.name.endsWith("_${arch}.zip") }
|
||||
}
|
||||
if (jdkFiles.empty) {
|
||||
|
||||
@@ -8,15 +8,12 @@
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../plugins/InspectionGadgets">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/InspectionGadgets/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/InspectionGadgets/testsrc" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../plugins/IntentionPowerPak">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/IntentionPowerPak/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/IntentionPowerPak/testSrc" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../plugins/generate-tostring">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/generate-tostring/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/generate-tostring/testSrc" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/generate-tostring/resources" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="module" module-name="boot" />
|
||||
@@ -40,7 +37,6 @@
|
||||
<orderEntry type="module" module-name="icons" />
|
||||
<orderEntry type="library" name="jcip" level="project" />
|
||||
<orderEntry type="library" name="Groovy" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
|
||||
<orderEntry type="module" module-name="java-psi-impl" exported="" />
|
||||
<orderEntry type="module" module-name="RegExpSupport" />
|
||||
<orderEntry type="module" module-name="java-indexing-impl" exported="" />
|
||||
@@ -52,7 +48,6 @@
|
||||
<orderEntry type="library" name="Guava" level="project" />
|
||||
<orderEntry type="library" name="Xerces" level="project" />
|
||||
<orderEntry type="library" name="Velocity" level="project" />
|
||||
<orderEntry type="module" module-name="testFramework-java" scope="TEST" />
|
||||
<orderEntry type="module" module-name="java-structure-view" exported="" />
|
||||
<orderEntry type="module" module-name="spellchecker" />
|
||||
<orderEntry type="library" name="nekohtml" level="project" />
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../plugins/InspectionGadgets/testsrc">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/InspectionGadgets/testsrc" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../plugins/IntentionPowerPak/testSrc">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/IntentionPowerPak/testSrc" isTestSource="true" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/../../plugins/generate-tostring/testSrc">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../plugins/generate-tostring/testSrc" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="testFramework-java" />
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<orderEntry type="module" module-name="testFramework" exported="" />
|
||||
<orderEntry type="module" module-name="relaxng" exported="" scope="TEST" />
|
||||
<orderEntry type="module" module-name="idea-ui" exported="" />
|
||||
<orderEntry type="module" module-name="external-system-impl" exported="" scope="TEST" />
|
||||
<orderEntry type="module" module-name="debugger-impl" exported="" />
|
||||
<orderEntry type="module" module-name="execution-openapi" exported="" />
|
||||
</component>
|
||||
@@ -30,5 +29,4 @@
|
||||
<setting name="state" value="1" />
|
||||
</Base>
|
||||
</component>
|
||||
</module>
|
||||
|
||||
</module>
|
||||
-2
@@ -29,7 +29,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GrInspectionUtil;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyInspectionBundle;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.GroovyLocalInspectionBase;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppTypeConverter;
|
||||
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GrControlFlowOwner;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement;
|
||||
@@ -100,7 +99,6 @@ public class UnassignedVariableAccessInspection extends GroovyLocalInspectionBas
|
||||
!(property instanceof PsiParameter) &&
|
||||
!(property instanceof PsiField) &&
|
||||
PsiTreeUtil.isAncestor(owner, property, false) &&
|
||||
!GppTypeConverter.hasTypedContext(element) &&
|
||||
!(myIgnoreBooleanExpressions && isBooleanCheck(element))
|
||||
) {
|
||||
problemsHolder.registerProblem(element, GroovyInspectionBundle.message("unassigned.access.tooltip", name));
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ public class ConstructorReferencesSearcher extends QueryExecutorBase<PsiReferenc
|
||||
if (element instanceof PsiMethod) {
|
||||
final PsiMethod method = (PsiMethod)element;
|
||||
if (method.isConstructor()) {
|
||||
GroovyConstructorUsagesSearcher.processConstructorUsages(method, queryParameters.getEffectiveSearchScope(), consumer, queryParameters.getOptimizer(), true, false);
|
||||
GroovyConstructorUsagesSearcher.processConstructorUsages(method, queryParameters.getEffectiveSearchScope(), consumer, queryParameters.getOptimizer(),
|
||||
false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-162
@@ -18,40 +18,32 @@ package org.jetbrains.plugins.groovy.findUsages;
|
||||
|
||||
import com.intellij.openapi.application.QueryExecutorBase;
|
||||
import com.intellij.openapi.application.ReadActionProcessor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.light.LightMemberReference;
|
||||
import com.intellij.psi.search.*;
|
||||
import com.intellij.psi.search.searches.AnnotatedElementsSearch;
|
||||
import com.intellij.psi.search.SearchRequestCollector;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.psi.search.searches.DirectClassInheritorsSearch;
|
||||
import com.intellij.psi.search.searches.MethodReferencesSearch;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.PairProcessor;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.utils.ControlFlowUtils;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppTypeConverter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GrReferenceElement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrConstructorInvocation;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariableDeclaration;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.*;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrNewExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrSafeCastExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrTypeCastExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrAnonymousClassDefinition;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
|
||||
@@ -61,8 +53,6 @@ import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.controlFlow.Instruction;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -75,11 +65,15 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase<PsiRefere
|
||||
|
||||
@Override
|
||||
public void processQuery(@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor<PsiReference> consumer) {
|
||||
processConstructorUsages(p.getMethod(), p.getEffectiveSearchScope(), consumer, p.getOptimizer(), true, !p.isStrictSignatureSearch());
|
||||
processConstructorUsages(p.getMethod(), p.getEffectiveSearchScope(), consumer, p.getOptimizer(), !p.isStrictSignatureSearch());
|
||||
}
|
||||
|
||||
public static final Key<Set<PsiClass>> LITERALLY_CONSTRUCTED_CLASSES = Key.create("LITERALLY_CONSTRUCTED_CLASSES");
|
||||
static void processConstructorUsages(final PsiMethod constructor, final SearchScope searchScope, final Processor<PsiReference> consumer, final SearchRequestCollector collector, final boolean searchGppCalls, final boolean includeOverloads) {
|
||||
static void processConstructorUsages(final PsiMethod constructor,
|
||||
final SearchScope searchScope,
|
||||
final Processor<PsiReference> consumer,
|
||||
final SearchRequestCollector collector,
|
||||
final boolean includeOverloads) {
|
||||
if (!constructor.isConstructor()) return;
|
||||
|
||||
final PsiClass clazz = constructor.getContainingClass();
|
||||
@@ -116,7 +110,7 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase<PsiRefere
|
||||
}
|
||||
};
|
||||
|
||||
processGroovyClassUsages(clazz, searchScope, collector, searchGppCalls, newExpressionProcessor, literalProcessor);
|
||||
processGroovyClassUsages(clazz, searchScope, collector, newExpressionProcessor, literalProcessor);
|
||||
|
||||
//this()
|
||||
if (clazz instanceof GrTypeDefinition) {
|
||||
@@ -139,135 +133,25 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase<PsiRefere
|
||||
public static void processGroovyClassUsages(final PsiClass clazz,
|
||||
final SearchScope scope,
|
||||
SearchRequestCollector collector,
|
||||
final boolean searchGppCalls,
|
||||
final Processor<GrNewExpression> newExpressionProcessor,
|
||||
final LiteralConstructorSearcher literalProcessor) {
|
||||
final Set<PsiAnchor> processedMethods = ContainerUtil.newConcurrentSet();
|
||||
|
||||
ReferencesSearch.searchOptimized(clazz, scope, false, collector, true, new PairProcessor<PsiReference, SearchRequestCollector>() {
|
||||
@Override
|
||||
public boolean process(PsiReference ref, SearchRequestCollector collector) {
|
||||
final PsiElement element = ref.getElement();
|
||||
|
||||
if (element instanceof GrCodeReferenceElement) {
|
||||
if (!processGroovyConstructorUsages((GrCodeReferenceElement)element, !searchGppCalls, newExpressionProcessor, literalProcessor)) {
|
||||
if (!processGroovyConstructorUsages((GrCodeReferenceElement)element, newExpressionProcessor, literalProcessor)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchGppCalls) {
|
||||
final PsiMethod method = getMethodToSearchForCallsWithLiteralArguments(element, clazz);
|
||||
if (method != null && processedMethods.add(PsiAnchor.create(method))) {
|
||||
processGppMethodCalls(clazz, scope, collector, method, literalProcessor);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PsiMethod getMethodToSearchForCallsWithLiteralArguments(PsiElement element, PsiClass targetClass) {
|
||||
final PsiParameter parameter = PsiTreeUtil.getParentOfType(element, PsiParameter.class);
|
||||
if (parameter != null) {
|
||||
final PsiMethod method = PsiTreeUtil.getParentOfType(parameter, PsiMethod.class);
|
||||
if (method != null) {
|
||||
final PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
final int idx = Arrays.asList(parameters).indexOf(parameter);
|
||||
if (idx >= 0) {
|
||||
PsiType parameterType = parameter.getType();
|
||||
if (parameterType instanceof PsiArrayType && idx == parameters.length - 1) {
|
||||
parameterType = ((PsiArrayType)parameterType).getComponentType();
|
||||
}
|
||||
if (parameterType instanceof PsiClassType) {
|
||||
if (method.getManager().areElementsEquivalent(targetClass, ((PsiClassType)parameterType).resolve())) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void processGppMethodCalls(final PsiClass targetClass,
|
||||
SearchScope scope,
|
||||
SearchRequestCollector originalCollector, @NotNull PsiMethod currentTarget,
|
||||
final LiteralConstructorSearcher literalProcessor) {
|
||||
final SearchScope gppScope = getGppScope(targetClass.getProject()).intersectWith(scope);
|
||||
|
||||
if (gppScope instanceof GlobalSearchScope) {
|
||||
String name = currentTarget.getName();
|
||||
if (PsiSearchHelper.SERVICE.getInstance(currentTarget.getProject()).isCheapEnoughToSearch(name, (GlobalSearchScope)gppScope, null,
|
||||
null) ==
|
||||
PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final ReadActionProcessor<PsiReference> gppCallProcessor = new ReadActionProcessor<PsiReference>() {
|
||||
|
||||
@Nullable
|
||||
private GrExpression[] getCallArguments(PsiReference psiReference) {
|
||||
if (psiReference instanceof GrReferenceElement) {
|
||||
final PsiElement parent = ((GrReferenceElement)psiReference).getParent();
|
||||
if (parent instanceof GrCall) {
|
||||
final GrArgumentList argList = ((GrCall)parent).getArgumentList();
|
||||
if (argList != null) {
|
||||
return argList.getExpressionArguments();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (psiReference instanceof LiteralConstructorReference) {
|
||||
return ((LiteralConstructorReference)psiReference).getCallArguments();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processInReadAction(PsiReference psiReference) {
|
||||
final GrExpression[] arguments = getCallArguments(psiReference);
|
||||
if (arguments == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean checkedTypedContext = false;
|
||||
for (GrExpression argument : arguments) {
|
||||
if (argument instanceof GrListOrMap) {
|
||||
if (!checkedTypedContext) {
|
||||
if (!GppTypeConverter.hasTypedContext(psiReference.getElement())) {
|
||||
return true;
|
||||
}
|
||||
checkedTypedContext = true;
|
||||
}
|
||||
|
||||
if (!literalProcessor.processLiteral((GrListOrMap)argument, true)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
if (currentTarget.isConstructor()) {
|
||||
processConstructorUsages(currentTarget, gppScope, gppCallProcessor, originalCollector, true, false);
|
||||
}
|
||||
else {
|
||||
MethodReferencesSearch.searchOptimized(currentTarget, gppScope, true, originalCollector, gppCallProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
private static GlobalSearchScope getGppScope(final Project project) {
|
||||
return CachedValuesManager.getManager(project).getCachedValue(project, new CachedValueProvider<GlobalSearchScope>() {
|
||||
@Override
|
||||
public Result<GlobalSearchScope> compute() {
|
||||
return Result.create(calcGppScope(project), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT, ProjectRootManager.getInstance(project));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean processGroovyConstructorUsages(GrCodeReferenceElement element,
|
||||
boolean usualCallsOnly,
|
||||
final Processor<GrNewExpression> newExpressionProcessor,
|
||||
final LiteralConstructorSearcher literalProcessor) {
|
||||
PsiElement parent = element.getParent();
|
||||
@@ -279,10 +163,6 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase<PsiRefere
|
||||
return newExpressionProcessor.process((GrNewExpression)parent);
|
||||
}
|
||||
|
||||
if (usualCallsOnly) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parent instanceof GrTypeElement) {
|
||||
final GrTypeElement typeElement = (GrTypeElement)parent;
|
||||
|
||||
@@ -328,38 +208,11 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase<PsiRefere
|
||||
return true;
|
||||
}
|
||||
|
||||
private static GlobalSearchScope calcGppScope(Project project) {
|
||||
final GlobalSearchScope allScope = GlobalSearchScope.allScope(project);
|
||||
final GlobalSearchScope maximal = GlobalSearchScope.getScopeRestrictedByFileTypes(allScope, GroovyFileType.GROOVY_FILE_TYPE);
|
||||
GlobalSearchScope gppExtensions = new DelegatingGlobalSearchScope(maximal, "groovy.gpp") {
|
||||
@Override
|
||||
public boolean contains(@NotNull VirtualFile file) {
|
||||
return super.contains(file) && GppTypeConverter.isGppExtension(file.getExtension());
|
||||
}
|
||||
};
|
||||
final PsiClass typed = JavaPsiFacade.getInstance(project).findClass(GppTypeConverter.GROOVY_LANG_TYPED, allScope);
|
||||
if (typed != null) {
|
||||
final Set<VirtualFile> files = new HashSet<VirtualFile>();
|
||||
AnnotatedElementsSearch.searchElements(typed, maximal, PsiModifierListOwner.class).forEach(new Processor<PsiModifierListOwner>() {
|
||||
@Override
|
||||
public boolean process(PsiModifierListOwner occurrence) {
|
||||
ContainerUtil.addIfNotNull(occurrence.getContainingFile().getVirtualFile(), files);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
GlobalSearchScope withTypedAnno = GlobalSearchScope.filesScope(project, files);
|
||||
return withTypedAnno.union(gppExtensions);
|
||||
}
|
||||
|
||||
return gppExtensions;
|
||||
}
|
||||
|
||||
private static boolean checkLiteralInstantiation(GrExpression expression,
|
||||
final LiteralConstructorSearcher literalProcessor) {
|
||||
|
||||
if (expression instanceof GrListOrMap) {
|
||||
return literalProcessor.processLiteral((GrListOrMap)expression, GppTypeConverter.hasTypedContext(expression));
|
||||
return literalProcessor.processLiteral((GrListOrMap)expression);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
-8
@@ -24,12 +24,10 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.codeInspection.utils.ControlFlowUtils;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppTypeConverter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GrControlFlowOwner;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.GroovyResolveResult;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrNamedArgument;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
|
||||
@@ -116,12 +114,6 @@ public class LiteralConstructorReference extends PsiReferenceBase.Poly<GrListOrM
|
||||
else if (parent instanceof GrVariable) {
|
||||
type = ((GrVariable)parent).getDeclaredType();
|
||||
}
|
||||
else if (parent instanceof GrArgumentList && GppTypeConverter.hasTypedContext(parent)) {
|
||||
for (PsiType expected : GroovyExpectedTypesProvider.getDefaultExpectedTypes(expression)) {
|
||||
expected = filterOutTrashTypes(expected);
|
||||
if (expected != null) return (PsiClassType)expected;
|
||||
}
|
||||
}
|
||||
else if (parent instanceof GrNamedArgument) { //possible default constructor named arg
|
||||
for (PsiType expected : GroovyExpectedTypesProvider.getDefaultExpectedTypes(expression)) {
|
||||
expected = filterOutTrashTypes(expected);
|
||||
|
||||
+1
-10
@@ -21,7 +21,6 @@ import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.PsiReference;
|
||||
import com.intellij.util.Processor;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
@@ -37,20 +36,12 @@ public class LiteralConstructorSearcher {
|
||||
myIncludeOverloads = includeOverloads;
|
||||
}
|
||||
|
||||
public boolean processLiteral(GrListOrMap literal, boolean typedContext) {
|
||||
public boolean processLiteral(GrListOrMap literal) {
|
||||
final PsiReference reference = literal.getReference();
|
||||
if (reference instanceof LiteralConstructorReference) {
|
||||
if (isCorrectReference((LiteralConstructorReference)reference) && !myConsumer.process(reference)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typedContext) {
|
||||
for (GrExpression expression : ((LiteralConstructorReference)reference).getCallArguments()) {
|
||||
if (expression instanceof GrListOrMap && !processLiteral((GrListOrMap)expression, false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
-7
@@ -56,13 +56,6 @@ public class GppExpectedTypesContributor extends GroovyExpectedTypesContributor
|
||||
return addExpectedConstructorParameters(list, list.getInitializers(), expression);
|
||||
}
|
||||
}
|
||||
if (parent instanceof GrNamedArgument) {
|
||||
final PsiElement map = parent.getParent();
|
||||
if (map instanceof GrListOrMap && "super".equals(((GrNamedArgument)parent).getLabelName())) {
|
||||
//todo expected property types
|
||||
return addExpectedConstructorParameters((GrListOrMap)map, new GrExpression[]{expression}, expression);
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.gpp;
|
||||
|
||||
import com.intellij.codeInsight.daemon.ImplicitUsageProvider;
|
||||
import com.intellij.psi.*;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class GppImplicitUsageProvider implements ImplicitUsageProvider {
|
||||
|
||||
private static boolean isGppMetaMethod(PsiMethod method) {
|
||||
PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
if (parameters.length == 0 || !parameters[0].getType().equalsToText(CommonClassNames.JAVA_LANG_STRING)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ("invokeUnresolvedMethod".equals(method.getName())) {
|
||||
return true;
|
||||
}
|
||||
if ("getUnresolvedProperty".equals(method.getName())) {
|
||||
return parameters.length == 1;
|
||||
}
|
||||
if ("setUnresolvedProperty".equals(method.getName())) {
|
||||
return parameters.length == 2;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImplicitUsage(PsiElement element) {
|
||||
return element instanceof PsiMethod && isGppMetaMethod((PsiMethod)element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImplicitRead(PsiElement element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImplicitWrite(PsiElement element) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
-7
@@ -80,13 +80,6 @@ public class GppReferenceContributor extends PsiReferenceContributor {
|
||||
final List<ResolveResult> applicable = addMethodCandidates(classType, value);
|
||||
|
||||
final String memberName = getValue();
|
||||
if ("super".equals(memberName) && GppTypeConverter.hasTypedContext(myElement)) {
|
||||
final LiteralConstructorReference reference = (LiteralConstructorReference)map.getReference();
|
||||
if (reference != null && reference.getConstructedClassType() != null) {
|
||||
return reference.multiResolve(incompleteCode);
|
||||
}
|
||||
}
|
||||
|
||||
if (value == null || applicable.isEmpty()) {
|
||||
final PsiMethod setter = PropertyUtil.findPropertySetter(psiClass, memberName, false, true);
|
||||
if (setter != null) {
|
||||
|
||||
+2
-50
@@ -15,18 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.gpp;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiType;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.dsl.toplevel.AnnotatedContextFilter;
|
||||
import org.jetbrains.plugins.groovy.findUsages.LiteralConstructorReference;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.signatures.GrSignature;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.GrClosureType;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.GrMapType;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.GrTupleType;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.signatures.GrClosureSignatureUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
|
||||
@@ -37,28 +34,6 @@ import org.jetbrains.plugins.groovy.lang.psi.typeEnhancers.GrTypeConverter;
|
||||
*/
|
||||
public class GppTypeConverter extends GrTypeConverter {
|
||||
|
||||
public static final String GROOVY_LANG_TYPED = "groovy.lang.Typed";
|
||||
|
||||
public static boolean hasTypedContext(@Nullable PsiElement context) {
|
||||
if (context == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (AnnotatedContextFilter.findContextAnnotation(context, GROOVY_LANG_TYPED) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isGppExtension(StringUtil.getShortName(context.getContainingFile().getName()))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isGppExtension(String extension) {
|
||||
return "gpp".equals(extension) || "grunit".equals(extension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAllowedInMethodCall() {
|
||||
return true;
|
||||
@@ -84,29 +59,6 @@ public class GppTypeConverter extends GrTypeConverter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lType instanceof PsiClassType && hasTypedContext(context)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (rType instanceof GrMapType) {
|
||||
final PsiType lKeyType = PsiUtil.substituteTypeParameter(lType, CommonClassNames.JAVA_UTIL_MAP, 0, false);
|
||||
final PsiType lValueType = PsiUtil.substituteTypeParameter(lType, CommonClassNames.JAVA_UTIL_MAP, 1, false);
|
||||
final PsiType[] parameters = ((GrMapType)rType).getParameters();
|
||||
if (parameters.length == 2 && lKeyType != null && lValueType != null &&
|
||||
parameters[0] != null && parameters[1] != null &&
|
||||
(!TypesUtil.isAssignable(lKeyType, parameters[0], context) ||
|
||||
!TypesUtil.isAssignable(lValueType, parameters[1], context))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (hasTypedContext(context)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (rType instanceof GrClosureType && hasTypedContext(context)) {
|
||||
final PsiType[] methodParameters = GppClosureParameterTypeProvider.findSingleAbstractMethodSignature(lType);
|
||||
if (isClosureOverride(methodParameters, (GrClosureType)rType, context)) return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
-2
@@ -77,7 +77,6 @@ import org.jetbrains.plugins.groovy.findUsages.*;
|
||||
import org.jetbrains.plugins.groovy.geb.*;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppClosureParameterTypeProvider;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppExpectedTypesContributor;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppImplicitUsageProvider;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppTypeConverter;
|
||||
import org.jetbrains.plugins.groovy.lang.folding.GroovyFoldingBuilder;
|
||||
import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes;
|
||||
@@ -238,7 +237,6 @@ public class GroovyCoreEnvironment {
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), ImplicitUsageProvider.EP_NAME,
|
||||
ImplicitUsageProvider.class);
|
||||
appEnvironment.addExtension(ImplicitUsageProvider.EP_NAME, new GppImplicitUsageProvider());
|
||||
appEnvironment.addExtension(ImplicitUsageProvider.EP_NAME, new GrImplicitUsageProvider());
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), FileTypeRegistry.FileTypeDetector.EP_NAME,
|
||||
|
||||
+6
-12
@@ -39,7 +39,6 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.extensions.NamedArgumentDescriptor;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppTypeConverter;
|
||||
import org.jetbrains.plugins.groovy.lang.groovydoc.psi.api.GrDocComment;
|
||||
import org.jetbrains.plugins.groovy.lang.groovydoc.psi.impl.GrDocCommentUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.lexer.TokenSets;
|
||||
@@ -225,17 +224,12 @@ public abstract class GrMethodBaseImpl extends GrStubElementBase<GrMethodStub> i
|
||||
}
|
||||
}
|
||||
|
||||
if (!GppTypeConverter.hasTypedContext(method)) {
|
||||
LOG.assertTrue(method.isValid(), "invalid method");
|
||||
|
||||
final GrOpenBlock block = method.getBlock();
|
||||
if (block != null) {
|
||||
LOG.assertTrue(block.isValid(), "invalid code block");
|
||||
PsiType inferred = GroovyPsiManager.inferType(method, new MethodTypeInferencer(block));
|
||||
if (inferred != null) {
|
||||
if (nominal == null || nominal.isAssignableFrom(inferred)) {
|
||||
return inferred;
|
||||
}
|
||||
final GrOpenBlock block = method.getBlock();
|
||||
if (block != null) {
|
||||
PsiType inferred = GroovyPsiManager.inferType(method, new MethodTypeInferencer(block));
|
||||
if (inferred != null) {
|
||||
if (nominal == null || nominal.isAssignableFrom(inferred)) {
|
||||
return inferred;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-11
@@ -15,12 +15,9 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.lang.resolve.ast;
|
||||
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.impl.light.LightMethodBuilder;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.gpp.GppTypeConverter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.PsiImplUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.util.GroovyCommonClassNames;
|
||||
@@ -54,13 +51,6 @@ public class AutoExternalizeContributor extends AstTransformContributor {
|
||||
}
|
||||
|
||||
private static boolean hasGeneratedImplementations(GrTypeDefinition clazz) {
|
||||
if (PsiImplUtil.getAnnotation(clazz, GroovyCommonClassNames.GROOVY_TRANSFORM_AUTO_EXTERNALIZE) != null) {
|
||||
return true;
|
||||
}
|
||||
if (GppTypeConverter.hasTypedContext(clazz)) {
|
||||
return InheritanceUtil.isInheritor(clazz, CommonClassNames.JAVA_IO_EXTERNALIZABLE) &&
|
||||
clazz.findCodeMethodsByName("readExternal", false).length == 0;
|
||||
}
|
||||
return false;
|
||||
return PsiImplUtil.getAnnotation(clazz, GroovyCommonClassNames.GROOVY_TRANSFORM_AUTO_EXTERNALIZE) != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,5 +38,6 @@
|
||||
<orderEntry type="module" module-name="groovy-psi" exported="" />
|
||||
<orderEntry type="module" module-name="external-system-api" />
|
||||
<orderEntry type="module" module-name="RegExpSupport" />
|
||||
<orderEntry type="module" module-name="external-system-impl" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
+2
-3
@@ -72,7 +72,6 @@ public class GroovyBuilder extends ModuleLevelBuilder {
|
||||
private static final Key<Map<ModuleChunk, GroovycContinuation>> CONTINUATIONS = Key.create("CONTINUATIONS");
|
||||
private static final Key<Boolean> FILES_MARKED_DIRTY_FOR_NEXT_ROUND = Key.create("SRC_MARKED_DIRTY");
|
||||
private static final String GROOVY_EXTENSION = "groovy";
|
||||
private static final String GPP_EXTENSION = "gpp";
|
||||
private final boolean myForStubs;
|
||||
private final String myBuilderName;
|
||||
|
||||
@@ -508,12 +507,12 @@ public class GroovyBuilder extends ModuleLevelBuilder {
|
||||
}
|
||||
|
||||
public static boolean isGroovyFile(String path) {
|
||||
return path.endsWith("." + GROOVY_EXTENSION) || path.endsWith("." + GPP_EXTENSION);
|
||||
return path.endsWith("." + GROOVY_EXTENSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getCompilableFileExtensions() {
|
||||
return Arrays.asList(GROOVY_EXTENSION, GPP_EXTENSION);
|
||||
return Collections.singletonList(GROOVY_EXTENSION);
|
||||
}
|
||||
|
||||
private static Map<String, String> buildClassToSourceMap(ModuleChunk chunk, CompileContext context, Set<String> toCompilePaths, Map<ModuleBuildTarget, String> finalOutputs) throws IOException {
|
||||
|
||||
@@ -283,7 +283,6 @@
|
||||
displayName="Gant"/>
|
||||
|
||||
<library.presentationProvider implementation="org.jetbrains.plugins.groovy.config.GroovyLibraryPresentationProvider"/>
|
||||
<library.presentationProvider implementation="org.jetbrains.plugins.groovy.gpp.GppLibraryPresentationProvider" order="first"/>
|
||||
<library.presentationProvider implementation="org.jetbrains.plugins.groovy.gant.GantLibraryPresentationProvider" order="last"/>
|
||||
|
||||
<projectService serviceInterface="org.jetbrains.plugins.groovy.gant.GantSettings"
|
||||
@@ -1106,7 +1105,6 @@
|
||||
level="WARNING"
|
||||
implementationClass="org.jetbrains.plugins.groovy.codeInspection.bugs.GrEqualsBetweenInconvertibleTypesInspection"/>
|
||||
|
||||
<implicitUsageProvider implementation="org.jetbrains.plugins.groovy.gpp.GppImplicitUsageProvider"/>
|
||||
<implicitUsageProvider implementation="org.jetbrains.plugins.groovy.findUsages.GrImplicitUsageProvider"/>
|
||||
|
||||
<scratch.rootType implementation="org.jetbrains.plugins.groovy.console.GroovyConsoleRootType"/>
|
||||
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.gpp;
|
||||
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.libraries.LibraryKind;
|
||||
import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import icons.JetgroovyIcons;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.config.GroovyLibraryPresentationProviderBase;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class GppLibraryPresentationProvider extends GroovyLibraryPresentationProviderBase {
|
||||
private static final LibraryKind GPP_KIND = LibraryKind.create("gpp");
|
||||
private static final Pattern GROOVYPP_JAR = Pattern.compile("groovypp-([\\d\\.]+)\\.jar");
|
||||
private static final Pattern GROOVYPP_ALL_JAR = Pattern.compile("groovypp-all-([\\d\\.]+)\\.jar");
|
||||
|
||||
public GppLibraryPresentationProvider() {
|
||||
super(GPP_KIND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillLibrary(String path, LibraryEditor libraryEditor) {
|
||||
File lib = new File(path + "/lib");
|
||||
if (lib.exists()) {
|
||||
libraryEditor.addJarDirectory(VfsUtil.getUrlForLibraryRoot(lib), false, OrderRootType.CLASSES);
|
||||
}
|
||||
|
||||
File srcRoot = new File(path + "/src");
|
||||
addSources(libraryEditor, srcRoot.exists() ? srcRoot : new File(path));
|
||||
}
|
||||
|
||||
private static void addSources(LibraryEditor libraryEditor, File srcRoot) {
|
||||
File compilerSrc = new File(srcRoot, "Compiler/src");
|
||||
if (compilerSrc.exists()) {
|
||||
libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(compilerSrc), OrderRootType.SOURCES);
|
||||
}
|
||||
|
||||
File stdLibSrc = new File(srcRoot, "StdLib/src");
|
||||
if (stdLibSrc.exists()) {
|
||||
libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(stdLibSrc), OrderRootType.SOURCES);
|
||||
}
|
||||
|
||||
File mainSrc = new File(srcRoot, "main");
|
||||
if (mainSrc.exists()) {
|
||||
libraryEditor.addRoot(VfsUtil.getUrlForLibraryRoot(mainSrc), OrderRootType.SOURCES);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean managesLibrary(final VirtualFile[] libraryFiles) {
|
||||
return getGppVersion(libraryFiles) != null;
|
||||
}
|
||||
|
||||
@Nls
|
||||
@Override
|
||||
public String getLibraryVersion(final VirtualFile[] libraryFiles) {
|
||||
return getGppVersion(libraryFiles);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String getGppVersion(VirtualFile[] files) {
|
||||
for (VirtualFile file : files) {
|
||||
Matcher matcher = GROOVYPP_JAR.matcher(file.getName());
|
||||
if (matcher.matches()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
|
||||
matcher = GROOVYPP_ALL_JAR.matcher(file.getName());
|
||||
if (matcher.matches()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return JetgroovyIcons.Groovy.Groovy_16x16;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getSDKVersion(String path) {
|
||||
final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(path);
|
||||
assert file != null;
|
||||
final VirtualFile libDir = file.findChild("lib");
|
||||
assert libDir != null;
|
||||
final String version = getGppVersion(libDir.getChildren());
|
||||
if (version != null) {
|
||||
return version;
|
||||
}
|
||||
throw new AssertionError(path);
|
||||
}
|
||||
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getLibraryCategoryName() {
|
||||
return "Groovy++";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean managesName(@NotNull String name) {
|
||||
return super.managesName(name) || StringUtil.startsWithIgnoreCase(name, "groovypp");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSDKHome(@NotNull VirtualFile file) {
|
||||
final VirtualFile libDir = file.findChild("lib");
|
||||
return libDir != null && getGppVersion(libDir.getChildren()) != null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user