1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-04-22 22:15:43 +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',
'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"

View File

@ -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

View File

@ -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) {

View File

@ -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)
)

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.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)
}
}

View File

@ -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>