Skip to content

Commit 3acd8dd

Browse files
committed
Fix server keepAlive + status bar update
1 parent f280259 commit 3acd8dd

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ platformVersion = 2023.3
1919

2020
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
2121
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
22-
platformPlugins = com.intellij.java, com.redhat.devtools.lsp4ij:0.10.0-20250204-093530@nightly
22+
platformPlugins = com.intellij.java, com.redhat.devtools.lsp4ij:0.10.0-20250207-140319@nightly
2323

2424
# Gradle Releases -> https://github.com/gradle/gradle/releases
2525
gradleVersion = 8.5

src/main/clojure/com/github/clojure_lsp/intellij/extension/init_db_startup.clj

+3-16
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@
44
:implements [com.intellij.openapi.startup.StartupActivity
55
com.intellij.openapi.project.DumbAware])
66
(:require
7-
[com.github.clojure-lsp.intellij.db :as db]
8-
[com.rpl.proxy-plus :refer [proxy+]])
7+
[com.github.clojure-lsp.intellij.db :as db])
98
(:import
10-
[com.intellij.openapi.project Project]
11-
[com.redhat.devtools.lsp4ij LanguageServerWrapper]
12-
[com.redhat.devtools.lsp4ij.lifecycle LanguageServerLifecycleListener LanguageServerLifecycleManager]))
9+
[com.intellij.openapi.project Project]))
1310

1411
(set! *warn-on-reflection* true)
1512

1613
(defn -runActivity [_this ^Project project]
17-
(db/init-db-for-project project)
18-
(.addLanguageServerLifecycleListener
19-
(LanguageServerLifecycleManager/getInstance project)
20-
(proxy+ [] LanguageServerLifecycleListener
21-
(handleStatusChanged [_ ^LanguageServerWrapper server-wrapper]
22-
(let [status (keyword (.toString (.getServerStatus server-wrapper)))]
23-
(db/assoc-in project [:status] status)
24-
(run! #(% status) (db/get-in project [:on-status-changed-fns]))))
25-
(handleLSPMessage [_ _ _ _])
26-
(handleError [_ _ _])
27-
(dispose [_]))))
14+
(db/init-db-for-project project))

src/main/clojure/com/github/clojure_lsp/intellij/extension/language_server_factory.clj

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[clojure.string :as string]
88
[com.github.clojure-lsp.intellij.client :as lsp-client]
99
[com.github.clojure-lsp.intellij.config :as config]
10+
[com.github.clojure-lsp.intellij.db :as db]
1011
[com.github.clojure-lsp.intellij.editor :as editor]
1112
[com.github.clojure-lsp.intellij.server :as server]
1213
[com.github.clojure-lsp.intellij.settings :as settings]
@@ -16,7 +17,7 @@
1617
[com.intellij.openapi.progress ProgressIndicator]
1718
[com.intellij.openapi.project Project]
1819
[com.intellij.openapi.vfs LocalFileSystem VirtualFile]
19-
[com.redhat.devtools.lsp4ij LSPIJUtils]
20+
[com.redhat.devtools.lsp4ij LSPIJUtils ServerStatus]
2021
[com.redhat.devtools.lsp4ij.client LanguageClientImpl]
2122
[com.redhat.devtools.lsp4ij.client.features LSPClientFeatures LSPProgressFeature]
2223
[com.redhat.devtools.lsp4ij.server OSProcessStreamConnectionProvider]
@@ -111,7 +112,12 @@
111112
(.setInitializationOptions params {"dependency-scheme" "jar"
112113
"hover" {"arity-on-same-line?" true}}))
113114
(findFileByUri ^VirtualFile [_ ^String uri]
114-
(find-file-by-uri uri)))
115+
(find-file-by-uri uri))
116+
(keepServerAlive [_] true)
117+
(handleServerStatusChanged [^LSPClientFeatures this ^ServerStatus server-status]
118+
(let [status (keyword (.toString server-status))]
119+
(db/assoc-in (.getProject this) [:status] status)
120+
(run! #(% status) (db/get-in (.getProject this) [:on-status-changed-fns])))))
115121
(.setProgressFeature (proxy+ [] LSPProgressFeature
116122
(updateMessage [_ ^String message ^ProgressIndicator indicator]
117123
(.setText indicator (str "LSP: " message)))))))

0 commit comments

Comments
 (0)