Skip to content

Commit 66a355f

Browse files
committed
refactor(TokenUsageEvent): simplify ApplicationManager usage in notify method
1 parent 15b75ec commit 66a355f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/kotlin/cc/unitmesh/devti/llm2/TokenUsageEvent.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cc.unitmesh.devti.llm2
22

33
import cc.unitmesh.devti.llms.custom.Usage
4+
import com.intellij.openapi.application.ApplicationManager
45
import com.intellij.util.messages.Topic
56
import kotlinx.serialization.Serializable
67

@@ -33,7 +34,7 @@ interface TokenUsageListener {
3334
* Notify all subscribers about token usage
3435
*/
3536
fun notify(event: TokenUsageEvent) {
36-
com.intellij.openapi.application.ApplicationManager.getApplication().messageBus
37+
ApplicationManager.getApplication().messageBus
3738
.syncPublisher(TOPIC)
3839
.onTokenUsage(event)
3940
}

0 commit comments

Comments
 (0)