Skip to content

Commit 0c76894

Browse files
committed
Fix progress feature
1 parent fb7cd94 commit 0c76894

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
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-20250124-080922@nightly
22+
platformPlugins = com.intellij.java, com.redhat.devtools.lsp4ij:0.10.0-20250128-001632@nightly
2323

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

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

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
[com.rpl.proxy-plus :refer [proxy+]])
99
(:import
1010
[com.intellij.execution.configurations GeneralCommandLine]
11+
[com.intellij.openapi.progress ProgressIndicator]
1112
[com.intellij.openapi.project Project ProjectLocator]
1213
[com.intellij.openapi.vfs VirtualFile]
1314
[com.redhat.devtools.lsp4ij LSPIJUtils]
1415
[com.redhat.devtools.lsp4ij.client LanguageClientImpl]
15-
[com.redhat.devtools.lsp4ij.client.features LSPClientFeatures]
16+
[com.redhat.devtools.lsp4ij.client.features LSPClientFeatures LSPProgressFeature]
1617
[com.redhat.devtools.lsp4ij.server OSProcessStreamConnectionProvider]
1718
[java.io File]
1819
[java.util List]
@@ -50,24 +51,28 @@
5051
(server/start! project))))
5152

5253
(defn -createClientFeatures [_]
53-
(proxy+ [] LSPClientFeatures
54-
(isEnabled [_this ^VirtualFile file]
55-
(case (:status @server)
56-
:installing
57-
false
54+
(doto
55+
(proxy+ [] LSPClientFeatures
56+
(isEnabled [_this ^VirtualFile file]
57+
(case (:status @server)
58+
:installing
59+
false
5860

59-
:installed
60-
true
61+
:installed
62+
true
6163

62-
:not-found
63-
(do (install-server (.guessProjectForFile (ProjectLocator/getInstance) file))
64-
false)))
65-
(initializeParams [_ ^InitializeParams params]
66-
(.setWorkDoneToken params "clojure-lsp-startup")
67-
(.setInitializationOptions params {"dependency-scheme" "jar"
68-
"hover" {"arity-on-same-line?" true}}))
69-
(findFileByUri [_ ^String uri]
70-
(if (and (string/starts-with? uri "file:")
71-
(string/includes? uri ".jar!"))
72-
(LSPIJUtils/findResourceFor (string/replace-first uri "file:" "jar:file:"))
73-
(LSPIJUtils/findResourceFor uri)))))
64+
:not-found
65+
(do (install-server (.guessProjectForFile (ProjectLocator/getInstance) file))
66+
false)))
67+
(initializeParams [_ ^InitializeParams params]
68+
(.setWorkDoneToken params "clojure-lsp-startup")
69+
(.setInitializationOptions params {"dependency-scheme" "jar"
70+
"hover" {"arity-on-same-line?" true}}))
71+
(findFileByUri [_ ^String uri]
72+
(if (and (string/starts-with? uri "file:")
73+
(string/includes? uri ".jar!"))
74+
(LSPIJUtils/findResourceFor (string/replace-first uri "file:" "jar:file:"))
75+
(LSPIJUtils/findResourceFor uri))))
76+
(.setProgressFeature (proxy+ [] LSPProgressFeature
77+
(updateMessage [_ ^String message ^ProgressIndicator indicator]
78+
(.setText indicator (str "LSP: " message)))))))

src/main/clojure/com/github/clojure_lsp/intellij/server.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
(recur (.getNextEntry stream))))))
5454

5555
(defn ^:private download-server! [project indicator ^File download-path ^File server-version-path latest-version]
56-
(tasks/set-progress indicator "Clojure LSP: downloading server")
56+
(tasks/set-progress indicator "LSP: downloading clojure-lsp")
5757
(let [platform (os-name)
5858
arch (os-arch)
5959
artifact-name (get-in artifacts [platform arch])
@@ -73,7 +73,7 @@
7373
(defn install-server [project installed-fn]
7474
(tasks/run-background-task!
7575
project
76-
"Clojure LSP download"
76+
"LSP: install clojure-lsp"
7777
(fn [indicator]
7878
(let [download-path (config/download-server-path)
7979
server-version-path (config/download-server-version-path)

0 commit comments

Comments
 (0)