Skip to content

Commit 345d874

Browse files
committed
Remove unused code
1 parent 5e1d2ac commit 345d874

File tree

19 files changed

+8
-881
lines changed

19 files changed

+8
-881
lines changed

build.gradle.kts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,9 @@ dependencies {
2727
implementation ("com.github.ericdallo:clj4intellij:0.5.4")
2828
implementation ("seesaw:seesaw:1.5.0")
2929
implementation ("camel-snake-kebab:camel-snake-kebab:0.4.3")
30-
implementation ("babashka:process:0.5.18")
31-
implementation ("com.github.clojure-lsp:lsp4clj:1.9.3")
32-
implementation ("org.clojure:core.async:1.5.648") {
33-
because("issue https://clojure.atlassian.net/browse/ASYNC-248")
34-
}
35-
implementation ("com.github.clojure-lsp:clojure-lsp:2024.03.01-11.37.51") {
36-
exclude("org.clojure", "core.async")
37-
}
3830
implementation ("com.rpl:proxy-plus:0.0.9")
39-
implementation ("markdown-clj:markdown-clj:1.12.1") {
40-
exclude("clj-commons", "clj-yaml")
41-
}
42-
implementation ("clj-commons:clj-yaml:1.0.29")
31+
implementation ("dev.weavejester:cljfmt:0.13.0")
32+
implementation ("com.github.clojure-lsp:clojure-lsp:2025.01.22-23.28.23")
4333
}
4434

4535
sourceSets {

src/main/clojure/com/github/clojure_lsp/intellij/action/implementations.clj

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/main/clojure/com/github/clojure_lsp/intellij/action/refactors.clj

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/main/clojure/com/github/clojure_lsp/intellij/action/references.clj

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
(ns com.github.clojure-lsp.intellij.client
2-
(:require
3-
[lsp4clj.protocols.endpoint :as protocols.endpoint])
42
(:import
53
[com.intellij.openapi.project Project]
64
[com.redhat.devtools.lsp4ij LanguageServerManager]))
75

86
(set! *warn-on-reflection* true)
97

10-
(defmulti show-message (fn [_context args] args))
11-
(defmulti show-document (fn [_context args] args))
12-
(defmulti show-message-request identity)
13-
(defmulti progress (fn [_context {:keys [token]}] token))
14-
(defmulti workspace-apply-edit (fn [_context {:keys [label]}] label))
15-
16-
(defn request! [client [method body]]
17-
(protocols.endpoint/send-request client (subs (str method) 1) body))
18-
19-
(defn notify! [client [method body]]
20-
(protocols.endpoint/send-notification client (subs (str method) 1) body))
21-
22-
(defn connected-server [^Project project]
23-
(when-let [manager (LanguageServerManager/getInstance project)]
24-
@(.getLanguageServer manager "clojure-lsp")))
25-
268
(defn server-status [^Project project]
279
(when-let [manager (LanguageServerManager/getInstance project)]
2810
(keyword (.toString (.getServerStatus manager "clojure-lsp")))))

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
(:require
33
[clojure.java.io :as io])
44
(:import
5-
[com.intellij.openapi.project Project]
65
[java.io File]))
76

87
(set! *warn-on-reflection* true)
@@ -17,6 +16,3 @@
1716

1817
(defn download-server-version-path ^File []
1918
(io/file (plugin-path) "clojure-lsp-version"))
20-
21-
(defn project-cache-path ^File [^Project project]
22-
(io/file (plugin-path) "cache" (.getName project)))

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
(ns com.github.clojure-lsp.intellij.db
22
(:refer-clojure :exclude [get-in assoc-in update-in])
3-
(:require
4-
[clojure.core.async :as async])
53
(:import
64
[com.github.clojure_lsp.intellij.extension SettingsState]
75
[com.intellij.openapi.project Project]))
@@ -21,9 +19,6 @@
2119

2220
(defonce db* (atom {:projects {}}))
2321

24-
(defn empty-db? []
25-
(empty? (:projects @db*)))
26-
2722
(defn get-in
2823
([project fields]
2924
(get-in project fields nil))
@@ -42,15 +37,6 @@
4237
projects
4338
(update projects (.getBasePath project) #(merge (assoc empty-project :project project) %))))))
4439

45-
(defn await-field [project field fn]
46-
(async/thread
47-
(loop []
48-
(Thread/sleep 100)
49-
(let [value (get-in project [field])]
50-
(if value
51-
(fn value)
52-
(recur))))))
53-
5440
(defn load-settings-from-state! [^Project project ^SettingsState settings-state]
5541
(update-in project [:settings] (fn [settings]
5642
(if-not (:loaded-settings? settings)
Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,13 @@
11
(ns com.github.clojure-lsp.intellij.editor
22
(:require
3-
[clojure-lsp.shared :as lsp.shared]
4-
[com.github.clojure-lsp.intellij.editor :as editor]
5-
[com.github.ericdallo.clj4intellij.util :as util])
3+
[com.github.clojure-lsp.intellij.editor :as editor])
64
(:import
7-
[com.intellij.openapi.editor Document Editor]
8-
[com.intellij.openapi.fileEditor
9-
FileDocumentManager]
10-
[com.intellij.openapi.project Project ProjectLocator]
11-
[com.intellij.openapi.util TextRange]
12-
[com.intellij.openapi.util.text StringUtil]
13-
[com.intellij.openapi.vfs VirtualFile]
14-
[com.intellij.psi PsiFile]
15-
[com.intellij.psi PsiManager]))
5+
[com.intellij.openapi.editor Editor]
6+
[com.intellij.openapi.util.text StringUtil]))
167

178
(set! *warn-on-reflection* true)
189

1910
(defn offset->cursor-position [^Editor editor offset]
2011
(let [text (.getCharsSequence (.getDocument editor))
2112
line-col (StringUtil/offsetToLineColumn text offset)]
2213
[(.line line-col) (.column line-col)]))
23-
24-
(defn position->offset [text line character]
25-
(StringUtil/lineColToOffset text line character))
26-
27-
(defn document+position->offset ^Integer [{:keys [line character]} ^Document document]
28-
(position->offset (.getText document) line character))
29-
30-
(defn range->text-range ^TextRange [range ^Document document]
31-
(TextRange/create (document+position->offset (:start range) document)
32-
(document+position->offset (:end range) document)))
33-
34-
(defn text-range->range [^TextRange range ^Editor editor]
35-
{:start (offset->cursor-position editor (.getStartOffset range))
36-
:end (offset->cursor-position editor (.getEndOffset range))})
37-
38-
(defn uri->psi-file ^PsiFile [^String uri ^Project project]
39-
(.findFile (PsiManager/getInstance project)
40-
(util/uri->v-file uri)))
41-
42-
(defn editor->uri [^Editor editor]
43-
;; TODO sanitize URL, encode, etc
44-
(.getUrl (.getFile (FileDocumentManager/getInstance) (.getDocument editor))))
45-
46-
(defn filename->project-relative-filename [filename ^Project project]
47-
(lsp.shared/relativize-filepath
48-
filename
49-
(.getBasePath project)))
50-
51-
(defn virtual->psi-file ^PsiFile [^VirtualFile v-file ^Project project]
52-
(.findFile (PsiManager/getInstance project) v-file))
53-
54-
(defn v-file->project ^Project [^VirtualFile v-file]
55-
(.guessProjectForFile (ProjectLocator/getInstance)
56-
v-file))

0 commit comments

Comments
 (0)