diff --git a/src/main/kotlin/uk/co/ben_gibson/git/link/listener/ApplicationStartupListener.kt b/src/main/kotlin/uk/co/ben_gibson/git/link/listener/ApplicationStartupListener.kt index 5fabf34..4f08a90 100644 --- a/src/main/kotlin/uk/co/ben_gibson/git/link/listener/ApplicationStartupListener.kt +++ b/src/main/kotlin/uk/co/ben_gibson/git/link/listener/ApplicationStartupListener.kt @@ -2,7 +2,7 @@ package uk.co.ben_gibson.git.link.listener import com.intellij.openapi.components.service import com.intellij.openapi.project.Project -import com.intellij.openapi.startup.StartupActivity +import com.intellij.openapi.startup.ProjectActivity import uk.co.ben_gibson.git.link.GitLinkBundle import uk.co.ben_gibson.git.link.platform.PlatformDetector import uk.co.ben_gibson.git.link.settings.ApplicationSettings @@ -10,8 +10,8 @@ import uk.co.ben_gibson.git.link.settings.ProjectSettings import uk.co.ben_gibson.git.link.ui.notification.Notification import uk.co.ben_gibson.git.link.ui.notification.sendNotification -class ApplicationStartupListener : StartupActivity.DumbAware { - override fun runActivity(project: Project) { +class ApplicationStartupListener : ProjectActivity { + override suspend fun execute(project: Project) { showVersionNotification(project) detectPlatform(project) } diff --git a/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformDetector.kt b/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformDetector.kt index e908d53..2109662 100644 --- a/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformDetector.kt +++ b/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformDetector.kt @@ -14,7 +14,7 @@ import uk.co.ben_gibson.git.link.git.locateRemote import uk.co.ben_gibson.git.link.settings.ApplicationSettings import uk.co.ben_gibson.git.link.settings.ProjectSettings -@Service +@Service(Service.Level.PROJECT) class PlatformDetector(val project: Project) { fun detect(consumer: (Platform?) -> Unit) { val projectDirectory = project.guessProjectDir() @@ -32,7 +32,7 @@ class PlatformDetector(val project: Project) { val remote = repository.locateRemote(settings.remote) ?: return null val applicationSettings = service() - val platforms = project.service() + val platforms = service() return remote.domain?.let { platforms.getByDomain(it) ?: applicationSettings.findPlatformIdByCustomDomain(it)?.let { id -> platforms.getById(id) } diff --git a/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformLocator.kt b/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformLocator.kt index 1f95d19..1ab98be 100644 --- a/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformLocator.kt +++ b/src/main/kotlin/uk/co/ben_gibson/git/link/platform/PlatformLocator.kt @@ -5,7 +5,7 @@ import com.intellij.openapi.components.service import com.intellij.openapi.project.Project import uk.co.ben_gibson.git.link.settings.ProjectSettings -@Service +@Service(Service.Level.PROJECT) class PlatformLocator(val project: Project) { fun locate() : Platform? { val settings = project.service()