Skip to content

Commit

Permalink
Merge pull request #175 from dinbtechit/chore/merry-chirstmas-2023
Browse files Browse the repository at this point in the history
Chores - Deprecated APIs and dart highlighting fixes.
  • Loading branch information
dinbtechit authored Dec 17, 2023
2 parents 4a9dbd3 + 8c739fa commit 4808713
Show file tree
Hide file tree
Showing 24 changed files with 215 additions and 67 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/[email protected]

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -135,11 +135,11 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -188,18 +188,18 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/[email protected].1
uses: JetBrains/[email protected].8
with:
cache-default-branch-only: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
7 changes: 5 additions & 2 deletions .run/Run IDE for UI Tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="runIdeForUiTests" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
<list>
<option value="runIdeForUiTests" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
8 changes: 6 additions & 2 deletions .run/Run Qodana.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="cleanInspections runInspections" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
<list>
<option value="cleanInspections" />
<option value="runInspections" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
### Fixed:
- VScode Light Modern — The icon color of RunWidge is too light to see; by @trofoto
- VScode Light Modern — The background color of RecentProject is too dark. by @trofoto
- Dart Secondary Color Highlighting issues fixed
- Replaced Deprecated APIs

## 1.10.7 - 2023-10-30

Expand Down
26 changes: 24 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML

Expand All @@ -11,6 +12,7 @@ plugins {
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
id("org.jetbrains.grammarkit") version "2021.2.2"
}

group = properties("pluginGroup").get()
Expand All @@ -20,6 +22,7 @@ version = properties("pluginVersion").get()
repositories {
mavenCentral()
}
sourceSets["main"].java.srcDirs("src/main/gen")

// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
dependencies {
Expand All @@ -28,15 +31,19 @@ dependencies {

// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
jvmToolchain(17)
@Suppress("UnstableApiUsage")
jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.JETBRAINS
}
}

// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")

downloadSources = true
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
}
Expand Down Expand Up @@ -69,6 +76,21 @@ tasks {
gradleVersion = properties("gradleVersion").get()
}

/* generateLexer {
source.set("src/main/kotlin/com/github/dinbtechit/vscodetheme/languages/dart/grammar/_DartLexer.flex")
targetDir.set("src/main/gen/com/github/dinbtechit/vscodetheme/languages/dart/grammar")
targetClass.set("_DartLexer")
purgeOldFiles.set(true)
}
generateParser {
source.set("src/main/kotlin/com/github/dinbtechit/vscodetheme/languages/dart/grammar/dart.bnf")
targetRoot.set("src/main/gen")
pathToParser.set("/com/github/dinbtechit/vscodetheme/languages/dart/grammar/_DartLexer.java")
pathToPsiRoot.set("/com/github/dinbtechit/vscodetheme/languages/dart/psi")
purgeOldFiles.set(true)
}*/

patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
Expand Down
15 changes: 10 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ pluginName = VSCode Theme
pluginVersion = 1.10.8

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 223
pluginSinceBuild = 233
pluginUntilBuild =

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IU
platformVersion = 2023.2.2
platformVersion = 2023.3

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = JavaScript, com.intellij.java, io.flutter:75.1.4, Dart:232.9559.10, PsiViewer:232.2, \
Pythonid:232.9921.47, PythonCore:232.9921.47, org.jetbrains.kotlin, com.jetbrains.php:232.9921.47, org.jetbrains.plugins.go:232.9921.28, \
com.jetbrains.rust:232.9921.62,com.jetbrains.sh
#platformPlugins = JavaScript, com.intellij.java, io.flutter:75.1.4, Dart:232.9559.10, PsiViewer:232.2, \
#Pythonid:232.9921.47, PythonCore:232.9921.47, org.jetbrains.kotlin, com.jetbrains.php:232.9921.47, org.jetbrains.plugins.go:232.9921.28, \
#com.jetbrains.rust:232.9921.62,com.jetbrains.sh

# 2023.3
platformPlugins = JavaScript, com.intellij.java, io.flutter:77.0.1, Dart:233.11799.172, PsiViewer:233.2, \
Pythonid:233.11799.300, PythonCore:233.11799.241, org.jetbrains.kotlin, com.jetbrains.php:233.11799.300, org.jetbrains.plugins.go:233.11799.196, \
com.jetbrains.rust:233.21799.284,com.jetbrains.sh

# 2022.3.3
#platformPlugins = JavaScript, com.intellij.java, io.flutter:75.1.2, Dart:223.8950, PsiViewer:2022.3, \
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
# libraries
annotations = "24.0.1"
annotations = "24.1.0"

# plugins
kotlin = "1.9.10"
kotlin = "1.9.21"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.15.0"
gradleIntelliJPlugin = "1.16.1"
qodana = "0.1.13"
kover = "0.7.3"
kover = "0.7.5"

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# 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
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
2 changes: 2 additions & 0 deletions qodana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# https://www.jetbrains.com/help/qodana/qodana-yaml.html

version: 1.0
linter: jetbrains/qodana-jvm-community:latest
projectJDK: "17"
profile:
name: qodana.recommended
exclude:
Expand Down
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

rootProject.name = "vscode-theme"
//include("ide-clion")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import com.github.dinbtechit.vscodetheme.settings.VSCodeThemeSettingsStore
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.ide.ui.LafManager
import com.intellij.ide.ui.LafManagerListener

Check warning on line 7 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive
import com.intellij.ide.ui.ThemeListProvider

Check warning on line 8 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive
import com.intellij.openapi.application.ApplicationManager

Check warning on line 9 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive
import com.intellij.openapi.extensions.PluginId
import com.intellij.util.ui.JBUI

Check warning on line 11 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive
import com.jetbrains.rd.util.string.printToString

Check warning on line 12 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unused import directive

Unused import directive

/*enum class VSCodeTheme(val theme: String) {
UNKNOWN("UNKNOWN"),
Expand Down Expand Up @@ -35,7 +40,7 @@ class VSCodeThemeManager {
try {
if (getPlugin()?.isEnabled != null) {
val vscodeTheme =
LafManager.getInstance().installedLookAndFeels.first { it.name == VSCodeTheme.DARK }
LafManager.getInstance().installedThemes.firstOrNull { it.toString().contains(VSCodeTheme.DARK) }

Check warning on line 43 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getInstalledThemes()' is marked unstable with @ApiStatus.Experimental
return vscodeTheme != null
}
return false
Expand All @@ -49,19 +54,35 @@ class VSCodeThemeManager {
if (isVSCodeThemeReady()) {
val convertedSelectedVSCodeTheme = convertOldToNewTheme(selectedVSCodeTheme)
val vscodeTheme =
LafManager.getInstance().installedLookAndFeels.first { it.name == convertedSelectedVSCodeTheme }
LafManager.getInstance().currentLookAndFeel = vscodeTheme
LafManager.getInstance().installedThemes.firstOrNull { it.toString().contains(convertedSelectedVSCodeTheme) }

Check warning on line 57 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getInstalledThemes()' is marked unstable with @ApiStatus.Experimental

if (vscodeTheme != null) {
LafManager.getInstance().currentUIThemeLookAndFeel = vscodeTheme

Check warning on line 60 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'setCurrentUIThemeLookAndFeel([email protected] UIThemeLookAndFeelInfo)' is unstable because its signature references unstable 'com.intellij.ide.ui.laf.UIThemeLookAndFeelInfo' marked with @ApiStatus.Internal
}
if (always) {
val settings = VSCodeThemeSettingsStore.instance
settings.alwaysApply = true
settings.themeName = selectedVSCodeTheme
}
}
} catch (e: Exception) {
throw(Error("Unable to select the default theme $selectedVSCodeTheme", e))
throw (Error("Unable to select the default theme $selectedVSCodeTheme", e))
}
}

fun isVSCodeThemeSelected(): Boolean {
val theme = LafManager.getInstance().currentUIThemeLookAndFeel

Check warning on line 74 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getCurrentUIThemeLookAndFeel()' is unstable because its signature references unstable 'com.intellij.ide.ui.laf.UIThemeLookAndFeelInfo' marked with @ApiStatus.Internal
if (theme != null) {
return theme.toString().contains(VSCodeTheme.DARK) && !theme.toString().contains("Modern")
}
return false
}

fun isVSCodeDarkModernThemeSelected(): Boolean {
val theme = LafManager.getInstance().currentUIThemeLookAndFeel

Check warning on line 82 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Unstable API Usage

'getCurrentUIThemeLookAndFeel()' is unstable because its signature references unstable 'com.intellij.ide.ui.laf.UIThemeLookAndFeelInfo' marked with @ApiStatus.Internal
return theme?.toString()?.contains(VSCodeTheme.DARK_MODERN) ?: false
}

private fun convertOldToNewTheme(theme: String): String {
return when (theme) {
"DARK_MODERN" -> "VSCode Dark Modern"
Expand Down
Loading

0 comments on commit 4808713

Please sign in to comment.