From 6132cb3b35fac8f3ecbde4c09d93c4ac3dab43e7 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Apr 2016 11:42:15 +0200 Subject: [PATCH] fixes #5579: [java] Colorization could be improved for import text --- .../java/test/colorize-fixtures/basic.java | 3 + .../test/colorize-results/basic_java.json | 204 +++++++++++++++--- extensions/theme-defaults/themes/dark_vs.json | 7 + .../theme-defaults/themes/hc_black.json | 7 + .../theme-defaults/themes/light_vs.json | 7 + 5 files changed, 203 insertions(+), 25 deletions(-) diff --git a/extensions/java/test/colorize-fixtures/basic.java b/extensions/java/test/colorize-fixtures/basic.java index 17a51df1cc0..ad00e001bfd 100644 --- a/extensions/java/test/colorize-fixtures/basic.java +++ b/extensions/java/test/colorize-fixtures/basic.java @@ -1,4 +1,7 @@ +package foo; + import org.junit.Test; +import org.junit.runners.*; /* * Multi line comment diff --git a/extensions/java/test/colorize-results/basic_java.json b/extensions/java/test/colorize-results/basic_java.json index 4ecae79f2af..654eba9979d 100644 --- a/extensions/java/test/colorize-results/basic_java.json +++ b/extensions/java/test/colorize-results/basic_java.json @@ -1,4 +1,48 @@ [ + { + "c": "package", + "t": "java.keyword.meta.other.package", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "java.meta.package", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "foo", + "t": "java.meta.modifier.package.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.package.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.package.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.package.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.package.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.package.java rgb(212, 212, 212)" + } + }, + { + "c": ";", + "t": "java.meta.package.punctuation.terminator", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, { "c": "import", "t": "import.java.keyword.meta.other", @@ -25,55 +69,165 @@ "c": "org", "t": "import.java.meta.modifier.storage", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" } }, { "c": ".", "t": "import.java.meta.modifier.punctuation.separator.storage", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" } }, { "c": "junit", "t": "import.java.meta.modifier.storage", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" } }, { "c": ".", "t": "import.java.meta.modifier.punctuation.separator.storage", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" } }, { "c": "Test", "t": "import.java.meta.modifier.storage", "r": { - "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier rgb(86, 156, 214)", - "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier rgb(0, 0, 255)", - "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier rgb(86, 156, 214)", - "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier rgb(0, 0, 255)", - "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier rgb(86, 156, 214)" + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": ";", + "t": "import.java.meta.punctuation.terminator", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "import", + "t": "import.java.keyword.meta.other", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)" + } + }, + { + "c": " ", + "t": "import.java.meta", + "r": { + "dark_plus": ".vs-dark .token rgb(212, 212, 212)", + "light_plus": ".vs .token rgb(0, 0, 0)", + "dark_vs": ".vs-dark .token rgb(212, 212, 212)", + "light_vs": ".vs .token rgb(0, 0, 0)", + "hc_black": ".hc-black .token rgb(255, 255, 255)" + } + }, + { + "c": "org", + "t": "import.java.meta.modifier.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": ".", + "t": "import.java.meta.modifier.punctuation.separator.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": "junit", + "t": "import.java.meta.modifier.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": ".", + "t": "import.java.meta.modifier.punctuation.separator.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": "runners", + "t": "import.java.meta.modifier.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": ".", + "t": "import.java.meta.modifier.punctuation.separator.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" + } + }, + { + "c": "*", + "t": "import.java.meta.modifier.storage", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.storage.modifier.import.java rgb(212, 212, 212)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.storage.modifier.import.java rgb(0, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.storage.modifier.import.java rgb(212, 212, 212)" } }, { diff --git a/extensions/theme-defaults/themes/dark_vs.json b/extensions/theme-defaults/themes/dark_vs.json index 9700a11667c..87b3dde8f83 100644 --- a/extensions/theme-defaults/themes/dark_vs.json +++ b/extensions/theme-defaults/themes/dark_vs.json @@ -278,6 +278,13 @@ "settings": { "foreground": "#b5cea8" } + }, + { + "name": "coloring of the Java import and package identifiers", + "scope": ["storage.modifier.import.java", "storage.modifier.package.java"], + "settings": { + "foreground": "#d4d4d4" + } } ] } \ No newline at end of file diff --git a/extensions/theme-defaults/themes/hc_black.json b/extensions/theme-defaults/themes/hc_black.json index 278ecaac83d..764ec2248c1 100644 --- a/extensions/theme-defaults/themes/hc_black.json +++ b/extensions/theme-defaults/themes/hc_black.json @@ -253,6 +253,13 @@ "settings": { "foreground": "#b5cea8" } + }, + { + "name": "coloring of the Java import and package identifiers", + "scope": ["storage.modifier.import.java", "storage.modifier.package.java"], + "settings": { + "foreground": "#d4d4d4" + } } ] } \ No newline at end of file diff --git a/extensions/theme-defaults/themes/light_vs.json b/extensions/theme-defaults/themes/light_vs.json index fc40145f11d..8656afd70c4 100644 --- a/extensions/theme-defaults/themes/light_vs.json +++ b/extensions/theme-defaults/themes/light_vs.json @@ -267,6 +267,13 @@ "settings": { "foreground": "#09885a" } + }, + { + "name": "coloring of the Java import and package identifiers", + "scope": ["storage.modifier.import.java", "storage.modifier.package.java"], + "settings": { + "foreground": "#000000" + } } ] } \ No newline at end of file