generated from JetBrains/intellij-platform-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from dinbtechit/chore/merry-chirstmas-2023
Chores - Deprecated APIs and dart highlighting fixes.
- Loading branch information
Showing
24 changed files
with
215 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
import com.intellij.ide.ui.ThemeListProvider | ||
import com.intellij.openapi.application.ApplicationManager | ||
import com.intellij.openapi.extensions.PluginId | ||
import com.intellij.util.ui.JBUI | ||
import com.jetbrains.rd.util.string.printToString | ||
|
||
/*enum class VSCodeTheme(val theme: String) { | ||
UNKNOWN("UNKNOWN"), | ||
|
@@ -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) } | ||
return vscodeTheme != null | ||
} | ||
return false | ||
|
@@ -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) } | ||
|
||
if (vscodeTheme != null) { | ||
LafManager.getInstance().currentUIThemeLookAndFeel = vscodeTheme | ||
Check warning on line 60 in src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt GitHub Actions / Qodana Community for JVMUnstable API Usage
|
||
} | ||
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 GitHub Actions / Qodana Community for JVMUnstable API Usage
|
||
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 GitHub Actions / Qodana Community for JVMUnstable API Usage
|
||
return theme?.toString()?.contains(VSCodeTheme.DARK_MODERN) ?: false | ||
} | ||
|
||
private fun convertOldToNewTheme(theme: String): String { | ||
return when (theme) { | ||
"DARK_MODERN" -> "VSCode Dark Modern" | ||
|
Oops, something went wrong.