diff --git a/gradle.properties b/gradle.properties index ae38586983..990595908a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ # version = 0.13 -ideaVersion = 2016.3 +ideaVersion = 2017.3 javaVersion = 1.8 javaTargetVersion = 1.8 delveVersion = 0.11.318 diff --git a/src/com/goide/GoModuleType.java b/src/com/goide/GoModuleType.java index 587c482220..628bbfe501 100644 --- a/src/com/goide/GoModuleType.java +++ b/src/com/goide/GoModuleType.java @@ -58,7 +58,7 @@ public String getDescription() { @Nullable @Override - public Icon getBigIcon() { + public Icon getIcon() { return GoIcons.MODULE_ICON; } diff --git a/src/com/goide/project/migration/GoProjectModelConverterProvider.java b/src/com/goide/project/migration/GoProjectModelConverterProvider.java index 97084facbb..5c417f2c2f 100644 --- a/src/com/goide/project/migration/GoProjectModelConverterProvider.java +++ b/src/com/goide/project/migration/GoProjectModelConverterProvider.java @@ -46,6 +46,8 @@ import java.util.Collection; public class GoProjectModelConverterProvider extends ConverterProvider { + public static final String PROJECT_JDK_NAME_ATTR = "project-jdk-name"; // ProjectRootManagerImpl.PROJECT_JDK_NAME_ATTR + public static final String PROJECT_JDK_TYPE_ATTR = "project-jdk-type"; // ProjectRootManagerImpl.PROJECT_JDK_TYPE_ATTR private static final String PROJECT_ROOT_MANAGER = "ProjectRootManager"; protected GoProjectModelConverterProvider() { @@ -82,11 +84,10 @@ public ConversionProcessor createModuleFileConverter() { public ConversionProcessor createRunConfigurationsConverter() { return new RunConfigurationsConverter(); } - @Override public boolean isConversionNeeded() { Element component = getProjectRootManager(context); - return component != null && isGoSdkType(component.getAttributeValue(ProjectRootManagerImpl.PROJECT_JDK_TYPE_ATTR)); + return component != null && isGoSdkType(component.getAttributeValue(PROJECT_JDK_TYPE_ATTR)); } @Override @@ -148,7 +149,7 @@ private static class ProjectFileConverter extends ConversionProcessor { - PsiElement psiElement = usage instanceof PsiElementUsage ? ((PsiElementUsage)usage).getElement() : null; - GoNamedElement topmostElement = PsiTreeUtil.getParentOfType(psiElement, GoTypeSpec.class, GoFunctionOrMethodDeclaration.class); - if (topmostElement != null) { - return new PsiElementUsageGroupBase<>(topmostElement); - } - return null; - }; - - @Nullable - @Override public UsageGroupingRule getUsageGroupingRule(Project project) { - return USAGE_GROUPING_RULE; + return new GoClassGroupingRule(); + } + private static class GoClassGroupingRule extends SingleParentUsageGroupingRule { + @Nullable + @Override + protected UsageGroup getParentGroupFor(@NotNull Usage usage, @NotNull UsageTarget[] targets) { + if (!(usage instanceof PsiElementUsage)) return null; + final PsiElement psiElement = ((PsiElementUsage)usage).getElement(); + GoNamedElement topmostElement = PsiTreeUtil.getParentOfType(psiElement, GoTypeSpec.class, GoFunctionOrMethodDeclaration.class); + if (topmostElement != null) { + return new PsiElementUsageGroupBase<>(topmostElement); + } + return null; + } } }