File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
src/test/clojure/com/github/clojure_lsp/intellij Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 44 [com.github.ericdallo.clj4intellij.app-manager :as app-manager]
55 [com.github.ericdallo.clj4intellij.test :as clj4intellij.test])
66 (:import
7- [com.intellij.openapi.wm WindowManager]))
7+ [com.intellij.openapi.wm WindowManager]
8+ [com.intellij.openapi.actionSystem ActionManager]
9+ [com.intellij.ide DataManager]))
810
911(set! *warn-on-reflection* true )
1012
1315 (let [status-bar (.. (WindowManager/getInstance ) (getStatusBar project))]
1416 (.getWidget status-bar widget-id)))
1517
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+
1634(deftest foo-test
1735 (let [project-name " clojure.core"
1836 fixture (clj4intellij.test/setup project-name)
2745 project
2846 (fn [] (.openFileInEditor fixture clj-file)))
2947
48+
49+
3050 (clj4intellij.test/dispatch-all )
51+ (println " OLAAAA >> " )
52+ (run-editor-action " ClojureLSP.ForwardSlurp" project)
3153
3254 @(app-manager/invoke-later!
3355 {:invoke-fn (fn []
You can’t perform that action at this time.
0 commit comments