summaryrefslogtreecommitdiff
path: root/src/main/kotlin/me/kyren223/harpoonforjb/HarpoonAppendAction.kt
blob: 724f6c861d0dc5ef5e214c985b8f21f393cc316e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package me.kyren223.harpoonforjb

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile

class HarpoonAppendAction : AnAction() {
    override fun actionPerformed(e: AnActionEvent) {
        val project: Project = e.project ?: return
        val file: VirtualFile = e.getData(PlatformDataKeys.VIRTUAL_FILE) ?: return
        HarpoonState.appendFile(project, file)
    }
}