Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
12 changes: 12 additions & 0 deletions src/main/kotlin/com/squareup/cash/hermit/HermitCleanupService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.squareup.cash.hermit

import com.intellij.openapi.Disposable
import com.intellij.openapi.components.Service
import com.intellij.openapi.project.Project

@Service(Service.Level.PROJECT)
class HermitCleanupService(private val project: Project) : Disposable {
override fun dispose() {
Hermit.remove(project)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.squareup.cash.hermit

import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.ProjectActivity

class HermitProjectStartupActivity: ProjectActivity {
override suspend fun execute(project: Project) {
Hermit(project).open()

// Ensure HermitCleanupService is initialized and disposal is registered
project.getService(HermitCleanupService::class.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.squareup.cash.hermit.action
import com.intellij.notification.Notification
import com.intellij.notification.NotificationAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.progress.PerformInBackgroundOption
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.Task
import com.intellij.openapi.project.Project
Expand All @@ -18,7 +17,7 @@ class EnableHermitAction : NotificationAction("") {
}

class BackgroundableWrapper(project: Project, title: String, private val task: Runnable)
: Task.Backgroundable(project, title, true, PerformInBackgroundOption.DEAF) {
: Task.Backgroundable(project, title, true) {

override fun run(indicator: ProgressIndicator) {
task.run()
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<projectListeners>
<listener class="com.squareup.cash.hermit.HermitVFSChangeListener" topic="com.intellij.openapi.vfs.newvfs.BulkFileListener" />
<listener class="com.squareup.cash.hermit.HermitProjectManagerListener" topic="com.intellij.openapi.project.ProjectManagerListener" />
</projectListeners>

<applicationListeners>
Expand All @@ -40,6 +39,7 @@
<extensions defaultExtensionNs="com.intellij">
<toolsCustomizer implementation="com.squareup.cash.hermit.execution.HermitToolsCustomiser" />
<statusBarWidgetFactory id="HermitStatusBarWidgetFactory" implementation="com.squareup.cash.hermit.ui.statusbar.HermitStatusBarWidgetFactory"/>
<postStartupActivity implementation="com.squareup.cash.hermit.HermitProjectStartupActivity"/>
</extensions>

<extensionPoints>
Expand Down
Loading