Skip to content

Commit 183d89b

Browse files
authored
Use lsp4ij (#60)
* WIP * Fix status bar * Fix markdown-clj * Fix actions register * Remove unused code * refactor * WIP: install server * Add download server * Fix uri for jar files * Improve download server * fix start server * Fix progress feature * Fix command execution for refactors * docs update * docs * improve semantic tokens * refactor * Fix memoize * Fix reflection * workaround project find * Support custom serverInfo request * Fix server info * clojure/DependencyContents * Fix settings state * Fix settings * Comment clojure dependencyContents for now * Fix code lens references command * Update lsp4ij * docs * docs * error catch for commands * docs paredit * docs * Add call hierarchy support * docs: add document symbols * Add codeblock support * Fix startup activity * refactor * Fix server keepAlive + status bar update * Changelog * README * Update lsp4ij min-version * changelog
1 parent af82d97 commit 183d89b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+527
-1883
lines changed

.lsp/config.edn

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
{:cljfmt {:indents {proxy+ [[:block 2] [:inner 1]]}}}
1+
{:cljfmt {:indents {proxy+ [[:block 2] [:inner 1]]}}
2+
:project-specs [{:classpath-cmd ["./gradlew" "-q" "classpath"]
3+
:project-path "build.gradle.kts"}
4+
{:classpath-cmd ["clojure" "-Spath"]
5+
:project-path "deps.edn"}]}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- Fix brace matcher to insert closing brace for some missing cases.
66
- Add imcompatible tag with Cursive and Clojure-Kit plugins.
7+
- Integrate with lsp4ij, a LSP client plugin, removing lots of logics from this plugin and fixing multiple bugs and issues. Fixes #63, #61, #59, #57, #53, #36, #21, #9, #5
8+
- Drop support for older intellijs, supporting 2023.3 onwards.
79

810
## 2.6.4
911

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<p align="center">
1919
<a href="https://clojure-lsp.io"><strong>homepage</strong></a> •
2020
<a href="docs/features.md"><strong>features</strong></a> •
21-
<a href="docs/capabilities.md"><strong>capabilities</strong></a> •
2221
<a href="docs/developing.md"><strong>developing</strong></a> •
2322
<!-- <a href="https://clojure-lsp.io/settings"><strong>settings</strong></a> • -->
2423
<a href="docs/troubleshooting.md"><strong>troubleshooting</strong></a> •
@@ -30,7 +29,7 @@
3029

3130
IntelliJ is the only mainstream editor without a plugin with good, free, and dedicated support for LSP, there are already excellent plugins for Clojure like [Cursive](https://cursive-ide.com/) which provides lots of features with REPL support or [ClojureKit](https://github.com/gregsh/Clojure-Kit) which adds basic Clojure support for the language, but none uses clojure-lsp or follows the LSP standard which some users may prefer as [some features](https://clojure-lsp.io/features/) are only available in clojure-lsp.
3231

33-
Keep in mind that this plugin provides only LSP features relying on clojure-lsp (and clj-kondo under the hood) static analysis, so no runtime features exist, like REPL integration or support, for that a separated plugin is needed as it's not possible to use only the REPL part of other plugins like Cursive together with this plugin.
32+
Keep in mind that this plugin provides only LSP features relying on clojure-lsp (and clj-kondo under the hood) static analysis, so no runtime features exist, like REPL integration or support, for that a separated plugin like [clojure-repl-intellij](https://github.com/afucher/clojure-repl-intellij) is recommended as it's not possible to use only the REPL part of other plugins like Cursive together with this plugin.
3433

3534
Also, this plugin does not use official IntelliJ's LSP support yet for 2 reasons:
3635
- It's only available for Ultimate Edition (paid edition), making this plugin only available for those editions.

build.gradle.kts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,13 @@ repositories {
2323
}
2424

2525
dependencies {
26-
implementation ("org.clojure:clojure:1.11.1")
26+
implementation ("org.clojure:clojure:1.12.0")
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")
31+
implementation ("dev.weavejester:cljfmt:0.13.0")
32+
implementation ("com.github.clojure-lsp:clojure-lsp:2025.01.22-23.28.23")
4033
}
4134

4235
sourceSets {
@@ -70,16 +63,22 @@ changelog {
7063
}
7164

7265
java {
73-
targetCompatibility = JavaVersion.VERSION_11
74-
sourceCompatibility = JavaVersion.VERSION_11
66+
targetCompatibility = JavaVersion.VERSION_17
67+
sourceCompatibility = JavaVersion.VERSION_17
68+
}
69+
70+
tasks.register("classpath") {
71+
doFirst {
72+
println(sourceSets["main"].compileClasspath.asPath)
73+
}
7574
}
7675

7776
tasks {
7877
compileKotlin {
7978
kotlinOptions {
80-
jvmTarget = "11"
81-
apiVersion = "1.5"
82-
languageVersion = "1.5"
79+
jvmTarget = "17"
80+
apiVersion = "1.9"
81+
languageVersion = "1.9"
8382
freeCompilerArgs = listOf("-Xjvm-default=all")
8483
}
8584
}

deps.edn

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
{:paths ["src/main/clojure"]
2-
:mvn/repos {"intellij-1" {:url "https://cache-redirector.jetbrains.com/intellij-dependencies"}
3-
"intellij-2" {:url "https://www.jetbrains.com/intellij-repository/releases"}}
4-
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
5-
com.github.ericdallo/clj4intellij {:mvn/version "0.5.4"}
6-
seesaw/seesaw {:mvn/version "1.5.0"}
7-
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
8-
com.github.clojure-lsp/clojure-lsp {:mvn/version "2024.03.01-11.37.51"}
9-
markdown-clj/markdown-clj {:mvn/version "1.12.1"}
10-
com.rpl/proxy-plus {:mvn/version "0.0.9"}}
11-
:aliases {:dev {:deps {nrepl/nrepl {:mvn/version "1.0.0"}
12-
com.jetbrains.intellij.platform/ide-impl {:mvn/version "213.7172.48"
13-
:exclusions [org.jetbrains.kotlin/kotlin-stdlib-jdk8
14-
org.jetbrains.kotlin/kotlin-reflect
15-
org.jetbrains.kotlinx/kotlinx-coroutines-jdk8
16-
org.jetbrains.kotlinx/kotlinx-serialization-json-jvm
17-
org.jetbrains.kotlinx/kotlinx-serialization-core-jvm
18-
19-
com.jetbrains.intellij.platform/external-system-impl
20-
com.jetbrains.intellij.platform/service-container
21-
com.jetbrains.intellij.platform/statistics-devkit
22-
com.jetbrains.infra/download-pgp-verifier]}}}
23-
:build {:extra-paths ["src/main/resources"]
2+
:aliases {:build {:extra-paths ["src/main/resources"]
243
:deps {io.github.clojure/tools.build {:git/tag "v0.8.1"
254
:git/sha "7d40500"}
265
slipset/deps-deploy {:mvn/version "0.2.0"}}

docs/capabilities.md

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

docs/features.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Features
22

3-
This plugin relies on clojure-lsp features, so most work is done there, for more detailed information about all clojure-lsp features, check the [server documentation](https://clojure-lsp.io/features/).
3+
This plugin relies on [clojure-lsp](https://clojure-lsp.io/) features and [lsp4ij](https://github.com/redhat-developer/lsp4ij), so most work is done there, for more detailed information about all clojure-lsp features, check the [server documentation](https://clojure-lsp.io/features/).
44

55
### Find a function/var definition
66

@@ -10,13 +10,13 @@ This plugin relies on clojure-lsp features, so most work is done there, for more
1010

1111
### Find all references of a function, var, keyword or namespace alias
1212

13-
> <kbd>Alt</kbd> + <kbd>F7</kbd>
13+
> <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>h</kbd>
1414
1515
![](../images/find-references.png)
1616

1717
### Find all implementations of a defmulti or defprotocol
1818

19-
> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>B</kbd>
19+
> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>g</kbd>
2020
2121
![](../images/find-implementations.png)
2222

@@ -50,6 +50,18 @@ This plugin relies on clojure-lsp features, so most work is done there, for more
5050

5151
> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>l</kbd>
5252
53+
### Call hierarchy
54+
55+
> <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>h</kbd>
56+
57+
![](../images/call-hierarchy.png)
58+
59+
### Document symbols
60+
61+
> <kbd>Ctrl/Cmd</kbd> + <kbd>F12</kbd>
62+
63+
![](../images/document-symbols.png)
64+
5365
### Wizard to create new Clojure projects
5466

5567
![](../images/wizard.png)
@@ -60,7 +72,7 @@ This plugin relies on clojure-lsp features, so most work is done there, for more
6072
6173
![](../images/code-actions.png)
6274

63-
#### Clean namespaces
75+
#### Clean namespaces (Organize/Optimize imports)
6476

6577
> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>o</kbd>
6678
@@ -70,22 +82,34 @@ This plugin relies on clojure-lsp features, so most work is done there, for more
7082

7183
> <kbd>Alt</kbd> + <kbd>]</kbd>
7284
85+
![](../images/paredit-slurp-forward.gif)
86+
7387
##### Forward barf
7488

7589
> <kbd>Alt</kbd> + <kbd>[</kbd>
7690
91+
![](../images/paredit-barf-forward.gif)
92+
7793
##### Backward slurp
7894

7995
> <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>]</kbd>
8096
97+
![](../images/paredit-slurp-backward.gif)
98+
8199
##### Backward barf
82100

83101
> <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>[</kbd>
84102
103+
![](../images/paredit-barf-backward.gif)
104+
85105
##### Raise sexpr
86106

87107
> <kbd>Alt</kbd> + <kbd>r</kbd>
88108
109+
![](../images/paredit-raise.gif)
110+
89111
##### Kill sexpr
90112

91113
> <kbd>Alt</kbd> + <kbd>k</kbd>
114+
115+
![](../images/paredit-kill.gif)

docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Troubleshooting
22

3-
You can find details about the server in Intellij's `Settings` > `Tools` > `Clojure LSP`.
3+
You can find details about the server in Intellij's `Settings` > `Tools` > `Clojure LSP` or checking [lsp4ij troubleshooting](https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserGuide.md).
44

55
For more troubleshooting details related to Clojure LSP server, check the [troubleshooting section](https://clojure-lsp.io/troubleshooting/).

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ pluginVersion = 2.6.4
77

88
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
# for insight into build numbers and IntelliJ Platform versions.
10-
pluginSinceBuild = 213
10+
pluginSinceBuild = 233
1111

1212
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
1313
# See https://jb.gg/intellij-platform-builds-list for available build versions.
14-
pluginVerifierIdeVersions = 2021.3.3, 2022.1, 2022.2, 2022.3, 2023.1, 2023.2
14+
pluginVerifierIdeVersions = 2023.3
1515

1616
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1717
platformType = IC
18-
platformVersion = 2021.3
18+
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
22+
platformPlugins = com.intellij.java, com.redhat.devtools.lsp4ij:0.10.0
2323

2424
# Gradle Releases -> https://github.com/gradle/gradle/releases
25-
gradleVersion = 7.6.1
25+
gradleVersion = 8.5
2626

2727
# Opt-out flag for bundling Kotlin standard library.
2828
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.

images/call-hierarchy.png

186 KB
Loading

images/code-actions.png

-49.8 KB
Loading

images/code-lens.png

-12.3 KB
Loading

images/completion.png

156 Bytes
Loading

images/diagnostics.png

1.41 KB
Loading

images/document-symbols.png

117 KB
Loading

images/find-definition.png

-133 KB
Loading

images/find-implementations.png

-62.4 KB
Loading

images/find-references.png

-130 KB
Loading

images/hover.png

-69.5 KB
Loading

images/paredit-barf-backward.gif

4.64 KB
Loading

images/paredit-barf-forward.gif

8.62 KB
Loading

images/paredit-kill.gif

4.63 KB
Loading

images/paredit-raise.gif

5.85 KB
Loading

images/paredit-slurp-backward.gif

4.35 KB
Loading

images/paredit-slurp-forward.gif

30.5 KB
Loading

images/rename.png

-71.4 KB
Loading

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

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

0 commit comments

Comments
 (0)