File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
kotlin/com/github/xepozz/php_dump/startup Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.github.xepozz.php_dump.startup
2+
3+ import com.intellij.openapi.editor.event.EditorMouseEvent
4+ import com.intellij.openapi.editor.event.EditorMouseListener
5+ import com.intellij.psi.PsiDocumentManager
6+
7+ class EditorListener : EditorMouseListener {
8+ override fun mouseClicked (event : EditorMouseEvent ) {
9+ val editor = event.editor
10+ val project = editor.project ? : return
11+ val priDocumentManager = PsiDocumentManager .getInstance(project)
12+ val psiFile = priDocumentManager.getPsiFile(editor.document)
13+ val offset = editor.logicalPositionToOffset(event.logicalPosition)
14+ val element = psiFile?.findElementAt(offset) ? : return
15+
16+ println (" clicked on $element " )
17+
18+ // val toolWindowManager = ToolWindowManager.getInstance(project)
19+ // val toolWindow = toolWindowManager.getToolWindow("PHP Dump")
20+ //
21+ // toolWindow
22+ // ?.component
23+ // ?.components
24+ // ?.mapNotNull { it as? RefreshablePanel }
25+ // ?.forEach { it.refresh(project, RefreshType.AUTO) }
26+ // ?: return
27+
28+ }
29+ }
Original file line number Diff line number Diff line change 1414 <toolWindow
1515 factoryClass =" com.github.xepozz.php_dump.CompositeWindowFactory"
1616 id =" PHP Dump" anchor =" right" secondary =" false" icon =" /icons/pot.svg" />
17+ <editorFactoryMouseListener
18+ implementation =" com.github.xepozz.php_dump.startup.EditorListener" />
1719 </extensions >
1820 <projectListeners >
1921 <listener
You can’t perform that action at this time.
0 commit comments