File tree 1 file changed +23
-1
lines changed
src/test/clojure/com/github/clojure_lsp/intellij
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 4
4
[com.github.ericdallo.clj4intellij.app-manager :as app-manager]
5
5
[com.github.ericdallo.clj4intellij.test :as clj4intellij.test])
6
6
(:import
7
- [com.intellij.openapi.wm WindowManager]))
7
+ [com.intellij.openapi.wm WindowManager]
8
+ [com.intellij.openapi.actionSystem ActionManager]
9
+ [com.intellij.ide DataManager]))
8
10
9
11
(set! *warn-on-reflection* true )
10
12
13
15
(let [status-bar (.. (WindowManager/getInstance ) (getStatusBar project))]
14
16
(.getWidget status-bar widget-id)))
15
17
18
+
19
+ (defn run-editor-action [action-id project]
20
+ (let [action (.getAction (ActionManager/getInstance ) action-id)
21
+ context (.getDataContext (DataManager/getInstance ))]
22
+
23
+
24
+ (println " Running action:" action-id)
25
+ (println " Action:" action)
26
+ (app-manager/write-command-action
27
+ project
28
+ (fn []
29
+ (.actionPerformed
30
+ action
31
+ (com.intellij.openapi.actionSystem.AnActionEvent/createFromDataContext action-id nil context))))))
32
+
33
+
16
34
(deftest foo-test
17
35
(let [project-name " clojure.core"
18
36
fixture (clj4intellij.test/setup project-name)
27
45
project
28
46
(fn [] (.openFileInEditor fixture clj-file)))
29
47
48
+
49
+
30
50
(clj4intellij.test/dispatch-all )
51
+ (println " OLAAAA >> " )
52
+ (run-editor-action " ClojureLSP.ForwardSlurp" project)
31
53
32
54
@(app-manager/invoke-later!
33
55
{:invoke-fn (fn []
You can’t perform that action at this time.
0 commit comments