mirror of
https://github.com/chylex/IntelliJ-Rainbow-Brackets.git
synced 2026-06-15 00:16:30 +02:00
Compare commits
4 Commits
6628c25dd6
...
493f97d4d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
493f97d4d6
|
|||
|
922af136ed
|
|||
|
f176b864d4
|
|||
|
0ebfe4f7d5
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,5 +2,6 @@
|
|||||||
!/.idea/runConfigurations
|
!/.idea/runConfigurations
|
||||||
|
|
||||||
/.gradle/
|
/.gradle/
|
||||||
|
/.kotlin/
|
||||||
/.intellijPlatform/
|
/.intellijPlatform/
|
||||||
/build/
|
/build/
|
||||||
|
|||||||
5
.idea/runConfigurations/Run_CLion.xml
generated
5
.idea/runConfigurations/Run_CLion.xml
generated
@@ -17,8 +17,11 @@
|
|||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
5
.idea/runConfigurations/Run_IDEA.xml
generated
5
.idea/runConfigurations/Run_IDEA.xml
generated
@@ -10,15 +10,18 @@
|
|||||||
</option>
|
</option>
|
||||||
<option name="taskNames">
|
<option name="taskNames">
|
||||||
<list>
|
<list>
|
||||||
<option value=":runIde" />
|
<option value=":base:runIde" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
<option name="vmOptions" />
|
<option name="vmOptions" />
|
||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
5
.idea/runConfigurations/Run_Rider.xml
generated
5
.idea/runConfigurations/Run_Rider.xml
generated
@@ -17,8 +17,11 @@
|
|||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
val ideaVersion: String by project
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
intellijPlatform {
|
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
intellijIdeaUltimate(ideaVersion)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
45
base/build.gradle.kts
Normal file
45
base/build.gradle.kts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
|
||||||
|
import org.jetbrains.intellij.platform.gradle.extensions.excludeCoroutines
|
||||||
|
import org.jetbrains.intellij.platform.gradle.extensions.excludeKotlinStdlib
|
||||||
|
|
||||||
|
val ideaVersion: String by project
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
intellijPlatform {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
intellijIdeaUltimate(ideaVersion)
|
||||||
|
|
||||||
|
bundledPlugin("JavaScript")
|
||||||
|
bundledPlugin("com.intellij.css")
|
||||||
|
bundledPlugin("com.intellij.database")
|
||||||
|
bundledPlugin("com.intellij.java")
|
||||||
|
bundledPlugin("org.intellij.groovy")
|
||||||
|
bundledPlugin("org.intellij.plugins.markdown")
|
||||||
|
bundledPlugin("org.jetbrains.kotlin")
|
||||||
|
bundledPlugin("org.jetbrains.plugins.yaml")
|
||||||
|
|
||||||
|
compatiblePlugin("PythonCore")
|
||||||
|
compatiblePlugin("com.jetbrains.php")
|
||||||
|
compatiblePlugin("com.jetbrains.plugins.jade")
|
||||||
|
compatiblePlugin("com.jetbrains.sh")
|
||||||
|
compatiblePlugin("org.intellij.scala")
|
||||||
|
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
|
||||||
|
|
||||||
|
testFramework(TestFrameworkType.Platform)
|
||||||
|
testFramework(TestFrameworkType.Plugin.Java)
|
||||||
|
testFramework(TestFrameworkType.Plugin.JavaScript)
|
||||||
|
}
|
||||||
|
|
||||||
|
testImplementation("junit:junit:4.13.2")
|
||||||
|
testImplementation("io.kotest:kotest-assertions-core:5.8.0") {
|
||||||
|
excludeKotlinStdlib()
|
||||||
|
excludeCoroutines()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
intellijPlatform {
|
||||||
|
buildSearchableOptions = true
|
||||||
|
}
|
||||||
@@ -22,32 +22,29 @@ void main() {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
angleLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
squigglyLevel(0),
|
||||||
roundLevel(0),
|
angleLevel(0),
|
||||||
roundLevel(0),
|
angleLevel(0),
|
||||||
squigglyLevel(0),
|
squareLevel(0),
|
||||||
angleLevel(0),
|
squareLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
squareLevel(0),
|
roundLevel(0),
|
||||||
squareLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,39 +22,36 @@ Map<String, Map<String, String>> convertObjectsToMapProperties(Map<String, Objec
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(1),
|
||||||
arrayOf(
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),
|
roundLevel(0),
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
|
angleLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),
|
squigglyLevel(0),
|
||||||
roundLevel(0),
|
squigglyLevel(1),
|
||||||
|
angleLevel(0),
|
||||||
squigglyLevel(0),
|
angleLevel(0),
|
||||||
squigglyLevel(1),
|
|
||||||
angleLevel(0),
|
squareLevel(0),
|
||||||
angleLevel(0),
|
|
||||||
|
squareLevel(0),
|
||||||
squareLevel(0),
|
|
||||||
|
squigglyLevel(1),
|
||||||
squareLevel(0),
|
|
||||||
|
angleLevel(0),
|
||||||
squigglyLevel(1),
|
angleLevel(1),
|
||||||
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),
|
squigglyLevel(0)
|
||||||
angleLevel(0),
|
|
||||||
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.chylex.intellij.coloredbrackets
|
package com.chylex.intellij.coloredbrackets
|
||||||
|
|
||||||
import com.intellij.ide.plugins.PluginManagerCore
|
import com.intellij.ide.plugins.PluginManagerCore
|
||||||
import com.intellij.lang.ecmascript6.JSXHarmonyFileType
|
import com.intellij.lang.javascript.JSXFileType
|
||||||
import com.intellij.lang.javascript.JavaScriptFileType
|
import com.intellij.lang.javascript.JavaScriptFileType
|
||||||
import com.intellij.lang.javascript.TypeScriptFileType
|
import com.intellij.lang.javascript.TypeScriptFileType
|
||||||
import com.intellij.openapi.extensions.PluginId
|
import com.intellij.openapi.extensions.PluginId
|
||||||
@@ -24,21 +24,18 @@ const _ = require('lodash') || false
|
|||||||
const moment = require('moment')
|
const moment = require('moment')
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
myFixture.configureByText(JavaScriptFileType.INSTANCE, code)
|
myFixture.configureByText(JavaScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0),
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testIssue12() {
|
fun testIssue12() {
|
||||||
@@ -47,42 +44,36 @@ const moment = require('moment')
|
|||||||
console.log(a > b)
|
console.log(a > b)
|
||||||
console.log(a == b)
|
console.log(a == b)
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
myFixture.configureByText(JavaScriptFileType.INSTANCE, code)
|
myFixture.configureByText(JavaScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0),
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testIssue21() {
|
fun testIssue21() {
|
||||||
|
|
||||||
@Language("JavaScript") val code = "open (\$" + "{f})\n" + "open (\$" + "{f} )"
|
@Language("JavaScript") val code = "open (\$" + "{f})\n" + "open (\$" + "{f} )"
|
||||||
|
|
||||||
myFixture.configureByText(JavaScriptFileType.INSTANCE, code)
|
myFixture.configureByText(JavaScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0),
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testIssue23() {
|
fun testIssue23() {
|
||||||
@@ -102,33 +93,30 @@ if ((a.field_detail && a.is) ||
|
|||||||
|
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
myFixture.configureByText(JavaScriptFileType.INSTANCE, code)
|
myFixture.configureByText(JavaScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(1),
|
||||||
arrayOf(
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(0)
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testIssue38() {
|
fun testIssue38() {
|
||||||
@@ -136,30 +124,26 @@ if ((a.field_detail && a.is) ||
|
|||||||
const element = ( <div> <h1>Hello, world!</h1> </div> );
|
const element = ( <div> <h1>Hello, world!</h1> </div> );
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
myFixture.configureByText(JSXHarmonyFileType.INSTANCE, code)
|
myFixture.configureByText(JSXFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.filterNot { it == null }
|
roundLevel(0),
|
||||||
.toTypedArray()
|
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
angleLevel(0),
|
||||||
roundLevel(0),
|
angleLevel(1),
|
||||||
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(1),
|
||||||
angleLevel(1),
|
angleLevel(0),
|
||||||
angleLevel(1),
|
angleLevel(0),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),
|
roundLevel(0)
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),
|
|
||||||
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun `for somehow, it just don't work "testIssue39"`() {
|
fun `for somehow, it just don't work "testIssue39"`() {
|
||||||
@@ -167,30 +151,26 @@ const element = ( <div> <h1>Hello, world!</h1> </div> );
|
|||||||
const html = '<div><div><div>Hello</div></div></div>'
|
const html = '<div><div><div>Hello</div></div></div>'
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
myFixture.configureByText(JavaScriptFileType.INSTANCE, code)
|
myFixture.configureByText(JavaScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.filterNot { it == null }
|
angleLevel(0),
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(1),
|
||||||
arrayOf(
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(2),
|
||||||
angleLevel(0),
|
angleLevel(2),
|
||||||
angleLevel(1),
|
angleLevel(2),
|
||||||
angleLevel(1),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(1),
|
||||||
angleLevel(2),
|
angleLevel(1),
|
||||||
angleLevel(2),
|
angleLevel(0),
|
||||||
angleLevel(2),
|
angleLevel(0)
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testIssue31() {
|
fun testIssue31() {
|
||||||
@@ -201,47 +181,39 @@ const element = ( <div> <h1>Hello, world!</h1> </div> );
|
|||||||
const s = `<ololo>`
|
const s = `<ololo>`
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
myFixture.configureByText(TypeScriptFileType.INSTANCE, code)
|
myFixture.configureByText(TypeScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.filterNot { it == null }
|
roundLevel(0),
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
squigglyLevel(0),
|
||||||
arrayOf(
|
squigglyLevel(0),
|
||||||
roundLevel(0),
|
squareLevel(0),
|
||||||
roundLevel(0),
|
squareLevel(0),
|
||||||
squigglyLevel(0),
|
angleLevel(0),
|
||||||
squigglyLevel(0),
|
angleLevel(0)
|
||||||
squareLevel(0),
|
|
||||||
squareLevel(0)
|
|
||||||
//, angleLevel(0)
|
|
||||||
//, angleLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
||||||
|
|
||||||
myFixture.configureByText(TypeScriptFileType.INSTANCE, code)
|
myFixture.configureByText(TypeScriptFileType, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.filterNot { it == null }
|
angleLevel(0),
|
||||||
.toTypedArray()
|
angleLevel(1),
|
||||||
.shouldBe(
|
angleLevel(1),
|
||||||
arrayOf(
|
angleLevel(0)
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,29 +35,26 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
squigglyLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(0),
|
squigglyLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(1),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(2),
|
||||||
roundLevel(0),
|
roundLevel(2),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(2),
|
roundLevel(0),
|
||||||
roundLevel(2),
|
squigglyLevel(1),
|
||||||
roundLevel(1),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDisableRainbowForJava() {
|
fun testDisableRainbowForJava() {
|
||||||
@@ -75,12 +72,9 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf()
|
||||||
.toTypedArray()
|
)
|
||||||
.shouldBe(
|
|
||||||
arrayOf()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDisableRainbowAngleBracketsForJava() {
|
fun testDisableRainbowAngleBracketsForJava() {
|
||||||
@@ -98,27 +92,24 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
squigglyLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0),
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
squigglyLevel(0),
|
squigglyLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(1),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(2),
|
||||||
roundLevel(0),
|
roundLevel(2),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(2),
|
roundLevel(0),
|
||||||
roundLevel(2),
|
squigglyLevel(1),
|
||||||
roundLevel(1),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDisableRainbowRoundBracketsForJava() {
|
fun testDisableRainbowRoundBracketsForJava() {
|
||||||
@@ -136,19 +127,16 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
squigglyLevel(0),
|
||||||
angleLevel(0),
|
squigglyLevel(1),
|
||||||
angleLevel(0),
|
squigglyLevel(1),
|
||||||
squigglyLevel(0),
|
squigglyLevel(0)
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDisableRainbowSquigglyBracketsForJava() {
|
fun testDisableRainbowSquigglyBracketsForJava() {
|
||||||
@@ -166,25 +154,22 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(2),
|
||||||
roundLevel(0),
|
roundLevel(2),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(2),
|
roundLevel(0)
|
||||||
roundLevel(2),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDoNOTRainbowifyBracketsWithoutContentForJava() {
|
fun testDoNOTRainbowifyBracketsWithoutContentForJava() {
|
||||||
@@ -202,25 +187,22 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
squigglyLevel(0),
|
||||||
angleLevel(0),
|
squigglyLevel(1),
|
||||||
angleLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(1),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(1),
|
squigglyLevel(1),
|
||||||
roundLevel(1),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDoNOTRainbowifyBracketsWhenJavaInBlacklist() {
|
fun testDoNOTRainbowifyBracketsWhenJavaInBlacklist() {
|
||||||
@@ -239,11 +221,7 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().size.shouldBe(0)
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
|
||||||
.toTypedArray()
|
|
||||||
.size
|
|
||||||
.shouldBe(0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testIssue391() {
|
fun testIssue391() {
|
||||||
@@ -262,31 +240,28 @@ public class Test {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),//{
|
||||||
.shouldBe(
|
|
||||||
arrayOf(
|
roundLevel(1),//(
|
||||||
roundLevel(0),//{
|
roundLevel(1),//)
|
||||||
|
|
||||||
roundLevel(1),//(
|
roundLevel(1),//{
|
||||||
roundLevel(1),//)
|
|
||||||
|
roundLevel(2),
|
||||||
roundLevel(1),//{
|
roundLevel(2),
|
||||||
|
roundLevel(2),
|
||||||
roundLevel(2),
|
roundLevel(3),
|
||||||
roundLevel(2),
|
roundLevel(4),
|
||||||
roundLevel(2),
|
roundLevel(4),
|
||||||
roundLevel(3),
|
roundLevel(3),
|
||||||
roundLevel(4),
|
roundLevel(2),
|
||||||
roundLevel(4),
|
|
||||||
roundLevel(3),
|
roundLevel(1),//}
|
||||||
roundLevel(2),
|
|
||||||
|
roundLevel(0)//}
|
||||||
roundLevel(1),//}
|
|
||||||
|
|
||||||
roundLevel(0)//}
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,47 +20,44 @@ fun <T> filter(l: List<T>, f: (T) -> Boolean): MutableList<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),
|
|
||||||
|
|
||||||
roundLevel(0),
|
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(0),
|
|
||||||
|
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),
|
|
||||||
|
|
||||||
squigglyLevel(0),
|
|
||||||
|
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),
|
|
||||||
|
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(1),
|
|
||||||
|
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(0),
|
|
||||||
|
|
||||||
squigglyLevel(2),
|
|
||||||
squigglyLevel(2),
|
|
||||||
|
|
||||||
squigglyLevel(1),
|
|
||||||
|
|
||||||
squigglyLevel(0)
|
|
||||||
|
|
||||||
)
|
roundLevel(0),
|
||||||
|
angleLevel(0),
|
||||||
|
angleLevel(0),
|
||||||
|
roundLevel(1),
|
||||||
|
roundLevel(1),
|
||||||
|
roundLevel(0),
|
||||||
|
|
||||||
|
angleLevel(0),
|
||||||
|
angleLevel(0),
|
||||||
|
|
||||||
|
squigglyLevel(0),
|
||||||
|
|
||||||
|
angleLevel(0),
|
||||||
|
angleLevel(0),
|
||||||
|
|
||||||
|
roundLevel(0),
|
||||||
|
roundLevel(0),
|
||||||
|
squigglyLevel(1),
|
||||||
|
|
||||||
|
roundLevel(0),
|
||||||
|
roundLevel(1),
|
||||||
|
roundLevel(1),
|
||||||
|
roundLevel(0),
|
||||||
|
|
||||||
|
squigglyLevel(2),
|
||||||
|
squigglyLevel(2),
|
||||||
|
|
||||||
|
squigglyLevel(1),
|
||||||
|
|
||||||
|
squigglyLevel(0)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRainbowArrowForKotlin() {
|
fun testRainbowArrowForKotlin() {
|
||||||
@@ -68,7 +65,7 @@ fun <T> filter(l: List<T>, f: (T) -> Boolean): MutableList<T> {
|
|||||||
"""
|
"""
|
||||||
val a: (Int) -> Unit = { aa ->
|
val a: (Int) -> Unit = { aa ->
|
||||||
val b: (Int) -> Unit = { bb ->
|
val b: (Int) -> Unit = { bb ->
|
||||||
val c: (Int) -> Unit = { cc ->
|
val c: (Int) -> Unit = { cc ->
|
||||||
val d: (Int) -> Unit = { dd ->
|
val d: (Int) -> Unit = { dd ->
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,46 +76,33 @@ val a: (Int) -> Unit = { aa ->
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { brackets.contains(it.text.toChar()) || it.text.contains("->") }
|
arrayOf(
|
||||||
.filter { it?.forcedTextAttributesKey?.defaultAttributes != null }
|
roundLevel(0),
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
roundLevel(0),
|
||||||
.toTypedArray()
|
squigglyLevel(0),
|
||||||
.shouldBe(
|
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
roundLevel(0),
|
squigglyLevel(1),
|
||||||
|
|
||||||
squigglyLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(0),
|
roundLevel(0),
|
||||||
|
squigglyLevel(2),
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
|
roundLevel(0),
|
||||||
squigglyLevel(1),
|
squigglyLevel(3),
|
||||||
squigglyLevel(1),
|
|
||||||
|
squigglyLevel(3),
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
squigglyLevel(2),
|
||||||
|
|
||||||
squigglyLevel(2),
|
squigglyLevel(1),
|
||||||
squigglyLevel(2),
|
|
||||||
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
|
|
||||||
squigglyLevel(3),
|
|
||||||
squigglyLevel(3),
|
|
||||||
|
|
||||||
squigglyLevel(3),
|
|
||||||
|
|
||||||
squigglyLevel(2),
|
|
||||||
|
|
||||||
squigglyLevel(1),
|
|
||||||
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun `ForSomeHowTheTestNotPassed "testRainbowLabelForKotlin"`() {
|
fun `ForSomeHowTheTestNotPassed "testRainbowLabelForKotlin"`() {
|
||||||
@@ -142,18 +126,14 @@ class AA {
|
|||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
|
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { it.forcedTextAttributes != null && it.text.contains("@") }
|
arrayOf(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
squigglyLevel(3),
|
||||||
.toTypedArray()
|
squigglyLevel(4),
|
||||||
.shouldBe(
|
squigglyLevel(3),
|
||||||
arrayOf(
|
squigglyLevel(2)
|
||||||
squigglyLevel(3),
|
|
||||||
squigglyLevel(4),
|
|
||||||
squigglyLevel(3),
|
|
||||||
squigglyLevel(2)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testKotlinFunctionLiteralBracesAndArrow() {
|
fun testKotlinFunctionLiteralBracesAndArrow() {
|
||||||
@@ -171,20 +151,15 @@ fun t() {
|
|||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
|
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { brackets.contains(it.text.toChar()) }
|
arrayOf(
|
||||||
.filter { it?.forcedTextAttributesKey?.defaultAttributes != null }
|
roundLevel(0),
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
roundLevel(0),
|
||||||
.toTypedArray()
|
squigglyLevel(0),
|
||||||
.shouldBe(
|
squigglyLevel(1),
|
||||||
arrayOf(
|
squigglyLevel(1),
|
||||||
roundLevel(0),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(0),
|
|
||||||
//squigglyLevel(1),
|
|
||||||
//squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.chylex.intellij.coloredbrackets
|
package com.chylex.intellij.coloredbrackets
|
||||||
|
|
||||||
import com.intellij.codeInsight.daemon.impl.HighlightInfoType
|
|
||||||
import com.intellij.psi.PsiDocumentManager
|
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
|
||||||
@@ -28,29 +27,26 @@ function padZero(string data): string
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) && it.severity != HighlightInfoType.INJECTED_FRAGMENT_SEVERITY }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0),
|
||||||
arrayOf(
|
|
||||||
roundLevel(0),
|
squigglyLevel(0),
|
||||||
roundLevel(0),
|
|
||||||
|
roundLevel(1),
|
||||||
squigglyLevel(0),
|
roundLevel(1),
|
||||||
|
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(1),
|
||||||
|
|
||||||
roundLevel(1),
|
squigglyLevel(1),
|
||||||
roundLevel(1),
|
roundLevel(2),
|
||||||
|
roundLevel(2),
|
||||||
squigglyLevel(1),
|
squigglyLevel(1),
|
||||||
roundLevel(2),
|
|
||||||
roundLevel(2),
|
squigglyLevel(0)
|
||||||
squigglyLevel(1),
|
|
||||||
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,18 +23,15 @@ end
|
|||||||
myFixture.configureByText(RubyFileType.RUBY, code)
|
myFixture.configureByText(RubyFileType.RUBY, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty());
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(1),
|
||||||
arrayOf(
|
roundLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(0)
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(1),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRainbowForIssue53Part1() {
|
fun testRainbowForIssue53Part1() {
|
||||||
@@ -45,16 +42,13 @@ foobar(p1: "", p2: false, p3: 1)
|
|||||||
myFixture.configureByText(RubyFileType.RUBY, code)
|
myFixture.configureByText(RubyFileType.RUBY, code)
|
||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty());
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0)
|
||||||
arrayOf(
|
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRainbowForIssue53Part2() {
|
fun testRainbowForIssue53Part2() {
|
||||||
@@ -71,25 +65,20 @@ end
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { brackets.contains(it.text.toChar()) }
|
arrayOf(
|
||||||
.filterNot { it?.forcedTextAttributesKey?.defaultAttributes == null }
|
roundLevel(0),
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
squigglyLevel(0),
|
||||||
.toTypedArray()
|
squigglyLevel(1),
|
||||||
.shouldBe(
|
squigglyLevel(1),
|
||||||
arrayOf(
|
squigglyLevel(1),
|
||||||
roundLevel(0),
|
squigglyLevel(1),
|
||||||
squigglyLevel(0),
|
squigglyLevel(0),
|
||||||
squigglyLevel(1),
|
roundLevel(0),
|
||||||
squigglyLevel(1),
|
squigglyLevel(0),
|
||||||
squigglyLevel(1),
|
squigglyLevel(0)
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(0),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRainbowForIssue53Part3() {
|
fun testRainbowForIssue53Part3() {
|
||||||
@@ -109,19 +98,14 @@ end
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { brackets.contains(it.text.toChar()) }
|
arrayOf(
|
||||||
.filterNot { it?.forcedTextAttributesKey?.defaultAttributes == null }
|
squareLevel(0),
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
squareLevel(0),
|
||||||
.toTypedArray()
|
squareLevel(0),
|
||||||
.shouldBe(
|
squareLevel(0)
|
||||||
arrayOf(
|
|
||||||
squareLevel(0),
|
|
||||||
squareLevel(0),
|
|
||||||
squareLevel(0),
|
|
||||||
squareLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRainbowForIssue53Part4() {
|
fun testRainbowForIssue53Part4() {
|
||||||
@@ -135,20 +119,15 @@ end
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { brackets.contains(it.text.toChar()) }
|
arrayOf(
|
||||||
.filterNot { it?.forcedTextAttributesKey?.defaultAttributes == null }
|
squareLevel(0),
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
squareLevel(1),
|
||||||
.toTypedArray()
|
squareLevel(2),
|
||||||
.shouldBe(
|
squareLevel(2),
|
||||||
arrayOf(
|
squareLevel(1),
|
||||||
squareLevel(0),
|
squareLevel(0)
|
||||||
squareLevel(1),
|
|
||||||
squareLevel(2),
|
|
||||||
squareLevel(2),
|
|
||||||
squareLevel(1),
|
|
||||||
squareLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,9 @@ 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.Ignore
|
||||||
|
|
||||||
|
@Ignore("IDEA has broken modularization")
|
||||||
class RainbowScalaTest : LightJavaCodeInsightFixtureTestCase() {
|
class RainbowScalaTest : LightJavaCodeInsightFixtureTestCase() {
|
||||||
|
|
||||||
override fun tearDown() {
|
override fun tearDown() {
|
||||||
@@ -36,28 +38,24 @@ import scala.annotation.tailrec
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { it?.forcedTextAttributesKey != null }
|
arrayOf(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
squareLevel(0),
|
||||||
.toTypedArray()
|
squareLevel(0),
|
||||||
.shouldBe(
|
|
||||||
arrayOf(
|
roundLevel(0),
|
||||||
squareLevel(0),
|
roundLevel(0),
|
||||||
squareLevel(0),
|
|
||||||
|
squigglyLevel(0),
|
||||||
roundLevel(0),
|
squigglyLevel(1),
|
||||||
roundLevel(0),
|
squareLevel(0),
|
||||||
|
squareLevel(0),
|
||||||
squigglyLevel(0),
|
roundLevel(0),
|
||||||
squigglyLevel(1),
|
roundLevel(0),
|
||||||
squareLevel(0),
|
squigglyLevel(1),
|
||||||
squareLevel(0),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDisableRainbowSquareBracketsForScala() {
|
fun testDisableRainbowSquareBracketsForScala() {
|
||||||
@@ -78,23 +76,19 @@ import scala.annotation.tailrec
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.filter { it?.forcedTextAttributesKey != null }
|
arrayOf(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
|
||||||
.toTypedArray()
|
roundLevel(0),
|
||||||
.shouldBe(
|
roundLevel(0),
|
||||||
arrayOf(
|
|
||||||
|
squigglyLevel(0),
|
||||||
roundLevel(0),
|
squigglyLevel(1),
|
||||||
roundLevel(0),
|
roundLevel(0),
|
||||||
|
roundLevel(0),
|
||||||
squigglyLevel(0),
|
squigglyLevel(1),
|
||||||
squigglyLevel(1),
|
squigglyLevel(0)
|
||||||
roundLevel(0),
|
|
||||||
roundLevel(0),
|
|
||||||
squigglyLevel(1),
|
|
||||||
squigglyLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,59 +28,56 @@ class RainbowXMLTest : LightJavaCodeInsightFixtureTestCase() {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
|
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
angleLevel(0),
|
angleLevel(0),//idea-plugin
|
||||||
|
angleLevel(0),
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),//idea-plugin
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(1),//name
|
||||||
|
angleLevel(1),
|
||||||
angleLevel(1),
|
angleLevel(1),
|
||||||
angleLevel(1),//name
|
angleLevel(1),//name
|
||||||
angleLevel(1),
|
angleLevel(1),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),//name
|
angleLevel(1),
|
||||||
angleLevel(1),
|
angleLevel(1),//description
|
||||||
|
angleLevel(1),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),//description
|
angleLevel(2),
|
||||||
angleLevel(1),
|
angleLevel(2),//p
|
||||||
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),//p
|
angleLevel(2),//p
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
|
||||||
angleLevel(2),//p
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),//p
|
||||||
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),//p
|
angleLevel(2),//p
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
|
||||||
angleLevel(2),//p
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),//br
|
||||||
|
angleLevel(2),
|
||||||
angleLevel(2),
|
|
||||||
angleLevel(2),//br
|
angleLevel(1),
|
||||||
angleLevel(2),
|
angleLevel(1),//description
|
||||||
|
angleLevel(1),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),//description
|
angleLevel(0),
|
||||||
angleLevel(1),
|
angleLevel(0),//idea-plugin
|
||||||
|
angleLevel(0)
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0),//idea-plugin
|
|
||||||
angleLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testRainbowForXML() {
|
fun testRainbowForXML() {
|
||||||
@@ -103,47 +100,44 @@ class RainbowXMLTest : LightJavaCodeInsightFixtureTestCase() {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
doHighlighting
|
doHighlighting.getBrackets().shouldBe(
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
arrayOf(
|
||||||
.toTypedArray()
|
angleLevel(0),
|
||||||
.shouldBe(
|
angleLevel(0),
|
||||||
arrayOf(
|
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
|
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
angleLevel(0),
|
angleLevel(0),
|
||||||
|
|
||||||
angleLevel(0),
|
angleLevel(1),
|
||||||
angleLevel(0),
|
angleLevel(1),
|
||||||
|
angleLevel(1),
|
||||||
angleLevel(1),
|
angleLevel(1),
|
||||||
angleLevel(1),
|
|
||||||
angleLevel(1),
|
angleLevel(1),
|
||||||
angleLevel(1),
|
angleLevel(1),
|
||||||
|
|
||||||
angleLevel(1),
|
angleLevel(2),
|
||||||
angleLevel(1),
|
angleLevel(2),
|
||||||
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
angleLevel(2),
|
angleLevel(2),
|
||||||
|
|
||||||
angleLevel(2),
|
angleLevel(1),
|
||||||
angleLevel(2),
|
angleLevel(1),
|
||||||
|
|
||||||
angleLevel(1),
|
angleLevel(0),
|
||||||
angleLevel(1),
|
angleLevel(0)
|
||||||
|
|
||||||
angleLevel(0),
|
|
||||||
angleLevel(0)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,11 +25,7 @@ public class Test<T> {
|
|||||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||||
val doHighlighting = myFixture.doHighlighting()
|
val doHighlighting = myFixture.doHighlighting()
|
||||||
assertFalse(doHighlighting.isEmpty())
|
assertFalse(doHighlighting.isEmpty())
|
||||||
val highlightSize = doHighlighting.filter { brackets.contains(it.text.toChar()) }
|
val highlightSize = doHighlighting.getBrackets().size
|
||||||
.filter { it.forcedTextAttributesKey.defaultAttributes.foregroundColor != null }
|
|
||||||
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
|
||||||
.toTypedArray()
|
|
||||||
.size
|
|
||||||
assert(highlightSize == 16)
|
assert(highlightSize == 16)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,8 +1,15 @@
|
|||||||
package com.chylex.intellij.coloredbrackets
|
package com.chylex.intellij.coloredbrackets
|
||||||
|
|
||||||
val brackets = RainbowHighlighter.getBrackets()
|
import com.chylex.intellij.coloredbrackets.visitor.RainbowHighlightVisitor
|
||||||
|
import com.intellij.codeInsight.daemon.impl.HighlightInfo
|
||||||
|
import java.awt.Color
|
||||||
|
|
||||||
fun CharSequence.toChar() = elementAt(0)
|
fun List<HighlightInfo>.getBrackets(): Array<Color> {
|
||||||
|
return this
|
||||||
|
.filter { it.toolId?.let { id -> id is Class<*> && RainbowHighlightVisitor::class.java.isAssignableFrom(id) } == true }
|
||||||
|
.map { it.forcedTextAttributesKey.defaultAttributes.foregroundColor }
|
||||||
|
.toTypedArray()
|
||||||
|
}
|
||||||
|
|
||||||
fun roundLevel(level: Int) = RainbowHighlighter.getRainbowColor(RainbowHighlighter.NAME_ROUND_BRACKETS, level)
|
fun roundLevel(level: Int) = RainbowHighlighter.getRainbowColor(RainbowHighlighter.NAME_ROUND_BRACKETS, level)
|
||||||
|
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
@file:Suppress("ConvertLambdaToReference")
|
@file:Suppress("ConvertLambdaToReference")
|
||||||
|
|
||||||
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
id("org.jetbrains.intellij.platform")
|
id("org.jetbrains.intellij.platform")
|
||||||
@@ -10,7 +8,7 @@ plugins {
|
|||||||
group = "com.chylex.intellij.coloredbrackets"
|
group = "com.chylex.intellij.coloredbrackets"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
|
|
||||||
val ideaVersion = "2023.3"
|
val ideaVersion = "2025.3"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||||
@@ -29,9 +27,13 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
|
sandboxContainer.set(layout.buildDirectory.map { it.dir("idea-sandbox") })
|
||||||
|
|
||||||
|
buildSearchableOptions = false
|
||||||
|
|
||||||
pluginConfiguration {
|
pluginConfiguration {
|
||||||
ideaVersion {
|
ideaVersion {
|
||||||
sinceBuild.set("233")
|
sinceBuild.set("253")
|
||||||
untilBuild.set(provider { null })
|
untilBuild.set(provider { null })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,54 +50,23 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
|
||||||
intellijPlatform {
|
|
||||||
buildSearchableOptions = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
idea {
|
idea {
|
||||||
module {
|
module {
|
||||||
|
excludeDirs.add(file(".kotlin"))
|
||||||
excludeDirs.add(file("build"))
|
excludeDirs.add(file("build"))
|
||||||
excludeDirs.add(file("gradle"))
|
excludeDirs.add(file("gradle"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
project(":api")
|
|
||||||
|
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
intellijIdeaUltimate(ideaVersion)
|
intellijIdeaUltimate(ideaVersion)
|
||||||
|
|
||||||
bundledPlugin("JavaScript")
|
pluginComposedModule(implementation(project(":base")))
|
||||||
bundledPlugin("com.intellij.css")
|
|
||||||
bundledPlugin("com.intellij.database")
|
|
||||||
bundledPlugin("com.intellij.java")
|
|
||||||
bundledPlugin("org.intellij.groovy")
|
|
||||||
bundledPlugin("org.intellij.plugins.markdown")
|
|
||||||
bundledPlugin("org.jetbrains.kotlin")
|
|
||||||
bundledPlugin("org.jetbrains.plugins.yaml")
|
|
||||||
|
|
||||||
plugin("Dart", "233.11799.172") // https://plugins.jetbrains.com/plugin/6351-dart/versions/stable
|
|
||||||
plugin("PythonCore", "233.11799.300") // https://plugins.jetbrains.com/plugin/631-python/versions
|
|
||||||
plugin("com.jetbrains.php", "233.11799.300") // https://plugins.jetbrains.com/plugin/6610-php/versions
|
|
||||||
plugin("com.jetbrains.sh", "233.11799.165") // https://plugins.jetbrains.com/plugin/13122-shell-script/versions
|
|
||||||
plugin("org.intellij.scala", "2023.3.19") // https://plugins.jetbrains.com/plugin/1347-scala/versions
|
|
||||||
plugin("org.jetbrains.plugins.go-template", "233.11799.172") // https://plugins.jetbrains.com/plugin/10581-go-template/versions
|
|
||||||
plugin("org.jetbrains.plugins.ruby", "233.11799.300") // https://plugins.jetbrains.com/plugin/1293-ruby/versions
|
|
||||||
|
|
||||||
testFramework(TestFrameworkType.Plugin.Java)
|
|
||||||
|
|
||||||
pluginComposedModule(implementation(project(":api")))
|
|
||||||
pluginComposedModule(implementation(project(":clion")))
|
pluginComposedModule(implementation(project(":clion")))
|
||||||
pluginComposedModule(implementation(project(":rider")))
|
pluginComposedModule(implementation(project(":rider")))
|
||||||
}
|
}
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
|
||||||
testImplementation("io.kotest:kotest-assertions-core:5.8.0") {
|
|
||||||
exclude(group = "org.jetbrains.kotlin")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
val ideaVersion: String by project
|
val ideaVersion: String by project
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(":api"))
|
implementation(project(":base"))
|
||||||
|
|
||||||
|
runtimeOnly(project(":rider")) // Support for CLion Nova.
|
||||||
|
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
clion(ideaVersion)
|
clion(ideaVersion)
|
||||||
|
|
||||||
bundledPlugin("com.intellij.clion")
|
bundledPlugin("com.intellij.clion")
|
||||||
// bundledPlugin("org.jetbrains.plugins.clion.radler") // Only in 2024.1 or newer. Worked around by only including the .xml file, and taking the implementation from Rider.
|
bundledPlugin("org.jetbrains.plugins.clion.radler")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,7 +1,9 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
retries=0
|
||||||
|
retryBackOffMs=500
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
15
gradlew
vendored
15
gradlew
vendored
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 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.
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -84,7 +86,7 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# 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
|
||||||
@@ -112,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -170,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -203,15 +203,14 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
54
gradlew.bat
vendored
54
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -21,8 +23,8 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
setlocal EnableExtensions
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
@@ -43,13 +45,13 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
@@ -57,36 +59,24 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||||
|
|
||||||
:end
|
:exitWithErrorLevel
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
val ideaVersion: String by project
|
val ideaVersion: String by project
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(":api"))
|
implementation(project(":base"))
|
||||||
|
|
||||||
intellijPlatform {
|
intellijPlatform {
|
||||||
rider(ideaVersion) {
|
rider(ideaVersion) {
|
||||||
useInstaller = false
|
useInstaller = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bundledModule("intellij.rider.cpp.core.languages")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ rootProject.name = "ColoredBrackets"
|
|||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.9.21"
|
kotlin("jvm") version "2.2.20"
|
||||||
id("org.jetbrains.intellij.platform") version "2.9.0"
|
id("org.jetbrains.intellij.platform") version "2.16.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include("api")
|
include(":base")
|
||||||
include("clion")
|
include(":clion")
|
||||||
include("rider")
|
include(":rider")
|
||||||
|
|||||||
Reference in New Issue
Block a user