Skip to content

Commit

Permalink
fix compatibility issue with new idea version
Browse files Browse the repository at this point in the history
  • Loading branch information
caikang.ck committed Apr 20, 2020
1 parent f6ea93d commit eca12e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion idea-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ plugin_name=Alibaba Java Coding Guidelines
gradle_jetbrains_version=0.4.5
systemProp.file.encoding=UTF-8

plugin_version=2.0.1
plugin_version=2.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.alibaba.p3c.idea.component

import com.alibaba.p3c.idea.compatible.inspection.Inspections
import com.alibaba.p3c.idea.component.CommonSettingsApplicationComponent.Companion
import com.alibaba.p3c.idea.config.P3cConfig
import com.alibaba.p3c.idea.i18n.P3cBundle
import com.alibaba.p3c.idea.inspection.AliPmdInspectionInvoker
Expand All @@ -36,8 +35,8 @@ import com.intellij.psi.PsiManager
* @date 2016/12/13
*/
class AliProjectComponent(
private val project: Project,
val p3cConfig: P3cConfig
private val project: Project,
val p3cConfig: P3cConfig
) : AliBaseProjectComponent {
private val listener: VirtualFileListener
private val javaExtension = ".java"
Expand All @@ -64,8 +63,8 @@ class AliProjectComponent(

override fun initComponent() {
I18nResources.changeLanguage(p3cConfig.locale)
val analyticsGroup = ActionManager.getInstance().getAction(CommonSettingsApplicationComponent.analyticsGroupId)
analyticsGroup.templatePresentation.text = P3cBundle.getMessage(CommonSettingsApplicationComponent.analyticsGroupText)
val analyticsGroup = ActionManager.getInstance().getAction(analyticsGroupId)
analyticsGroup.templatePresentation.text = P3cBundle.getMessage(analyticsGroupText)
}

override fun projectOpened() {
Expand All @@ -76,4 +75,9 @@ class AliProjectComponent(
override fun projectClosed() {
VirtualFileManager.getInstance().removeVirtualFileListener(listener)
}

companion object {
val analyticsGroupId = "com.alibaba.p3c.analytics.action_group"
val analyticsGroupText = "$analyticsGroupId.text"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@
*/
package com.alibaba.p3c.idea.component

import com.alibaba.p3c.idea.config.P3cConfig
import com.alibaba.p3c.idea.i18n.P3cBundle
import com.alibaba.p3c.idea.util.HighlightInfoTypes
import com.alibaba.p3c.idea.util.HighlightSeverities
import com.alibaba.p3c.pmd.I18nResources
import com.alibaba.smartfox.idea.common.component.AliBaseApplicationComponent
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.components.ServiceManager

/**
*
Expand All @@ -37,9 +32,4 @@ class CommonSettingsApplicationComponent : AliBaseApplicationComponent {
SeverityRegistrar.registerStandard(HighlightInfoTypes.CRITICAL, HighlightSeverities.CRITICAL)
SeverityRegistrar.registerStandard(HighlightInfoTypes.MAJOR, HighlightSeverities.MAJOR)
}

companion object {
val analyticsGroupId = "com.alibaba.p3c.analytics.action_group"
val analyticsGroupText = "$analyticsGroupId.text"
}
}

0 comments on commit eca12e7

Please sign in to comment.