Skip to content

Commit 4acf3f1

Browse files
committed
Fix for compatibility issues and upgrading to k2 support
1 parent c1a76f6 commit 4acf3f1

File tree

10 files changed

+29
-84
lines changed

10 files changed

+29
-84
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# vscode-theme Changelog
44

55
## Unreleased
6+
### Added
7+
- Support k2 compiler
68
### Changed
79
- Removing Deprecated APIs
8-
- Min intellj Platform SDK is now 243
10+
- Min intellj Platform SDK is now 242
11+
- JDK version to 21
912

1013
## 1.10.13 - 2024-11-23
1114

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ version = providers.gradleProperty("pluginVersion").get()
1616

1717
// Set the JVM language level used to build the project.
1818
kotlin {
19-
jvmToolchain(17)
19+
jvmToolchain(21)
2020
}
2121

2222
// Configure project's dependencies

gradle.properties

+12-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ pluginGroup = com.github.dinbtechit.vscodetheme
44
pluginName = VSCode Theme
55
# SemVer format -> https://semver.org
66

7-
pluginVersion = 1.10.15
7+
pluginVersion = 1.11.0
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
10-
pluginSinceBuild = 233
10+
pluginSinceBuild = 242
1111
pluginUntilBuild = 243.*
1212

1313
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1414
platformType = IU
15-
platformVersion = 2023.3
15+
platformVersion = 2024.3
1616

1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1818
#platformPlugins = JavaScript, com.intellij.java, io.flutter:75.1.4, Dart:232.9559.10, PsiViewer:232.2, \
@@ -21,12 +21,17 @@ platformVersion = 2023.3
2121

2222
# 2023.3
2323
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
24-
platformPlugins = io.flutter:77.0.1, Dart:233.11799.172, PsiViewer:233.2, \
25-
Pythonid:233.11799.300, PythonCore:233.11799.241, com.jetbrains.php:233.11799.300, org.jetbrains.plugins.go:233.11799.196, \
26-
com.jetbrains.rust:233.21799.284
24+
#platformPlugins = io.flutter:77.0.1, Dart:233.11799.172, PsiViewer:233.2, \
25+
#Pythonid:233.11799.300, PythonCore:233.11799.241, com.jetbrains.php:233.11799.300, org.jetbrains.plugins.go:233.11799.196, \
26+
#com.jetbrains.rust:233.21799.284
27+
28+
#2024.3
29+
platformPlugins = io.flutter:82.2.4, Dart:243.22562.3, PsiViewer:243.7768, org.jetbrains.android:243.21565.214, \
30+
Pythonid:243.21565.211, PythonCore:243.21565.211, com.jetbrains.php:243.21565.211, org.jetbrains.plugins.go:243.21565.211, \
31+
com.jetbrains.rust:243.21565.245
2732

2833
# Example: platformBundledPlugins = com.intellij.java
29-
platformBundledPlugins = JavaScript, com.intellij.java, com.jetbrains.sh, org.jetbrains.kotlin
34+
platformBundledPlugins = JavaScript, com.intellij.java, com.jetbrains.sh, org.jetbrains.kotlin,
3035

3136
# 2022.3.3
3237
#platformPlugins = JavaScript, com.intellij.java, io.flutter:75.1.2, Dart:223.8950, PsiViewer:2022.3, \

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ junit = "4.13.2"
55
# plugins
66
changelog = "2.2.1"
77
intelliJPlatform = "2.1.0"
8-
kotlin = "1.9.25"
8+
kotlin = "2.1.0"
99
kover = "0.8.3"
1010
qodana = "2024.2.3"
1111

src/main/kotlin/com/github/dinbtechit/vscodetheme/VSCodeThemeManager.kt

-49
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,7 @@ package com.github.dinbtechit.vscodetheme
22

33
import com.intellij.ide.plugins.IdeaPluginDescriptor
44
import com.intellij.ide.plugins.PluginManagerCore
5-
import com.intellij.openapi.actionSystem.ActionManager
6-
import com.intellij.openapi.actionSystem.AnActionEvent
7-
import com.intellij.openapi.actionSystem.DataContext
8-
import com.intellij.openapi.actionSystem.Presentation
9-
import com.intellij.openapi.actionSystem.impl.SimpleDataContext
10-
import com.intellij.openapi.diagnostic.logger
115
import com.intellij.openapi.extensions.PluginId
12-
import com.intellij.openapi.project.ProjectManager
13-
import org.jetbrains.kotlin.console.actions.logError
14-
15-
/*enum class VSCodeTheme(val theme: String) {
16-
UNKNOWN("UNKNOWN"),
17-
DARK("VSCode Dark"),
18-
DARK_MODERN("VSCode Dark Modern");
19-
}*/
20-
21-
object VSCodeTheme {
22-
const val UNKNOWN = "UNKNOWN"
23-
const val DARK = "VSCode Dark"
24-
const val DARK_MODERN = "VSCode Dark Modern"
25-
}
266

277
class VSCodeThemeManager {
288
companion object {
@@ -40,33 +20,4 @@ class VSCodeThemeManager {
4020
fun isVSCodeThemeReady(): Boolean {
4121
return getPlugin() != null
4222
}
43-
44-
fun showThemePopUp() {
45-
//ShowSettingsUtil.getInstance().showSettingsDialog(null, "preferences.lookFeel")
46-
val action = ActionManager.getInstance().getAction("ChangeLaf")
47-
if (action != null) {
48-
val openProjects = ProjectManager.getInstance().openProjects
49-
if (openProjects.isNullOrEmpty()) return
50-
51-
val dataContext: DataContext = SimpleDataContext.getProjectContext(openProjects.first())
52-
53-
val presentation = Presentation()
54-
val event = AnActionEvent(
55-
null,
56-
dataContext,
57-
"",
58-
presentation,
59-
ActionManager.getInstance(),
60-
0
61-
)
62-
63-
// Perform the action
64-
action.actionPerformed(event)
65-
}
66-
else {
67-
logger<VSCodeThemeManager>().warn("ChangeLaf action was not found - Unable to show all themes")
68-
}
69-
}
70-
71-
7223
}

src/main/kotlin/com/github/dinbtechit/vscodetheme/actions/AlwaysApplyThemeAction.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package com.github.dinbtechit.vscodetheme.actions
22

3-
import com.github.dinbtechit.vscodetheme.VSCodeTheme
4-
import com.github.dinbtechit.vscodetheme.VSCodeThemeManager
53
import com.intellij.icons.AllIcons
4+
import com.intellij.ide.actions.QuickChangeLookAndFeel
65
import com.intellij.openapi.actionSystem.AnActionEvent
76
import com.intellij.openapi.project.DumbAwareAction
87

@@ -11,8 +10,8 @@ class AlwaysApplyThemeAction(
1110
) : DumbAwareAction(text, "", AllIcons.General.Settings) {
1211

1312
override fun actionPerformed(e: AnActionEvent) {
14-
VSCodeThemeManager.getInstance().showThemePopUp()
15-
//VSCodeStartupNotifyActivity.notification.hideBalloon()
13+
val action = QuickChangeLookAndFeel()
14+
action.actionPerformed(e)
1615
/*NotificationsManagerImpl.getNotificationsManager().expire(
1716
VSCodeStartupNotifyActivity.notification
1817
)*/

src/main/kotlin/com/github/dinbtechit/vscodetheme/settings/VSCodeThemeSettingsStore.kt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.github.dinbtechit.vscodetheme.settings
22

3-
import com.github.dinbtechit.vscodetheme.VSCodeTheme
43
import com.intellij.openapi.application.ApplicationManager
54
import com.intellij.openapi.components.PersistentStateComponent
65
import com.intellij.openapi.components.State

src/main/kotlin/com/github/dinbtechit/vscodetheme/startup/VSCodeStartupNotifyActivity.kt

+5-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.github.dinbtechit.vscodetheme.startup
22

3-
import com.github.dinbtechit.vscodetheme.VSCodeTheme
43
import com.github.dinbtechit.vscodetheme.VSCodeThemeManager
54
import com.github.dinbtechit.vscodetheme.actions.AlwaysApplyThemeAction
65
import com.github.dinbtechit.vscodetheme.actions.DonateAction
@@ -15,19 +14,15 @@ import com.intellij.notification.NotificationGroupManager
1514
import com.intellij.notification.NotificationType
1615
import com.intellij.openapi.extensions.PluginId
1716
import com.intellij.openapi.project.Project
18-
import com.intellij.openapi.startup.StartupActivity
17+
import com.intellij.openapi.startup.ProjectActivity
18+
1919

20-
/*enum class DisplayActionType {
21-
DONATION_ONLY,
22-
SHOW_ALL_THEMES_FOR_DEFAULT,
23-
SHOW_NEW_DARK_MODERN_THEME
24-
}*/
2520
object DisplayActionType {
2621
const val DONATION_ONLY = "DONATION_ONLY"
2722
const val SHOW_ALL_THEMES_FOR_DEFAULT = "SHOW_ALL_THEMES_FOR_DEFAULT"
2823
}
2924

30-
class VSCodeStartupNotifyActivity : StartupActivity {
25+
class VSCodeStartupNotifyActivity : ProjectActivity {
3126

3227

3328
private val updateContent: String by lazy {
@@ -41,16 +36,7 @@ class VSCodeStartupNotifyActivity : StartupActivity {
4136
private val switchThemeQuestion: String by lazy {
4237
//language=HTML
4338
"""
44-
Set one of the <b>VSCode Theme(s)</b> as a default theme.
45-
<br/>
46-
$updateContent
47-
""".trimIndent()
48-
}
49-
50-
private val tryNewDarkModernThemeQuestion: String by lazy {
51-
//language=HTML
52-
"""
53-
Would you like to set the <b>VSCode Dark Modern</b> as a default theme?
39+
Select <b>VSCode Theme(s)</b> from themes.
5440
<br/>
5541
$updateContent
5642
""".trimIndent()
@@ -65,7 +51,7 @@ class VSCodeStartupNotifyActivity : StartupActivity {
6551
const val pluginId = "com.github.dinbtechit.vscodetheme"
6652
}
6753

68-
override fun runActivity(project: Project) {
54+
override suspend fun execute(project: Project) {
6955
val settings = VSCodeThemeSettingsStore.instance
7056
val isReady = VSCodeThemeManager.getInstance().isVSCodeThemeReady()
7157
if (isReady && getPlugin()?.version != VSCodeThemeSettingsStore.instance.version) {

src/main/resources/META-INF/lang-config/dinbtechit-kotlin.xml

+3
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44
implementationClass="com.github.dinbtechit.vscodetheme.annotators.KotlinAnnotator"/>
55
<colorSettingsPage order="last" implementation="com.github.dinbtechit.vscodetheme.annotators.settings.KtColorSettingsPage"/>
66
</extensions>
7+
<extensions defaultExtensionNs="org.jetbrains.kotlin">
8+
<supportsKotlinPluginMode supportsK2="true"/>
9+
</extensions>
710
</idea-plugin>

src/main/resources/META-INF/plugin.xml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<depends config-file="lang-config/dinbtechit-rust.xml" optional="true">com.jetbrains.rust</depends>
2121
<depends config-file="lang-config/dinbtechit-sh.xml" optional="true">com.jetbrains.sh</depends>
2222
<!--<depends config-file="lang-config/dinbtechit-typescript.xml" optional="true">JavaScript</depends>-->
23-
2423
<extensions defaultExtensionNs="com.intellij">
2524
<themeProvider order="first" id="dinbtechit-2179230b863b9b1d9f1eeb27ca4a3a70" path="themes/vscode_dark_modern.theme.json"/>
2625
<themeProvider order="last" id="dinbtechit-7ef0c378d737e162955f3e028dcf9ccb" path="themes/vscode_dark.theme.json"/>

0 commit comments

Comments
 (0)