|
1 | 1 | (ns com.github.clojure-lsp.intellij.foo-test
|
2 | 2 | (:require
|
| 3 | + [clojure.java.io :as io] |
3 | 4 | [clojure.test :refer [deftest is]]
|
| 5 | + [com.github.clojure-lsp.intellij.client :as lsp-client] |
| 6 | + [com.github.clojure-lsp.intellij.db :as db] |
| 7 | + [com.github.clojure-lsp.intellij.server :as server] |
4 | 8 | [com.github.ericdallo.clj4intellij.app-manager :as app-manager]
|
5 | 9 | [com.github.ericdallo.clj4intellij.test :as clj4intellij.test])
|
6 | 10 | (:import
|
7 |
| - [com.intellij.openapi.wm WindowManager] |
| 11 | + [com.github.clojure_lsp.intellij.extension SettingsState] |
| 12 | + [com.intellij.ide DataManager] |
8 | 13 | [com.intellij.openapi.actionSystem ActionManager]
|
9 |
| - [com.intellij.ide DataManager])) |
| 14 | + [com.intellij.openapi.components ServiceManager] |
| 15 | + [com.intellij.openapi.wm WindowManager])) |
10 | 16 |
|
11 | 17 | (set! *warn-on-reflection* true)
|
12 | 18 |
|
|
45 | 51 | project
|
46 | 52 | (fn [] (.openFileInEditor fixture clj-file)))
|
47 | 53 |
|
| 54 | + ;; Para configurações persistentes via ServiceManager |
| 55 | + (let [my-settings (ServiceManager/getService SettingsState)] ;; Substitua pela classe real |
| 56 | + (.setServerPath my-settings "/tmp/clojure-lsp") ;; Atualiza o caminho do servidor |
| 57 | + (.loadState my-settings my-settings));; Atualiza estado |
| 58 | + (println "LSP exists? >> ") |
| 59 | + (println (.exists (io/as-file "/tmp/clojure-lsp"))) |
| 60 | + (server/start! project) |
| 61 | + |
| 62 | + #_(clj4intellij.test/dispatch-all) |
| 63 | + (println "status LSP >> ") |
| 64 | + (println (lsp-client/server-status project)) |
| 65 | + (println (db/get-in project [:status])) |
| 66 | + (Thread/sleep 10000) |
| 67 | + #_(clj4intellij.test/dispatch-all-until |
| 68 | + {:cond-fn (fn [] (= (db/get-in project [:status]) :started)) |
| 69 | + :millis 3000}) |
| 70 | + (println "status LSP >> ") |
| 71 | + (println (lsp-client/server-status project)) |
| 72 | + (println (db/get-in project [:status])) |
48 | 73 |
|
49 | 74 |
|
50 |
| - (clj4intellij.test/dispatch-all) |
51 |
| - (println "OLAAAA >> ") |
52 | 75 | (run-editor-action "ClojureLSP.ForwardSlurp" project)
|
53 | 76 |
|
54 | 77 | @(app-manager/invoke-later!
|
|
0 commit comments