Skip to content

Commit 5323341

Browse files
committed
Support 2024.3 EAP
1 parent 3bb5b4e commit 5323341

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Added
66

77
- Support for Kotlin K2 mode
8-
- Increased the earliest compatible IntelliJ version to 2024.2.1
8+
- Updated the compatibility range to 2024.2.1 - 2024.3
99

1010
## [0.1.3]
1111

plugin/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
intellijPlatform {
2727
pluginModule(implementation(project(":kobweb-model")))
2828
// Interesting statistics: https://plugins.jetbrains.com/docs/marketplace/product-versions-in-use-statistics.html
29-
// We target 2024.2.1 as it is the earliest version supporting K2 mode
29+
// We target 2024.2.1 as it is the earliest version supporting K2 mode / the Analysis API
3030
intellijIdeaCommunity("2024.2.1")
3131

3232
bundledPlugins(
@@ -70,7 +70,7 @@ intellijPlatform {
7070

7171
ideaVersion {
7272
//sinceBuild derived from intellij.version
73-
untilBuild = "242.*" // Include EAP
73+
untilBuild = "243.*" // Include EAP
7474
}
7575

7676
changeNotes = provider {

plugin/src/main/kotlin/com/varabyte/kobweb/intellij/startup/KobwebPostStartupProjectActivity.kt

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
package com.varabyte.kobweb.intellij.startup
22

33
import com.intellij.notification.NotificationType
4-
import com.intellij.openapi.actionSystem.ActionManager
5-
import com.intellij.openapi.actionSystem.ActionPlaces
6-
import com.intellij.openapi.actionSystem.PlatformDataKeys
7-
import com.intellij.openapi.actionSystem.ex.ActionUtil
84
import com.intellij.openapi.components.service
9-
import com.intellij.openapi.externalSystem.action.RefreshAllExternalProjectsAction
5+
import com.intellij.openapi.externalSystem.autoimport.ExternalSystemProjectTracker
106
import com.intellij.openapi.externalSystem.service.project.manage.ProjectDataImportListener
117
import com.intellij.openapi.project.Project
128
import com.intellij.openapi.project.modules
@@ -50,7 +46,7 @@ private fun Project.hasAnyKobwebDependency(): Boolean {
5046
class KobwebPostStartupProjectActivity : ProjectActivity {
5147
private class ImportListener(
5248
private val project: Project,
53-
private val syncRequestedNotification: KobwebNotificationHandle?
49+
private val syncRequestedNotification: KobwebNotificationHandle?,
5450
) : ProjectDataImportListener {
5551
override fun onImportStarted(projectPath: String?) {
5652
// If an import is kicked off in an indirect way, we should still dismiss the sync popup.
@@ -74,17 +70,13 @@ class KobwebPostStartupProjectActivity : ProjectActivity {
7470
project.kobwebPluginState = KobwebPluginState.UNINITIALIZED
7571
}
7672

77-
val refreshProjectAction = ActionManager.getInstance().getAction("ExternalSystem.RefreshAllProjects") as? RefreshAllExternalProjectsAction
78-
val syncRequestedNotification = if (refreshProjectAction != null && project.kobwebPluginState == KobwebPluginState.UNINITIALIZED) {
73+
val syncRequestedNotification = if (project.kobwebPluginState == KobwebPluginState.UNINITIALIZED) {
7974
KobwebNotifier.Builder("The Kobweb plugin requires a one-time sync to enable functionality.")
8075
.type(NotificationType.WARNING)
8176
.addAction("Sync Project") {
82-
ActionUtil.invokeAction(refreshProjectAction, { dataId ->
83-
when {
84-
PlatformDataKeys.PROJECT.`is`(dataId) -> project
85-
else -> null
86-
}
87-
}, ActionPlaces.NOTIFICATION, null, null)
77+
val tracker = ExternalSystemProjectTracker.getInstance(project)
78+
tracker.markDirtyAllProjects()
79+
tracker.scheduleProjectRefresh()
8880
}
8981
.notify(project)
9082
} else null

0 commit comments

Comments
 (0)