mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2026-08-15 09:30:01 +02:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58086e40b9
|
||
|
|
b2ceefc5a3
|
||
|
|
5553535a0b
|
||
|
|
197d1845f2
|
||
|
|
9844b9c9bd
|
@@ -4,9 +4,9 @@ This is a fork of the [🌈Rainbow Brackets](https://github.com/izhangzhihao/int
|
||||
|
||||
## Key Changes
|
||||
|
||||
- Updates for new IntelliJ Platform versions
|
||||
- Support for C# (Rider)
|
||||
- Support for C++ (Rider, CLion, CLion Nova)
|
||||
- Support for C++
|
||||
- Support for Settings Sync
|
||||
- Improved highlighting performance
|
||||
- Increased default setting for maximum line count from 1K to 100K
|
||||
- Fixed service initialization warnings reported by 2024.2+
|
||||
|
||||
@@ -19,14 +19,17 @@ dependencies {
|
||||
bundledPlugin("org.jetbrains.plugins.yaml")
|
||||
|
||||
compatiblePlugin("PythonCore")
|
||||
compatiblePlugin("com.intellij.clion")
|
||||
compatiblePlugin("com.intellij.nativeDebug")
|
||||
compatiblePlugin("com.jetbrains.php")
|
||||
compatiblePlugin("com.jetbrains.plugins.jade")
|
||||
compatiblePlugin("com.jetbrains.sh")
|
||||
compatiblePlugin("org.intellij.scala")
|
||||
compatiblePlugin("org.jetbrains.plugins.clion.radler")
|
||||
compatiblePlugin("org.jetbrains.plugins.go-template")
|
||||
compatiblePlugin("org.jetbrains.plugins.ruby")
|
||||
|
||||
plugin("Dart:504.0.0") // https://plugins.jetbrains.com/plugin/6351-dart/versions/stable
|
||||
plugin("Dart:507.0.0") // https://plugins.jetbrains.com/plugin/6351-dart/versions/stable
|
||||
|
||||
testFramework(TestFrameworkType.Platform)
|
||||
testFramework(TestFrameworkType.Plugin.Java)
|
||||
|
||||
+16
-11
@@ -11,12 +11,14 @@ import com.intellij.openapi.application.ReadAction
|
||||
import com.intellij.openapi.editor.Document
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.SoftWrap
|
||||
import com.intellij.openapi.editor.ex.DocumentEx
|
||||
import com.intellij.openapi.editor.ex.EditorEx
|
||||
import com.intellij.openapi.editor.impl.EditorImpl
|
||||
import com.intellij.openapi.editor.impl.view.EditorPainter
|
||||
import com.intellij.openapi.editor.impl.view.VisualLinesIterator
|
||||
import com.intellij.openapi.editor.markup.CustomHighlighterRenderer
|
||||
import com.intellij.openapi.editor.markup.RangeHighlighter
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Condition
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.psi.PsiElement
|
||||
@@ -178,27 +180,30 @@ class RainbowIndentGuideRenderer : CustomHighlighterRenderer {
|
||||
val project = editor.project ?: return null
|
||||
val document = editor.document
|
||||
|
||||
return ReadAction.compute<RainbowInfo, Throwable> {
|
||||
val psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document) ?: return@compute null
|
||||
return ReadAction.computeBlocking<RainbowInfo?, Throwable> {
|
||||
getRainbowInfoInReadAction(project, document, highlighter)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRainbowInfoInReadAction(project: Project, document: DocumentEx, highlighter: RangeHighlighter): RainbowInfo? {
|
||||
val psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document) ?: return null
|
||||
var element = try {
|
||||
psiFile.findElementAt(highlighter.endOffset)?.parent ?: return@compute null
|
||||
psiFile.findElementAt(highlighter.endOffset)?.parent ?: return null
|
||||
} catch (_: Throwable) {
|
||||
return@compute null
|
||||
return null
|
||||
}
|
||||
|
||||
var rainbowInfo = RainbowInfo.RAINBOW_INFO_KEY[element]
|
||||
if (rainbowInfo == null && psiFile is XmlFile && element !is XmlTag) {
|
||||
element = PsiTreeUtil.findFirstParent(element, true, XML_TAG_PARENT_CONDITION) ?: return@compute null
|
||||
rainbowInfo = RainbowInfo.RAINBOW_INFO_KEY[element] ?: return@compute null
|
||||
element = PsiTreeUtil.findFirstParent(element, true, XML_TAG_PARENT_CONDITION) ?: return null
|
||||
rainbowInfo = RainbowInfo.RAINBOW_INFO_KEY[element] ?: return null
|
||||
}
|
||||
|
||||
if (!element.isValid || !checkBoundary(document, element, highlighter)) {
|
||||
null
|
||||
}
|
||||
else {
|
||||
rainbowInfo
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
return rainbowInfo
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -8,16 +8,21 @@
|
||||
<br><br>
|
||||
<b>Key Changes</b>
|
||||
<ul>
|
||||
<li>Updates for new IntelliJ Platform versions</li>
|
||||
<li>Support for C# (Rider)</li>
|
||||
<li>Support for C++ (Rider, CLion, CLion Nova)</li>
|
||||
<li>Support for C++</li>
|
||||
<li>Support for Settings Sync</li>
|
||||
<li>Improved highlighting performance</li>
|
||||
<li>Increased default setting for maximum line count from 1K to 100K</li>
|
||||
<li>Fixed service initialization warnings reported by 2024.2+</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
|
||||
<change-notes><![CDATA[
|
||||
<b>Version 1.5.0</b>
|
||||
<ul>
|
||||
<li>Updated to IntelliJ Platform 2026.2.</li>
|
||||
<li>Added support for C++ plugin for IntelliJ IDEA.</li>
|
||||
</ul>
|
||||
<b>Version 1.4.0</b>
|
||||
<ul>
|
||||
<li>Updated to IntelliJ Platform 2025.3.</li>
|
||||
@@ -48,8 +53,8 @@
|
||||
]]></change-notes>
|
||||
|
||||
<depends>com.intellij.modules.lang</depends>
|
||||
<depends optional="true" config-file="plugin-clion-nova.xml">org.jetbrains.plugins.clion.radler</depends>
|
||||
<depends optional="true" config-file="plugin-clion.xml">com.intellij.modules.clion</depends>
|
||||
<depends optional="true" config-file="plugin-clion-classic.xml">com.intellij.cidr.lang</depends>
|
||||
<depends optional="true" config-file="plugin-cpp.xml">org.jetbrains.plugins.clion.radler</depends>
|
||||
<depends optional="true" config-file="plugin-dart.xml">Dart</depends>
|
||||
<depends optional="true" config-file="plugin-go-template.xml">org.jetbrains.plugins.go-template</depends>
|
||||
<depends optional="true" config-file="plugin-groovy.xml">org.intellij.groovy</depends>
|
||||
@@ -83,6 +88,10 @@
|
||||
<editorNotificationProvider implementation="com.chylex.intellij.coloredbrackets.RainbowifyBanner" />
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="org.jetbrains.kotlin">
|
||||
<supportsKotlinPluginMode supportsK2="true" />
|
||||
</extensions>
|
||||
|
||||
<applicationListeners>
|
||||
<listener class="com.chylex.intellij.coloredbrackets.listener.RainbowColorsSchemeListener" topic="com.intellij.openapi.editor.colors.EditorColorsListener" />
|
||||
</applicationListeners>
|
||||
|
||||
+9
-3
@@ -6,9 +6,9 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.chylex.intellij.coloredbrackets"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
|
||||
val ideaVersion = "2025.3"
|
||||
val ideaVersion = "2026.2"
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||
@@ -31,10 +31,16 @@ allprojects {
|
||||
|
||||
pluginConfiguration {
|
||||
ideaVersion {
|
||||
sinceBuild.set("253")
|
||||
sinceBuild.set("262")
|
||||
untilBuild.set(provider { null })
|
||||
}
|
||||
}
|
||||
|
||||
pluginVerification {
|
||||
ides {
|
||||
current()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
@@ -3,12 +3,9 @@ val ideaVersion: String by project
|
||||
dependencies {
|
||||
implementation(project(":base"))
|
||||
|
||||
runtimeOnly(project(":rider")) // Support for CLion Nova.
|
||||
|
||||
intellijPlatform {
|
||||
clion(ideaVersion)
|
||||
|
||||
bundledPlugin("com.intellij.clion")
|
||||
bundledPlugin("org.jetbrains.plugins.clion.radler")
|
||||
compatiblePlugin("com.intellij.cidr.lang")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ dependencies {
|
||||
useInstaller = false
|
||||
}
|
||||
|
||||
bundledModule("intellij.rider.cpp.core.languages")
|
||||
bundledModule("intellij.rider.languages")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="com.chylex.coloredbrackets">
|
||||
<bracePairProvider language="C++"
|
||||
implementationClass="com.chylex.intellij.coloredbrackets.provider.CppBracePairProvider" />
|
||||
<bracePairProvider language="C#"
|
||||
implementationClass="com.chylex.intellij.coloredbrackets.provider.CSharpBracePairProvider" />
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<highlightVisitor implementation="com.chylex.intellij.coloredbrackets.visitor.CppRainbowVisitor" />
|
||||
<highlightVisitor implementation="com.chylex.intellij.coloredbrackets.visitor.CSharpRainbowVisitor" />
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ rootProject.name = "ColoredBrackets"
|
||||
|
||||
pluginManagement {
|
||||
plugins {
|
||||
kotlin("jvm") version "2.2.20"
|
||||
kotlin("jvm") version "2.4.10"
|
||||
id("org.jetbrains.intellij.platform") version "2.18.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user