Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #339

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ 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
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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -32,7 +32,7 @@ class PlatformDetector(val project: Project) {
val remote = repository.locateRemote(settings.remote) ?: return null

val applicationSettings = service<ApplicationSettings>()
val platforms = project.service<PlatformRepository>()
val platforms = service<PlatformRepository>()

return remote.domain?.let {
platforms.getByDomain(it) ?: applicationSettings.findPlatformIdByCustomDomain(it)?.let { id -> platforms.getById(id) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProjectSettings>()
Expand Down
Loading