|
51 | 51 | (let [action (.getAction (ActionManager/getInstance) action-id) |
52 | 52 | context (.getDataContext (DataManager/getInstance))] |
53 | 53 | (println "Running action:" action-id) |
54 | | - (println "Action:" action) |
55 | 54 | (app-manager/write-command-action |
56 | 55 | project |
57 | 56 | (fn [] |
|
76 | 75 |
|
77 | 76 | ;; Para configurações persistentes via ServiceManager |
78 | 77 | (let [my-settings (ServiceManager/getService SettingsState)] ;; Substitua pela classe real |
79 | | - #_(.setServerPath my-settings "/tmp/clojure-lsp") ;; Atualiza o caminho do servidor |
80 | 78 | (.loadState my-settings my-settings));; Atualiza estado |
81 | | - (println "LSP exists? >> ") |
82 | | - #_(println (.exists (io/as-file "/tmp/clojure-lsp"))) |
83 | | - #_(server/start! project) |
84 | | - |
85 | | - (clj4intellij.test/dispatch-all) |
86 | | - (println "status LSP >> ") |
87 | | - (println (lsp-client/server-status project)) |
88 | | - (println (db/get-in project [:status])) |
89 | | - #_(Thread/sleep 10000) |
| 79 | + |
| 80 | + (clj4intellij.test/dispatch-all) |
90 | 81 | (dispatch-all-until {:project project}) |
91 | | - #_(dispatch-all-until |
92 | | - {:cond-fn (fn [] |
93 | | - (let [status (lsp-client/server-status project)] |
94 | | - (println "Current status:" status) |
95 | | - (= status :started))) |
96 | | - :millis 1000}) |
97 | | - (println "status LSP >> ") |
98 | | - (println (lsp-client/server-status project)) |
99 | | - (println (db/get-in project [:status])) |
100 | | - |
| 82 | + (println "status LSP >> " (db/get-in project [:status])) |
101 | 83 | (let [editor (.getEditor fixture) |
102 | 84 | document (.getDocument editor) |
103 | 85 | offset (.getLineStartOffset document 2) |
104 | 86 | caret (.getCaretModel editor) |
105 | 87 | pos (.getLogicalPosition caret) |
106 | 88 | new-position (LogicalPosition. 2 8)] |
107 | | - (println "editor >> ") |
108 | | - (println editor) |
109 | | - (println caret) |
110 | | - (println pos) |
111 | | - (println (.getVisualPosition caret)) |
112 | 89 | (println (.getText document)) |
113 | 90 | @(app-manager/invoke-later! |
114 | 91 | {:invoke-fn (fn [] |
115 | 92 | #_(.moveToOffset caret (+ offset 9)) |
116 | | - (.moveToLogicalPosition caret new-position))}) |
117 | | - (println (.getLogicalPosition caret)) |
118 | | - (println (.getVisualPosition caret))) |
| 93 | + (.moveToLogicalPosition caret new-position))})) |
119 | 94 | (run-editor-action "ClojureLSP.ForwardSlurp" project) |
120 | | - |
121 | 95 | (clj4intellij.test/dispatch-all) |
122 | | - (println (-> fixture .getEditor .getDocument .getText)) |
123 | | - |
124 | | - #_@(app-manager/invoke-later! |
125 | | - {:invoke-fn (fn [] |
126 | | - (let [widget (get-status-bar-widget project "ClojureLSPStatusBar")] |
127 | | - (println "Widget:" widget) |
128 | | - (is (some? widget))))}) |
129 | | - |
| 96 | + (println (-> fixture .getEditor .getDocument .getText)) |
130 | 97 | (.checkResultByFile fixture "foo_expected.clj") |
131 | 98 | (server/shutdown! project))) |
132 | 99 |
|
|
0 commit comments