diff --git a/.java-version b/.java-version index 4684374..9d60796 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -1.8 \ No newline at end of file +11 \ No newline at end of file diff --git a/build.gradle b/build.gradle index a5229d5..d1b6564 100644 --- a/build.gradle +++ b/build.gradle @@ -44,14 +44,14 @@ def pluginsDependencies = ['java', 'Groovy', 'properties', 'yaml', - "org.jetbrains.kotlin:$kotlinVersion-release-IJ2020.2-1", - 'org.intellij.scala:2020.2.17', - 'Dart:202.6397.47', - 'org.jetbrains.plugins.ruby:202.6397.59', - 'com.jetbrains.php:202.6397.94', - 'com.jetbrains.sh:202.6397.21', - 'com.jetbrains.plugins.jade:202.6397.47', - 'org.jetbrains.plugins.go-template:202.6397.21', + "org.jetbrains.kotlin:203-$kotlinVersion-release-IJ5981.133-1", + 'org.intellij.scala:2020.3.21', + 'Dart:203.5981.155', + 'org.jetbrains.plugins.ruby:203.5981.155', + 'com.jetbrains.php:203.5981.155', + 'com.jetbrains.sh:203.5981.37', + 'com.jetbrains.plugins.jade:203.5981.155', + 'org.jetbrains.plugins.go-template:203.5981.155', ] intellij { @@ -82,20 +82,6 @@ idea { } } - -def gistFile = { url, name -> - File file = new File("libs/${name}.jar") - file.parentFile.mkdirs() - if (!file.exists()) { - new URL(url).withInputStream { downloadStream -> - file.withOutputStream { fileOut -> - fileOut << downloadStream - } - } - } - files(file.absolutePath) -} - dependencies { implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:5.10.0.202012080955-r") { exclude module: "gson" diff --git a/gradle.properties b/gradle.properties index f026a89..8bea6f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ group="com.github.izhangzhihao" name="Rainbow Brackets" org.gradle.parallel=true -ideaVersion=IU-202.6397.94 -javaVersion=1.8 -kotlinVersion=1.4.10 +ideaVersion=IU-203.5981.155 +javaVersion=11 +kotlinVersion=1.4.21 kotlinLanguageVersion=1.4 -kotlinTargetVersion=1.3 +kotlinTargetVersion=1.4 version=6.17 publishChannels=Stable kotlin.stdlib.default.dependency=false -pluginVerifierIdeVersions=PCP-2020.2, WS-2020.3, IIC-2021.1 +pluginVerifierIdeVersions=WS-2020.3, IIC-2021.1 diff --git a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/Notify.kt b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/Notify.kt index 2738f02..4d82be2 100644 --- a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/Notify.kt +++ b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/Notify.kt @@ -19,14 +19,10 @@ class ApplicationServicePlaceholder : Disposable { } } -fun createNotification(title: String, content: String, displayId: String, - type: NotificationType, listener: NotificationListener): Notification { - val group = NotificationGroup( - displayId, - NotificationDisplayType.STICKY_BALLOON, - true - ) - return group.createNotification(title, content, type, listener) +fun createNotification(title: String, content: String, type: NotificationType, + listener: NotificationListener): Notification { + return NotificationGroupManager.getInstance().getNotificationGroup("Rainbow Brackets Notification Group") + .createNotification(title, content, type, listener) } fun showFullNotification(project: Project, notification: Notification) { diff --git a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/RainbowUpdateNotifyActivity.kt b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/RainbowUpdateNotifyActivity.kt index 6e7f218..af91dc7 100644 --- a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/RainbowUpdateNotifyActivity.kt +++ b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/RainbowUpdateNotifyActivity.kt @@ -33,7 +33,7 @@ class RainbowUpdateNotifyActivity : StartupActivity { val pluginDescriptor = PluginManagerCore.getPlugin(pluginId) if (pluginDescriptor != null) { //disablePlugin(pluginId) - StartupActionScriptManager.addActionCommand(DeleteCommand(pluginDescriptor.pluginPath.toFile())) + StartupActionScriptManager.addActionCommand(DeleteCommand(pluginDescriptor.pluginPath)) } } } @@ -88,7 +88,6 @@ class RainbowUpdateNotifyActivity : StartupActivity { val notification = createNotification( updateMsg(), updateContent, - pluginId, NotificationType.INFORMATION, UrlOpeningListener(false) ) diff --git a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/AnonymousFeedback.kt b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/AnonymousFeedback.kt index 926ecb8..50fc1c4 100644 --- a/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/AnonymousFeedback.kt +++ b/src/main/kotlin/com/github/izhangzhihao/rainbow/brackets/util/AnonymousFeedback.kt @@ -23,12 +23,12 @@ package com.github.izhangzhihao.rainbow.brackets.util import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings import com.github.izhangzhihao.rainbow.brackets.util.ErrorContext.Companion.fromThrowable import com.intellij.AbstractBundle -import com.intellij.diagnostic.DiagnosticBundle -import com.intellij.diagnostic.LogMessage -import com.intellij.diagnostic.ReportMessages +import com.intellij.diagnostic.* import com.intellij.ide.DataManager import com.intellij.ide.plugins.PluginManagerCore import com.intellij.ide.plugins.PluginUtil +import com.intellij.idea.IdeaLogger +import com.intellij.notification.NotificationGroupManager import com.intellij.notification.NotificationListener import com.intellij.notification.NotificationType import com.intellij.openapi.actionSystem.CommonDataKeys @@ -52,6 +52,8 @@ import org.eclipse.egit.github.core.RepositoryId import org.eclipse.egit.github.core.client.GitHubClient import org.eclipse.egit.github.core.service.IssueService import org.jetbrains.annotations.NonNls +import org.jetbrains.annotations.NotNull +import org.jetbrains.annotations.Nullable import org.jetbrains.annotations.PropertyKey import java.awt.Component import java.util.* @@ -141,14 +143,15 @@ private val something: String by lazy { String(Base64.getDecoder().decode(st)) } class GitHubErrorReporter : ErrorReportSubmitter() { override fun getReportActionText() = ErrorReportBundle.message("report.error.to.plugin.vendor") - override fun submit( - events: Array<IdeaLoggingEvent>, info: String?, parent: Component, consumer: Consumer<SubmittedReportInfo>) = - doSubmit(events[0], parent, consumer, fromThrowable(events[0].throwable), info) + + override fun submit(events: Array<out IdeaLoggingEvent>?, info: @Nullable String?, parent: @NotNull Component, consumer: @NotNull Consumer<in SubmittedReportInfo>): Boolean { + return doSubmit(events!![0], parent, consumer, fromThrowable(events[0].throwable), info) + } private fun doSubmit( event: IdeaLoggingEvent, parent: Component, - callback: Consumer<SubmittedReportInfo>, + callback: Consumer<in SubmittedReportInfo>, errorContext: ErrorContext, description: String?): Boolean { val dataContext = DataManager.getInstance().getDataContext(parent) @@ -179,14 +182,14 @@ class GitHubErrorReporter : ErrorReportSubmitter() { } internal class CallbackWithNotification( - private val consumer: Consumer<SubmittedReportInfo>, + private val consumer: Consumer<in SubmittedReportInfo>, private val project: Project?) : Consumer<SubmittedReportInfo> { override fun consume(reportInfo: SubmittedReportInfo) { consumer.consume(reportInfo) - // NotificationGroupManager.getInstance().getNotificationGroup("Error Report") - if (reportInfo.status == SubmissionStatus.FAILED) ReportMessages.GROUP.createNotification(DiagnosticBundle.message("error.report.title"), + val GROUP = NotificationGroupManager.getInstance().getNotificationGroup("Error Report") + if (reportInfo.status == SubmissionStatus.FAILED) GROUP.createNotification(DiagnosticBundle.message("error.report.title"), reportInfo.linkText, NotificationType.ERROR, null).setImportant(false).notify(project) - else ReportMessages.GROUP.createNotification(DiagnosticBundle.message("error.report.title"), reportInfo.linkText, + else GROUP.createNotification(DiagnosticBundle.message("error.report.title"), reportInfo.linkText, NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(project) } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 2977d6d..252c43c 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -668,7 +668,7 @@ </change-notes> <!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description --> - <idea-version since-build="201.6668"/> + <idea-version since-build="203"/> <!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products on how to target different products --> @@ -716,6 +716,7 @@ <highlightingPassFactory implementation="com.github.izhangzhihao.rainbow.brackets.indents.RainbowIndentsPassFactory"/> <applicationService serviceImplementation="com.github.izhangzhihao.rainbow.brackets.ApplicationServicePlaceholder" id="ApplicationServicePlaceholder"/> <editorNotificationProvider implementation="com.github.izhangzhihao.rainbow.brackets.RainbowifyBanner"/> + <notificationGroup id="Rainbow Brackets Notification Group" displayType="STICKY_BALLOON" key="rainbow.brackets.notification.group"/> </extensions> <applicationListeners>