1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-05-02 04:34:03 +02:00

Initial commit for 2020.3

This commit is contained in:
张志豪 2021-03-10 23:03:29 +08:00
parent 9f6a23fbbd
commit c8d93fe718
7 changed files with 35 additions and 50 deletions
.java-versionbuild.gradlegradle.properties
src/main
kotlin/com/github/izhangzhihao/rainbow/brackets
resources/META-INF

View File

@ -1 +1 @@
1.8 11

View File

@ -44,14 +44,14 @@ def pluginsDependencies = ['java',
'Groovy', 'Groovy',
'properties', 'properties',
'yaml', 'yaml',
"org.jetbrains.kotlin:$kotlinVersion-release-IJ2020.2-1", "org.jetbrains.kotlin:203-$kotlinVersion-release-IJ5981.133-1",
'org.intellij.scala:2020.2.17', 'org.intellij.scala:2020.3.21',
'Dart:202.6397.47', 'Dart:203.5981.155',
'org.jetbrains.plugins.ruby:202.6397.59', 'org.jetbrains.plugins.ruby:203.5981.155',
'com.jetbrains.php:202.6397.94', 'com.jetbrains.php:203.5981.155',
'com.jetbrains.sh:202.6397.21', 'com.jetbrains.sh:203.5981.37',
'com.jetbrains.plugins.jade:202.6397.47', 'com.jetbrains.plugins.jade:203.5981.155',
'org.jetbrains.plugins.go-template:202.6397.21', 'org.jetbrains.plugins.go-template:203.5981.155',
] ]
intellij { 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 { dependencies {
implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:5.10.0.202012080955-r") { implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:5.10.0.202012080955-r") {
exclude module: "gson" exclude module: "gson"

View File

@ -1,12 +1,12 @@
group="com.github.izhangzhihao" group="com.github.izhangzhihao"
name="Rainbow Brackets" name="Rainbow Brackets"
org.gradle.parallel=true org.gradle.parallel=true
ideaVersion=IU-202.6397.94 ideaVersion=IU-203.5981.155
javaVersion=1.8 javaVersion=11
kotlinVersion=1.4.10 kotlinVersion=1.4.21
kotlinLanguageVersion=1.4 kotlinLanguageVersion=1.4
kotlinTargetVersion=1.3 kotlinTargetVersion=1.4
version=6.17 version=6.17
publishChannels=Stable publishChannels=Stable
kotlin.stdlib.default.dependency=false kotlin.stdlib.default.dependency=false
pluginVerifierIdeVersions=PCP-2020.2, WS-2020.3, IIC-2021.1 pluginVerifierIdeVersions=WS-2020.3, IIC-2021.1

View File

@ -19,14 +19,10 @@ class ApplicationServicePlaceholder : Disposable {
} }
} }
fun createNotification(title: String, content: String, displayId: String, fun createNotification(title: String, content: String, type: NotificationType,
type: NotificationType, listener: NotificationListener): Notification { listener: NotificationListener): Notification {
val group = NotificationGroup( return NotificationGroupManager.getInstance().getNotificationGroup("Rainbow Brackets Notification Group")
displayId, .createNotification(title, content, type, listener)
NotificationDisplayType.STICKY_BALLOON,
true
)
return group.createNotification(title, content, type, listener)
} }
fun showFullNotification(project: Project, notification: Notification) { fun showFullNotification(project: Project, notification: Notification) {

View File

@ -33,7 +33,7 @@ class RainbowUpdateNotifyActivity : StartupActivity {
val pluginDescriptor = PluginManagerCore.getPlugin(pluginId) val pluginDescriptor = PluginManagerCore.getPlugin(pluginId)
if (pluginDescriptor != null) { if (pluginDescriptor != null) {
//disablePlugin(pluginId) //disablePlugin(pluginId)
StartupActionScriptManager.addActionCommand(DeleteCommand(pluginDescriptor.pluginPath.toFile())) StartupActionScriptManager.addActionCommand(DeleteCommand(pluginDescriptor.pluginPath))
} }
} }
} }
@ -88,7 +88,6 @@ class RainbowUpdateNotifyActivity : StartupActivity {
val notification = createNotification( val notification = createNotification(
updateMsg(), updateMsg(),
updateContent, updateContent,
pluginId,
NotificationType.INFORMATION, NotificationType.INFORMATION,
UrlOpeningListener(false) UrlOpeningListener(false)
) )

View File

@ -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.settings.RainbowSettings
import com.github.izhangzhihao.rainbow.brackets.util.ErrorContext.Companion.fromThrowable import com.github.izhangzhihao.rainbow.brackets.util.ErrorContext.Companion.fromThrowable
import com.intellij.AbstractBundle import com.intellij.AbstractBundle
import com.intellij.diagnostic.DiagnosticBundle import com.intellij.diagnostic.*
import com.intellij.diagnostic.LogMessage
import com.intellij.diagnostic.ReportMessages
import com.intellij.ide.DataManager import com.intellij.ide.DataManager
import com.intellij.ide.plugins.PluginManagerCore import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.plugins.PluginUtil 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.NotificationListener
import com.intellij.notification.NotificationType import com.intellij.notification.NotificationType
import com.intellij.openapi.actionSystem.CommonDataKeys 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.client.GitHubClient
import org.eclipse.egit.github.core.service.IssueService import org.eclipse.egit.github.core.service.IssueService
import org.jetbrains.annotations.NonNls import org.jetbrains.annotations.NonNls
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
import org.jetbrains.annotations.PropertyKey import org.jetbrains.annotations.PropertyKey
import java.awt.Component import java.awt.Component
import java.util.* import java.util.*
@ -141,14 +143,15 @@ private val something: String by lazy { String(Base64.getDecoder().decode(st)) }
class GitHubErrorReporter : ErrorReportSubmitter() { class GitHubErrorReporter : ErrorReportSubmitter() {
override fun getReportActionText() = ErrorReportBundle.message("report.error.to.plugin.vendor") override fun getReportActionText() = ErrorReportBundle.message("report.error.to.plugin.vendor")
override fun submit(
events: Array<IdeaLoggingEvent>, info: String?, parent: Component, consumer: Consumer<SubmittedReportInfo>) = override fun submit(events: Array<out IdeaLoggingEvent>?, info: @Nullable String?, parent: @NotNull Component, consumer: @NotNull Consumer<in SubmittedReportInfo>): Boolean {
doSubmit(events[0], parent, consumer, fromThrowable(events[0].throwable), info) return doSubmit(events!![0], parent, consumer, fromThrowable(events[0].throwable), info)
}
private fun doSubmit( private fun doSubmit(
event: IdeaLoggingEvent, event: IdeaLoggingEvent,
parent: Component, parent: Component,
callback: Consumer<SubmittedReportInfo>, callback: Consumer<in SubmittedReportInfo>,
errorContext: ErrorContext, errorContext: ErrorContext,
description: String?): Boolean { description: String?): Boolean {
val dataContext = DataManager.getInstance().getDataContext(parent) val dataContext = DataManager.getInstance().getDataContext(parent)
@ -179,14 +182,14 @@ class GitHubErrorReporter : ErrorReportSubmitter() {
} }
internal class CallbackWithNotification( internal class CallbackWithNotification(
private val consumer: Consumer<SubmittedReportInfo>, private val consumer: Consumer<in SubmittedReportInfo>,
private val project: Project?) : Consumer<SubmittedReportInfo> { private val project: Project?) : Consumer<SubmittedReportInfo> {
override fun consume(reportInfo: SubmittedReportInfo) { override fun consume(reportInfo: SubmittedReportInfo) {
consumer.consume(reportInfo) consumer.consume(reportInfo)
// NotificationGroupManager.getInstance().getNotificationGroup("Error Report") val GROUP = NotificationGroupManager.getInstance().getNotificationGroup("Error Report")
if (reportInfo.status == SubmissionStatus.FAILED) ReportMessages.GROUP.createNotification(DiagnosticBundle.message("error.report.title"), if (reportInfo.status == SubmissionStatus.FAILED) GROUP.createNotification(DiagnosticBundle.message("error.report.title"),
reportInfo.linkText, NotificationType.ERROR, null).setImportant(false).notify(project) 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) NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(project)
} }
} }

View File

@ -668,7 +668,7 @@
</change-notes> </change-notes>
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description --> <!-- 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 <!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
on how to target different products --> on how to target different products -->
@ -716,6 +716,7 @@
<highlightingPassFactory implementation="com.github.izhangzhihao.rainbow.brackets.indents.RainbowIndentsPassFactory"/> <highlightingPassFactory implementation="com.github.izhangzhihao.rainbow.brackets.indents.RainbowIndentsPassFactory"/>
<applicationService serviceImplementation="com.github.izhangzhihao.rainbow.brackets.ApplicationServicePlaceholder" id="ApplicationServicePlaceholder"/> <applicationService serviceImplementation="com.github.izhangzhihao.rainbow.brackets.ApplicationServicePlaceholder" id="ApplicationServicePlaceholder"/>
<editorNotificationProvider implementation="com.github.izhangzhihao.rainbow.brackets.RainbowifyBanner"/> <editorNotificationProvider implementation="com.github.izhangzhihao.rainbow.brackets.RainbowifyBanner"/>
<notificationGroup id="Rainbow Brackets Notification Group" displayType="STICKY_BALLOON" key="rainbow.brackets.notification.group"/>
</extensions> </extensions>
<applicationListeners> <applicationListeners>