Skip to content

Commit e7a323f

Browse files
committed
Remove ProjectActivity to fix compatibility problem
1 parent 352b459 commit e7a323f

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/main/kotlin/ai/devchat/plugin/DevChatToolWindowFactory.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import ai.devchat.core.DevChatClient
55
import ai.devchat.core.DevChatWrapper
66
import ai.devchat.installer.DevChatSetupThread
77
import ai.devchat.storage.ActiveConversation
8+
import ai.devchat.storage.RecentFilesTracker
89
import com.intellij.openapi.Disposable
910
import com.intellij.openapi.components.Service
11+
import com.intellij.openapi.components.service
1012
import com.intellij.openapi.project.DumbAware
1113
import com.intellij.openapi.project.Project
1214
import com.intellij.openapi.util.Disposer
@@ -35,6 +37,7 @@ class DevChatService(project: Project) {
3537

3638
class DevChatToolWindowFactory : ToolWindowFactory, DumbAware, Disposable {
3739
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
40+
project.service<RecentFilesTracker>()
3841
val devChatService = project.getService(DevChatService::class.java)
3942
val browser = Browser(project)
4043
devChatService.browser = browser

src/main/kotlin/ai/devchat/storage/RecentFilesTracker.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ package ai.devchat.storage
33
import ai.devchat.common.Log
44
import com.intellij.openapi.application.runInEdt
55
import com.intellij.openapi.components.Service
6-
import com.intellij.openapi.components.service
76
import com.intellij.openapi.fileEditor.FileEditorManager
87
import com.intellij.openapi.fileEditor.FileEditorManagerListener
98
import com.intellij.openapi.project.Project
109
import com.intellij.openapi.roots.ProjectFileIndex
11-
import com.intellij.openapi.startup.ProjectActivity
1210
import com.intellij.openapi.vfs.VirtualFile
1311
import com.intellij.util.messages.MessageBusConnection
1412

@@ -49,9 +47,3 @@ class RecentFilesTracker(private val project: Project) {
4947
return recentFiles.toList()
5048
}
5149
}
52-
53-
class RecentFilesStartupActivity : ProjectActivity {
54-
override suspend fun execute(project: Project) {
55-
project.service<RecentFilesTracker>()
56-
}
57-
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<!-- <listener class="ai.devchat.plugin.IDELifecycleListener" topic="com.intellij.ide.AppLifecycleListener" />-->
3737
<!-- </applicationListeners>-->
3838
<extensions defaultExtensionNs="com.intellij">
39-
<postStartupActivity implementation="ai.devchat.storage.RecentFilesStartupActivity"/>
4039
<toolWindow id="${ASSISTANT_NAME_ZH}" secondary="false" icon="/icons/toolWindowIcon.svg" anchor="right"
4140
factoryClass="ai.devchat.plugin.DevChatToolWindowFactory"/>
4241
<applicationService serviceImplementation="ai.devchat.storage.DevChatSettingsState"/>

0 commit comments

Comments
 (0)