fix compatibility issue with new idea version

pull/671/head idea-plugin-2.0.2
caikang.ck 5 years ago
parent f6ea93d1b6
commit eca12e7b6a

@ -5,4 +5,4 @@ plugin_name=Alibaba Java Coding Guidelines
gradle_jetbrains_version=0.4.5 gradle_jetbrains_version=0.4.5
systemProp.file.encoding=UTF-8 systemProp.file.encoding=UTF-8
plugin_version=2.0.1 plugin_version=2.0.2

@ -16,7 +16,6 @@
package com.alibaba.p3c.idea.component package com.alibaba.p3c.idea.component
import com.alibaba.p3c.idea.compatible.inspection.Inspections 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.config.P3cConfig
import com.alibaba.p3c.idea.i18n.P3cBundle import com.alibaba.p3c.idea.i18n.P3cBundle
import com.alibaba.p3c.idea.inspection.AliPmdInspectionInvoker import com.alibaba.p3c.idea.inspection.AliPmdInspectionInvoker
@ -64,8 +63,8 @@ class AliProjectComponent(
override fun initComponent() { override fun initComponent() {
I18nResources.changeLanguage(p3cConfig.locale) I18nResources.changeLanguage(p3cConfig.locale)
val analyticsGroup = ActionManager.getInstance().getAction(CommonSettingsApplicationComponent.analyticsGroupId) val analyticsGroup = ActionManager.getInstance().getAction(analyticsGroupId)
analyticsGroup.templatePresentation.text = P3cBundle.getMessage(CommonSettingsApplicationComponent.analyticsGroupText) analyticsGroup.templatePresentation.text = P3cBundle.getMessage(analyticsGroupText)
} }
override fun projectOpened() { override fun projectOpened() {
@ -76,4 +75,9 @@ class AliProjectComponent(
override fun projectClosed() { override fun projectClosed() {
VirtualFileManager.getInstance().removeVirtualFileListener(listener) VirtualFileManager.getInstance().removeVirtualFileListener(listener)
} }
companion object {
val analyticsGroupId = "com.alibaba.p3c.analytics.action_group"
val analyticsGroupText = "$analyticsGroupId.text"
}
} }

@ -15,15 +15,10 @@
*/ */
package com.alibaba.p3c.idea.component 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.HighlightInfoTypes
import com.alibaba.p3c.idea.util.HighlightSeverities import com.alibaba.p3c.idea.util.HighlightSeverities
import com.alibaba.p3c.pmd.I18nResources
import com.alibaba.smartfox.idea.common.component.AliBaseApplicationComponent import com.alibaba.smartfox.idea.common.component.AliBaseApplicationComponent
import com.intellij.codeInsight.daemon.impl.SeverityRegistrar import com.intellij.codeInsight.daemon.impl.SeverityRegistrar
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.components.ServiceManager
/** /**
* *
@ -37,9 +32,4 @@ class CommonSettingsApplicationComponent : AliBaseApplicationComponent {
SeverityRegistrar.registerStandard(HighlightInfoTypes.CRITICAL, HighlightSeverities.CRITICAL) SeverityRegistrar.registerStandard(HighlightInfoTypes.CRITICAL, HighlightSeverities.CRITICAL)
SeverityRegistrar.registerStandard(HighlightInfoTypes.MAJOR, HighlightSeverities.MAJOR) SeverityRegistrar.registerStandard(HighlightInfoTypes.MAJOR, HighlightSeverities.MAJOR)
} }
companion object {
val analyticsGroupId = "com.alibaba.p3c.analytics.action_group"
val analyticsGroupText = "$analyticsGroupId.text"
}
} }

Loading…
Cancel
Save