diff --git a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/inspections/UnresolvedThemeKeyInspectionTest.kt b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/inspections/JsonThemeInspectionTest.kt
similarity index 64%
rename from plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/inspections/UnresolvedThemeKeyInspectionTest.kt
rename to plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/inspections/JsonThemeInspectionTest.kt
index 4e51a5c7cc6b..b29ec578d087 100644
--- a/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/inspections/UnresolvedThemeKeyInspectionTest.kt
+++ b/plugins/devkit/devkit-java-tests/testSrc/org/jetbrains/idea/devkit/inspections/JsonThemeInspectionTest.kt
@@ -2,13 +2,17 @@
package org.jetbrains.idea.devkit.inspections
import com.intellij.testFramework.fixtures.BasePlatformTestCase
+import org.jetbrains.idea.devkit.themes.UnresolvedThemeJsonNamedColorInspection
import org.jetbrains.idea.devkit.themes.UnresolvedIntelliJThemeKeyInspection
-class UnresolvedThemeKeyInspectionTest : BasePlatformTestCase() {
+class JsonThemeInspectionTest : BasePlatformTestCase() {
override fun setUp() {
super.setUp()
- myFixture.enableInspections(UnresolvedIntelliJThemeKeyInspection::class.java)
+ myFixture.enableInspections(
+ UnresolvedIntelliJThemeKeyInspection::class.java,
+ UnresolvedThemeJsonNamedColorInspection::class.java
+ )
}
fun testRegularKeys() {
@@ -69,4 +73,32 @@ class UnresolvedThemeKeyInspectionTest : BasePlatformTestCase() {
""".trimIndent())
myFixture.checkHighlighting()
}
+
+ fun testColorNamesInThemeFiles() {
+ myFixture.configureByText("test.theme.json", """
+ {
+ "name": "Test Theme",
+ "colors": {
+ "registered-color": "#000000"
+ },
+ "ui": {
+ "ActionButton.focusedBorderColor": "registered-color",
+ "ActionButton.separatorColor": "#ffffff",
+ "ActionButton": {
+ "pressedBackground": "
*.theme.json).
+
+ Named colors are defined in the colors section of the theme file and can be referenced
+ in the ui section or gradient definitions.
+
+ See Exposing Theme Metadata for more information. +
+ + \ No newline at end of file diff --git a/plugins/devkit/intellij.devkit.themes/resources/intellij.devkit.themes.xml b/plugins/devkit/intellij.devkit.themes/resources/intellij.devkit.themes.xml index dd54cee75b5d..b74309a7946f 100644 --- a/plugins/devkit/intellij.devkit.themes/resources/intellij.devkit.themes.xml +++ b/plugins/devkit/intellij.devkit.themes/resources/intellij.devkit.themes.xml @@ -20,6 +20,11 @@ groupBundle="messages.DevKitBundle" groupPathKey="inspections.group.path" groupKey="inspections.group.code" implementationClass="org.jetbrains.idea.devkit.themes.UnresolvedIntelliJThemeKeyInspection" bundle="messages.DevKitThemesBundle" key="inspection.unresolved.theme.key.display.name"/> +