1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2024-11-25 23:42:44 +01:00

Compare commits

...

4 Commits

Author SHA1 Message Date
01c37cde63
Release 6.26-chylex-1 2022-11-01 12:23:19 +01:00
8e3c6892f5
Remove post-update notification 2022-11-01 12:23:19 +01:00
55d2cab839
Fix missing @Test annotations 2022-11-01 12:23:19 +01:00
83314b4675
Update IDEA (2022.2.3) and Gradle 2022-11-01 12:23:19 +01:00
20 changed files with 264 additions and 350 deletions

View File

@ -1,18 +1,7 @@
import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val name: String by project
val ideaVersion: String by project
val kotlinVersion: String by project
val javaVersion: String by project
val kotlinLanguageVersion: String by project
val kotlinTargetVersion: String by project
val pluginVerifierIdeVersions: String by project
val publishChannels: String by project
plugins { plugins {
id("org.jetbrains.intellij") version "1.9.0" id("org.jetbrains.intellij") version "1.9.0"
id("com.adarshr.test-logger") version "3.2.0"
id("org.jetbrains.kotlin.jvm") version "1.7.20" id("org.jetbrains.kotlin.jvm") version "1.7.20"
id("idea") id("idea")
} }
@ -21,83 +10,65 @@ repositories {
mavenLocal() mavenLocal()
mavenCentral() mavenCentral()
maven(url = "https://maven-central.storage-download.googleapis.com/repos/central/data/") maven(url = "https://maven-central.storage-download.googleapis.com/repos/central/data/")
maven(url = "https://maven.aliyun.com/nexus/content/groups/public/")
maven(url = "https://www.jetbrains.com/intellij-repository/releases") maven(url = "https://www.jetbrains.com/intellij-repository/releases")
maven(url = "https://www.jetbrains.com/intellij-repository/snapshots") maven(url = "https://www.jetbrains.com/intellij-repository/snapshots")
} }
intellij { group = "com.github.izhangzhihao"
pluginName.set(name) version = "6.26-chylex-1"
version.set(ideaVersion) intellij {
//localPath = '/Users/izhangzhihao/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/201.6668.121/IntelliJ IDEA 2020.1 EAP.app/Contents' type.set("IU")
//localPath = '/Users/izhangzhihao/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/201.6668.126/CLion.app/Contents' version.set("2022.2.3")
updateSinceUntilBuild.set(false) updateSinceUntilBuild.set(false)
plugins.set( plugins.set(
listOf( listOf(
"java", // Built-in
"java-i18n",
"JavaScriptLanguage",
"DatabaseTools",
"CSS",
"platform-images",
"Groovy", "Groovy",
"properties", "JavaScript",
"yaml", "com.intellij.css",
"org.jetbrains.kotlin:203-$kotlinVersion-release-IJ5981.133-1", "com.intellij.database",
"org.intellij.scala:2020.3.21", "com.intellij.java",
"Dart:203.5981.155", "org.intellij.plugins.markdown",
"org.jetbrains.plugins.ruby:203.5981.155", "org.jetbrains.kotlin",
"com.jetbrains.php:203.5981.155", "org.jetbrains.plugins.yaml",
"com.jetbrains.sh:203.5981.37", // Downloaded
"com.jetbrains.plugins.jade:203.5981.155", "Dart:222.4345.14", // https://plugins.jetbrains.com/plugin/6351-dart/versions/stable
"org.jetbrains.plugins.go-template:203.5981.155", "Pythonid:222.4345.14", // https://plugins.jetbrains.com/plugin/631-python/versions
"Pythonid:203.5981.155", "com.jetbrains.php:222.4345.15", // https://plugins.jetbrains.com/plugin/6610-php/versions
"com.jetbrains.sh:222.4345.5", // https://plugins.jetbrains.com/plugin/13122-shell-script/versions
"org.intellij.scala:2022.2.17", // https://plugins.jetbrains.com/plugin/1347-scala/versions
"org.jetbrains.plugins.go-template:222.4345.14", // https://plugins.jetbrains.com/plugin/10581-go-template/versions
"org.jetbrains.plugins.ruby:222.4345.14", // https://plugins.jetbrains.com/plugin/1293-ruby/versions
) )
) )
} }
tasks { tasks.runIde {
runIde { systemProperties["idea.auto.reload.plugins"] = false
systemProperties["idea.auto.reload.plugins"] = false jvmArgs = listOf(
jvmArgs = listOf( "-Xms512m",
"-Xms512m", "-Xmx2048m",
"-Xmx2048m", )
) }
}
publishPlugin { tasks.patchPluginXml {
token.set(System.getenv("token")) sinceBuild.set("222")
channels.set(publishChannels.split(",").map { it.trim() }.toList())
}
runPluginVerifier {
ideVersions.set(pluginVerifierIdeVersions.split(",").map { it.trim() }.toList())
failureLevel.set(listOf(COMPATIBILITY_PROBLEMS))
}
testlogger {
theme = com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA
}
} }
dependencies { dependencies {
//implementation("org.eclipse.mylyn.github:org.eclipse.egit.github.core:5.11.0.202103091610-r") {
// exclude("gson")
//}
compileOnly(fileTree("libs")) compileOnly(fileTree("libs"))
testImplementation("io.kotest:kotest-assertions-core:5.5.0") testImplementation("io.kotest:kotest-assertions-core:5.5.2")
} }
java { java {
sourceCompatibility = JavaVersion.VERSION_11 toolchain {
targetCompatibility = JavaVersion.VERSION_11 languageVersion.set(JavaLanguageVersion.of(17))
}
} }
tasks.withType<KotlinCompile> { tasks.withType<KotlinCompile> {
kotlinOptions.languageVersion = kotlinLanguageVersion kotlinOptions.jvmTarget = "17"
kotlinOptions.apiVersion = kotlinTargetVersion kotlinOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.freeCompilerArgs = listOf("-Xskip-runtime-version-check", "-Xjsr305=strict")
} }

View File

@ -1,12 +1,2 @@
group="com.github.izhangzhihao"
name="Rainbow Brackets"
org.gradle.parallel=true org.gradle.parallel=true
ideaVersion=IU-203.5981.155
javaVersion=11
kotlinVersion=1.4.21
kotlinLanguageVersion=1.4
kotlinTargetVersion=1.4
version=6.26
publishChannels=Stable
kotlin.stdlib.default.dependency=false kotlin.stdlib.default.dependency=false
pluginVerifierIdeVersions=WS-2020.3, IIC-2021.1, IIU-2021.2

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

269
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/bin/sh
# #
# Copyright 2015 the original author or authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,67 +17,101 @@
# #
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # Gradle start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
@ -106,80 +140,95 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD=$( ulimit -H -n ) ||
MAX_FD="$MAX_FD_LIMIT" warn "Could not query maximum file descriptor limit"
fi esac
ulimit -n $MAX_FD case $MAX_FD in #(
if [ $? -ne 0 ] ; then '' | soft) :;; #(
warn "Could not set maximum file descriptor limit: $MAX_FD" *)
fi ulimit -n "$MAX_FD" ||
else warn "Could not set maximum file descriptor limit to $MAX_FD"
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=`save "$@"` # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

View File

@ -1,3 +1,5 @@
rootProject.name = "RainbowBrackets"
pluginManagement { pluginManagement {
repositories { repositories {
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")

View File

@ -1,48 +0,0 @@
package com.github.izhangzhihao.rainbow.brackets
import com.intellij.notification.*
import com.intellij.notification.impl.NotificationsManagerImpl
import com.intellij.openapi.Disposable
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.popup.Balloon
import com.intellij.openapi.wm.WindowManager
import com.intellij.ui.BalloonLayoutData
import com.intellij.ui.awt.RelativePoint
import java.awt.Point
class ApplicationServicePlaceholder : Disposable {
override fun dispose() = Unit
companion object {
val INSTANCE: ApplicationServicePlaceholder = ApplicationManager.getApplication().getService(ApplicationServicePlaceholder::class.java)
}
}
fun createNotification(title: String, content: String, type: NotificationType,
listener: NotificationListener): Notification {
return NotificationGroupManager.getInstance().getNotificationGroup("Rainbow Brackets Notification Group")
.createNotification(title, content, type).setListener(listener)
}
fun showFullNotification(project: Project, notification: Notification) {
val frame = WindowManager.getInstance().getIdeFrame(project)
if (frame == null) {
notification.notify(project)
return
}
val bounds = frame.component.bounds
val target = RelativePoint(frame.component, Point(bounds.x + bounds.width, 20))
try {
val balloon = NotificationsManagerImpl.createBalloon(frame,
notification,
true, // showCallout
true, // hideOnClickOutside
BalloonLayoutData.fullContent(),
ApplicationServicePlaceholder.INSTANCE)
balloon.show(target, Balloon.Position.atLeft)
} catch (e: Exception) {
notification.notify(project)
}
}

View File

@ -1,97 +0,0 @@
package com.github.izhangzhihao.rainbow.brackets
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.plugins.PluginManagerCore.isPluginInstalled
import com.intellij.ide.startup.StartupActionScriptManager
import com.intellij.ide.startup.StartupActionScriptManager.DeleteCommand
import com.intellij.notification.NotificationListener.UrlOpeningListener
import com.intellij.notification.NotificationType
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
class RainbowUpdateNotifyActivity : StartupActivity {
override fun runActivity(project: Project) {
removeIfInstalled()
val settings = RainbowSettings.instance
if (getPlugin()?.version != settings.version) {
settings.version = getPlugin()!!.version
if (settings.showNotificationOnUpdate) {
showUpdate(project)
}
}
}
private fun removeIfInstalled() {
val pluginId = PluginId.getId("com.github.jadepeng.rainbowfart")
val isInstalled = isPluginInstalled(pluginId)
if (isInstalled) {
val pluginDescriptor = PluginManagerCore.getPlugin(pluginId)
if (pluginDescriptor != null) {
//disablePlugin(pluginId)
StartupActionScriptManager.addActionCommand(DeleteCommand(pluginDescriptor.pluginPath))
}
}
}
companion object {
const val pluginId = "izhangzhihao.rainbow.brackets"
private val updateContent: String by lazy {
//language=HTML
"""
<br/>
🌈Thank you for downloading <b><a href="https://github.com/izhangzhihao/intellij-rainbow-brackets">Rainbow Brackets</a></b>!<br>
🎉Sponsored by <a href="https://codestream.com/?utm_source=jbmarket&utm_medium=banner&utm_campaign=jbrainbowbrackets">CodeStream</a>.<br>
👍If you find this plugin helpful, <b><a href="https://github.com/izhangzhihao/intellij-rainbow-brackets#support-us">please support us!</a>.</b><br>
<b><a href="https://github.com/izhangzhihao/intellij-rainbow-brackets#support-us">Donate</a></b> by <b><a href="https://opencollective.com/intellij-rainbow-brackets">OpenCollective</a></b> Or AliPay/WeChatPay to <b><a href="https://github.com/izhangzhihao/intellij-rainbow-brackets#sponsors">become a sponsor</a>!.</b><br>
📝Check out <b><a href="https://izhangzhihao.github.io/rainbow-brackets-document/">the document</a></b> for all features of this plugin.<br>
🐛If you run into any problem, <b><a href="https://github.com/izhangzhihao/intellij-rainbow-brackets/issues">feel free to raise an issue</a>.</b><br>
🆕See <b><a href="${changelog()}">changelog</a></b> for more details about this update.<br>
👉Want to customize your own color scheme of Rainbow Brackets? Edit it under
<b>Settings > Editor > Color Scheme > Rainbow Brackets</b><br>
👉Tired of the bundled colors? Try out the new color generator!
<b>Settings > Other Settings > Rainbow Brackets > Use color generator</b><br>
👉Other additional features under
<b>Settings > Other Settings > Rainbow Brackets</b><br/>
Enjoy your colorful code🌈.
"""
}
private fun changelog(): String {
val plugin = getPlugin()
return if (plugin == null) {
"""https://github.com/izhangzhihao/intellij-rainbow-brackets/releases"""
} else {
"""https://github.com/izhangzhihao/intellij-rainbow-brackets/releases/tag/${plugin.version}"""
}
}
fun getPlugin(): IdeaPluginDescriptor? = PluginManagerCore.getPlugin(PluginId.getId(pluginId))
private fun updateMsg(): String {
val plugin = getPlugin()
return if (plugin == null) {
"Rainbow Brackets installed."
} else {
"Rainbow Brackets updated to ${plugin.version}"
}
}
private fun showUpdate(project: Project) {
val notification = createNotification(
updateMsg(),
updateContent,
NotificationType.INFORMATION,
UrlOpeningListener(false)
)
showFullNotification(project, notification)
}
}
}

View File

@ -21,7 +21,6 @@ class RainbowSettings : PersistentStateComponent<RainbowSettings> {
var isShowRainbowIndentGuides = true var isShowRainbowIndentGuides = true
var isDoNOTRainbowifyBracketsWithoutContent = false var isDoNOTRainbowifyBracketsWithoutContent = false
var isDoNOTRainbowifyTheFirstLevel = false var isDoNOTRainbowifyTheFirstLevel = false
var version = "Unknown"
var isRainbowifyHTMLInsideJS = true var isRainbowifyHTMLInsideJS = true
var isRainbowifyKotlinLabel = true var isRainbowifyKotlinLabel = true
var isRainbowifyKotlinFunctionLiteralBracesAndArrow = true var isRainbowifyKotlinFunctionLiteralBracesAndArrow = true
@ -36,7 +35,6 @@ class RainbowSettings : PersistentStateComponent<RainbowSettings> {
var disableRainbowIndentsInZenMode = true var disableRainbowIndentsInZenMode = true
var useColorGenerator = false var useColorGenerator = false
var customColorGeneratorOption: String? = null var customColorGeneratorOption: String? = null
var showNotificationOnUpdate = true
var rainbowifyTagNameInXML = false var rainbowifyTagNameInXML = false
var doNOTRainbowifyTemplateString = false var doNOTRainbowifyTemplateString = false
var doNOTRainbowifyBigFiles = true var doNOTRainbowifyBigFiles = true

View File

@ -50,6 +50,12 @@
]]></description> ]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
<p>6.26-chylex-1</p>
<ul>
<li>Removed post-update notification.</li>
</ul>
<br/>
<p>6.26</p> <p>6.26</p>
<ul> <ul>
<li>Bump dependencies.</li> <li>Bump dependencies.</li>
@ -730,9 +736,6 @@
]]> ]]>
</change-notes> </change-notes>
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="203" until-build="222.*"/>
<!-- please see https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html <!-- please see https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html
on how to target different products --> on how to target different products -->
<depends>com.intellij.modules.lang</depends> <depends>com.intellij.modules.lang</depends>
@ -775,10 +778,8 @@
<additionalTextAttributes scheme="Default" file="colorSchemes/rainbow-color-default.xml"/> <additionalTextAttributes scheme="Default" file="colorSchemes/rainbow-color-default.xml"/>
<additionalTextAttributes scheme="Darcula" file="colorSchemes/rainbow-color-default-darcula.xml"/> <additionalTextAttributes scheme="Darcula" file="colorSchemes/rainbow-color-default-darcula.xml"/>
<postStartupActivity implementation="com.github.izhangzhihao.rainbow.brackets.RainbowUpdateNotifyActivity"/>
<!--<errorHandler implementation="com.github.izhangzhihao.rainbow.brackets.util.GitHubErrorReporter"/>--> <!--<errorHandler implementation="com.github.izhangzhihao.rainbow.brackets.util.GitHubErrorReporter"/>-->
<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"/>
<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"/> <notificationGroup id="Rainbow Brackets Notification Group" displayType="STICKY_BALLOON"/>
</extensions> </extensions>

View File

@ -4,8 +4,11 @@ import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import com.jetbrains.lang.dart.DartFileType import com.jetbrains.lang.dart.DartFileType
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.junit.Test
class RainbowDartTest : LightJavaCodeInsightFixtureTestCase() { class RainbowDartTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testRainbowForDart() { fun testRainbowForDart() {
val code = val code =
""" """

View File

@ -5,9 +5,11 @@ import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.jetbrains.plugins.groovy.GroovyFileType import org.jetbrains.plugins.groovy.GroovyFileType
import org.junit.Test
class RainbowGroovyTest : LightJavaCodeInsightFixtureTestCase() { class RainbowGroovyTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testRainbowForGroovy() { fun testRainbowForGroovy() {
@Language("Groovy") val code = @Language("Groovy") val code =
""" """

View File

@ -9,13 +9,16 @@ import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.junit.Test
class RainbowJavaScriptTest : LightJavaCodeInsightFixtureTestCase() { class RainbowJavaScriptTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testJavaScriptPluginEnabled() { fun testJavaScriptPluginEnabled() {
assertTrue(PluginManagerCore.getPlugin(PluginId.getId("JavaScript"))?.isEnabled!!) assertTrue(PluginManagerCore.getPlugin(PluginId.getId("JavaScript"))?.isEnabled!!)
} }
@Test
fun testIssue11() { fun testIssue11() {
@Language("JavaScript") val code = """ @Language("JavaScript") val code = """
"use strict"; "use strict";
@ -41,6 +44,7 @@ const moment = require('moment')
) )
} }
@Test
fun testIssue12() { fun testIssue12() {
@Language("JavaScript") val code = """ @Language("JavaScript") val code = """
"use strict"; "use strict";
@ -64,6 +68,7 @@ console.log(a == b)
) )
} }
@Test
fun testIssue21() { fun testIssue21() {
@Language("JavaScript") val code = "open (\$" + "{f})\n" + "open (\$" + "{f} )" @Language("JavaScript") val code = "open (\$" + "{f})\n" + "open (\$" + "{f} )"
@ -85,6 +90,7 @@ console.log(a == b)
) )
} }
@Test
fun testIssue23() { fun testIssue23() {
@Language("JavaScript") val code = """ @Language("JavaScript") val code = """
"use strict"; "use strict";
@ -131,6 +137,7 @@ if ((a.field_detail && a.is) ||
) )
} }
@Test
fun testIssue38() { fun testIssue38() {
@Language("JavaScript") val code = """ @Language("JavaScript") val code = """
const element = ( <div> <h1>Hello, world!</h1> </div> ); const element = ( <div> <h1>Hello, world!</h1> </div> );
@ -162,6 +169,7 @@ const element = ( <div> <h1>Hello, world!</h1> </div> );
) )
} }
@Test
fun `for somehow, it just don't work "testIssue39"`() { fun `for somehow, it just don't work "testIssue39"`() {
@Language("JavaScript") val code = """ @Language("JavaScript") val code = """
const html = '<div><div><div>Hello</div></div></div>' const html = '<div><div><div>Hello</div></div></div>'
@ -193,6 +201,7 @@ const element = ( <div> <h1>Hello, world!</h1> </div> );
) )
} }
@Test
fun testIssue31() { fun testIssue31() {
@Language("JavaScript") val code = """ @Language("JavaScript") val code = """
"use strict"; "use strict";
@ -223,6 +232,7 @@ const element = ( <div> <h1>Hello, world!</h1> </div> );
) )
} }
@Test
fun testIssue427() { fun testIssue427() {
@Language("TypeScript") val code = """let example: Array<Map<string,string>>;""".trimIndent() @Language("TypeScript") val code = """let example: Array<Map<string,string>>;""".trimIndent()

View File

@ -6,6 +6,7 @@ import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.junit.Test
class RainbowJavaTest : LightJavaCodeInsightFixtureTestCase() { class RainbowJavaTest : LightJavaCodeInsightFixtureTestCase() {
override fun tearDown() { override fun tearDown() {
@ -22,6 +23,7 @@ class RainbowJavaTest : LightJavaCodeInsightFixtureTestCase() {
rainbowSettings.languageBlacklist = setOf() rainbowSettings.languageBlacklist = setOf()
} }
@Test
fun testRainbowForJava() { fun testRainbowForJava() {
@Language("Java") val code = @Language("Java") val code =
""" """
@ -60,6 +62,7 @@ public class Test<T> {
) )
} }
@Test
fun testDisableRainbowForJava() { fun testDisableRainbowForJava() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isRainbowEnabled = false rainbowSettings.isRainbowEnabled = false
@ -83,6 +86,7 @@ public class Test<T> {
) )
} }
@Test
fun testDisableRainbowAngleBracketsForJava() { fun testDisableRainbowAngleBracketsForJava() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isEnableRainbowAngleBrackets = false rainbowSettings.isEnableRainbowAngleBrackets = false
@ -121,6 +125,7 @@ public class Test<T> {
) )
} }
@Test
fun testDisableRainbowRoundBracketsForJava() { fun testDisableRainbowRoundBracketsForJava() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isEnableRainbowRoundBrackets = false rainbowSettings.isEnableRainbowRoundBrackets = false
@ -151,6 +156,7 @@ public class Test<T> {
) )
} }
@Test
fun testDisableRainbowSquigglyBracketsForJava() { fun testDisableRainbowSquigglyBracketsForJava() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isEnableRainbowSquigglyBrackets = false rainbowSettings.isEnableRainbowSquigglyBrackets = false
@ -187,6 +193,7 @@ public class Test<T> {
) )
} }
@Test
fun testDoNOTRainbowifyBracketsWithoutContentForJava() { fun testDoNOTRainbowifyBracketsWithoutContentForJava() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = true rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = true
@ -223,6 +230,7 @@ public class Test<T> {
) )
} }
@Test
fun testDoNOTRainbowifyBracketsWhenJavaInBlacklist() { fun testDoNOTRainbowifyBracketsWhenJavaInBlacklist() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = true rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = true
@ -246,6 +254,7 @@ public class Test<T> {
.shouldBe(0) .shouldBe(0)
} }
@Test
fun testIssue391() { fun testIssue391() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.cycleCountOnAllBrackets = true rainbowSettings.cycleCountOnAllBrackets = true

View File

@ -5,8 +5,11 @@ import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.jetbrains.kotlin.idea.KotlinFileType import org.jetbrains.kotlin.idea.KotlinFileType
import org.junit.Test
class RainbowKotlinTest : LightJavaCodeInsightFixtureTestCase() { class RainbowKotlinTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testRainbowForKotlin() { fun testRainbowForKotlin() {
@Language("kotlin") val code = @Language("kotlin") val code =
""" """
@ -64,6 +67,7 @@ fun <T> filter(l: List<T>, f: (T) -> Boolean): MutableList<T> {
) )
} }
@Test
fun testRainbowArrowForKotlin() { fun testRainbowArrowForKotlin() {
@Language("kotlin") val code = @Language("kotlin") val code =
""" """
@ -125,6 +129,7 @@ val a: (Int) -> Unit = { aa ->
) )
} }
@Test
fun `ForSomeHowTheTestNotPassed "testRainbowLabelForKotlin"`() { fun `ForSomeHowTheTestNotPassed "testRainbowLabelForKotlin"`() {
@Language("kotlin") val code = @Language("kotlin") val code =
""" """
@ -160,6 +165,7 @@ class AA {
) )
} }
@Test
fun testKotlinFunctionLiteralBracesAndArrow() { fun testKotlinFunctionLiteralBracesAndArrow() {
@Language("kotlin") val code = @Language("kotlin") val code =
""" """

View File

@ -4,8 +4,11 @@ import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import com.jetbrains.php.lang.PhpFileType import com.jetbrains.php.lang.PhpFileType
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.junit.Test
class RainbowPHPTest : LightJavaCodeInsightFixtureTestCase() { class RainbowPHPTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testRainbowForPHP() { fun testRainbowForPHP() {
val code = val code =
""" """

View File

@ -6,14 +6,16 @@ import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.jetbrains.plugins.ruby.ruby.lang.RubyFileType import org.jetbrains.plugins.ruby.ruby.lang.RubyFileType
import org.junit.Test
class RainbowRubyTest : LightJavaCodeInsightFixtureTestCase() { class RainbowRubyTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testRubyPluginEnabled() { fun testRubyPluginEnabled() {
assertTrue(PluginManagerCore.getPlugin(PluginId.getId("org.jetbrains.plugins.ruby"))?.isEnabled!!) assertTrue(PluginManagerCore.getPlugin(PluginId.getId("org.jetbrains.plugins.ruby"))?.isEnabled!!)
} }
@Test
fun testRainbowForIssue53Part0() { fun testRainbowForIssue53Part0() {
val code = val code =
""" """
@ -38,6 +40,7 @@ end
) )
} }
@Test
fun testRainbowForIssue53Part1() { fun testRainbowForIssue53Part1() {
val code = val code =
""" """
@ -58,6 +61,7 @@ foobar(p1: "", p2: false, p3: 1)
) )
} }
@Test
fun testRainbowForIssue53Part2() { fun testRainbowForIssue53Part2() {
val code = val code =
""" """
@ -93,6 +97,7 @@ end
) )
} }
@Test
fun testRainbowForIssue53Part3() { fun testRainbowForIssue53Part3() {
val code = val code =
""" """
@ -125,6 +130,7 @@ end
) )
} }
@Test
fun testRainbowForIssue53Part4() { fun testRainbowForIssue53Part4() {
val code = val code =
""" """

View File

@ -6,6 +6,7 @@ import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.jetbrains.plugins.scala.ScalaFileType import org.jetbrains.plugins.scala.ScalaFileType
import org.junit.Test
class RainbowScalaTest : LightJavaCodeInsightFixtureTestCase() { class RainbowScalaTest : LightJavaCodeInsightFixtureTestCase() {
@ -20,6 +21,7 @@ class RainbowScalaTest : LightJavaCodeInsightFixtureTestCase() {
rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = false rainbowSettings.isDoNOTRainbowifyBracketsWithoutContent = false
} }
@Test
fun testRainbowForScala() { fun testRainbowForScala() {
@Language("Scala") val code = @Language("Scala") val code =
""" """
@ -60,6 +62,7 @@ import scala.annotation.tailrec
) )
} }
@Test
fun testDisableRainbowSquareBracketsForScala() { fun testDisableRainbowSquareBracketsForScala() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isEnableRainbowSquareBrackets = false rainbowSettings.isEnableRainbowSquareBrackets = false

View File

@ -6,8 +6,11 @@ import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldBe
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.junit.Test
class RainbowXMLTest : LightJavaCodeInsightFixtureTestCase() { class RainbowXMLTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun `disabled for non-determinist results of testRainbowTagNameForXML`() { fun `disabled for non-determinist results of testRainbowTagNameForXML`() {
@Language("XML") val code = @Language("XML") val code =
""" """
@ -83,6 +86,7 @@ class RainbowXMLTest : LightJavaCodeInsightFixtureTestCase() {
) )
} }
@Test
fun testRainbowForXML() { fun testRainbowForXML() {
@Language("XML") val code = @Language("XML") val code =
""" """

View File

@ -5,9 +5,11 @@ import com.intellij.ide.highlighter.JavaFileType
import com.intellij.psi.PsiDocumentManager import com.intellij.psi.PsiDocumentManager
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
import org.intellij.lang.annotations.Language import org.intellij.lang.annotations.Language
import org.junit.Test
class RandomColorGenTest : LightJavaCodeInsightFixtureTestCase() { class RandomColorGenTest : LightJavaCodeInsightFixtureTestCase() {
@Test
fun testRandomColorGenWorks() { fun testRandomColorGenWorks() {
val rainbowSettings = RainbowSettings.instance val rainbowSettings = RainbowSettings.instance
rainbowSettings.isRainbowEnabled = true rainbowSettings.isRainbowEnabled = true