Skip to content

Commit f67bb03

Browse files
committed
set lsp server path
1 parent 0c28fcd commit f67bb03

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

src/test/clojure/com/github/clojure_lsp/intellij/foo_test.clj

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
(ns com.github.clojure-lsp.intellij.foo-test
22
(:require
3+
[clojure.java.io :as io]
34
[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]
48
[com.github.ericdallo.clj4intellij.app-manager :as app-manager]
59
[com.github.ericdallo.clj4intellij.test :as clj4intellij.test])
610
(:import
7-
[com.intellij.openapi.wm WindowManager]
11+
[com.github.clojure_lsp.intellij.extension SettingsState]
12+
[com.intellij.ide DataManager]
813
[com.intellij.openapi.actionSystem ActionManager]
9-
[com.intellij.ide DataManager]))
14+
[com.intellij.openapi.components ServiceManager]
15+
[com.intellij.openapi.wm WindowManager]))
1016

1117
(set! *warn-on-reflection* true)
1218

@@ -45,10 +51,27 @@
4551
project
4652
(fn [] (.openFileInEditor fixture clj-file)))
4753

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]))
4873

4974

50-
(clj4intellij.test/dispatch-all)
51-
(println "OLAAAA >> ")
5275
(run-editor-action "ClojureLSP.ForwardSlurp" project)
5376

5477
@(app-manager/invoke-later!

testdata/foo.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(ns foo)
22

3-
(println "Oiii")
3+
(println) "Oiii"

testdata/foo_expected.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(ns foo)
22

3-
(println "Olaa")
3+
(println "Oiii")

0 commit comments

Comments
 (0)