Skip to content

Commit a08c7b6

Browse files
committed
Improve download server
1 parent 56ae594 commit a08c7b6

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

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

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
(:require
66
[clojure.string :as string]
77
[com.github.clojure-lsp.intellij.server :as server]
8-
[com.github.ericdallo.clj4intellij.logger :as logger]
98
[com.rpl.proxy-plus :refer [proxy+]])
109
(:import
1110
[com.intellij.execution.configurations GeneralCommandLine]
@@ -26,12 +25,11 @@
2625
:path nil}))
2726

2827
(defn -createConnectionProvider [_ ^Project _project]
29-
(logger/info "---> connection" (:path @server))
30-
(let [server-path (or (some-> ^File (:path @server)
31-
(.getCanonicalPath))
32-
"mocked-server-path")
28+
(let [server-path (loop []
29+
(Thread/sleep 100)
30+
(or (some-> ^File (:path @server) .getCanonicalPath)
31+
(recur)))
3332
command [server-path "listen"]]
34-
(logger/info "--------> starting" command)
3533
(doto (proxy+
3634
[]
3735
OSProcessStreamConnectionProvider)
@@ -51,23 +49,19 @@
5149
(swap! server assoc :status status :path path)))
5250
(server/start! project))
5351

54-
;; TODO client features
5552
(defn -createClientFeatures [_]
5653
(proxy+ [] LSPClientFeatures
5754
(isEnabled [_this ^VirtualFile file]
58-
(logger/info "---> checking isEnabled")
59-
(let [r (case (:status @server)
60-
:installing
61-
false
55+
(case (:status @server)
56+
:installing
57+
false
6258

63-
:installed
64-
true
59+
:installed
60+
true
6561

66-
:not-found
67-
(do (install-server (.guessProjectForFile (ProjectLocator/getInstance) file))
68-
false))]
69-
(logger/info "-----> isEnabled result" r)
70-
r))
62+
:not-found
63+
(do (install-server (.guessProjectForFile (ProjectLocator/getInstance) file))
64+
false)))
7165
(initializeParams [_ ^InitializeParams params]
7266
(.setWorkDoneToken params "clojure-lsp-startup")
7367
(.setInitializationOptions params {"dependency-scheme" "jar"

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

Lines changed: 1 addition & 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 "LSP: Downloading clojure-lsp")
56+
(tasks/set-progress indicator "Clojure LSP: downloading server")
5757
(let [platform (os-name)
5858
arch (os-arch)
5959
artifact-name (get-in artifacts [platform arch])
@@ -75,7 +75,6 @@
7575
project
7676
"Clojure LSP download"
7777
(fn [indicator]
78-
(tasks/set-progress indicator "Clojure LSP: downloading server")
7978
(let [download-path (config/download-server-path)
8079
server-version-path (config/download-server-version-path)
8180
latest-version* (delay (try (string/trim (slurp latest-version-uri)) (catch Exception _ nil)))

src/main/resources/META-INF/plugin.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
name="Clojure LSP"
1212
factoryClass="com.github.clojure_lsp.intellij.extension.LanguageServerFactory">
1313
<description><![CDATA[
14-
Clojure LSP description TODO
14+
### Clojure LSP: The Clojure language server that provides features using static analysis.
15+
16+
#### For more details, check [clojure-lsp.io](https://clojure-lsp.io)
1517
]]>
1618
</description>
1719
</server>

0 commit comments

Comments
 (0)