Skip to content

Use lsp4ij #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b29789d
WIP
ericdallo Jan 17, 2025
38c9d72
Fix status bar
ericdallo Jan 18, 2025
40f4fca
Fix markdown-clj
ericdallo Jan 21, 2025
5e1d2ac
Fix actions register
ericdallo Jan 24, 2025
345d874
Remove unused code
ericdallo Jan 27, 2025
cc2bbd9
refactor
ericdallo Jan 27, 2025
e255bbb
WIP: install server
ericdallo Jan 27, 2025
da34cd2
Add download server
ericdallo Jan 27, 2025
56ae594
Fix uri for jar files
ericdallo Jan 27, 2025
12cadc8
Improve download server
ericdallo Jan 27, 2025
1eb5149
Merge branch 'master' into lsp4ij
ericdallo Jan 28, 2025
fb7cd94
fix start server
ericdallo Jan 28, 2025
0c76894
Fix progress feature
ericdallo Jan 28, 2025
757eae1
Fix command execution for refactors
ericdallo Jan 29, 2025
9cd70ea
docs update
ericdallo Jan 29, 2025
abba58c
docs
ericdallo Jan 29, 2025
d6d9263
improve semantic tokens
ericdallo Jan 29, 2025
8df89df
refactor
ericdallo Jan 29, 2025
9e73dc1
Fix memoize
ericdallo Jan 29, 2025
00c1ba1
Fix reflection
ericdallo Jan 29, 2025
caa08e4
workaround project find
ericdallo Jan 29, 2025
349021a
Support custom serverInfo request
ericdallo Jan 29, 2025
e3c6b0d
Fix server info
ericdallo Jan 30, 2025
b64a2cd
clojure/DependencyContents
ericdallo Jan 30, 2025
6538857
Fix settings state
ericdallo Jan 31, 2025
f284c45
Fix settings
ericdallo Jan 31, 2025
c88dd52
Merge branch 'master' into lsp4ij
ericdallo Jan 31, 2025
c8bf771
Merge branch 'master' into lsp4ij
ericdallo Jan 31, 2025
f65a8da
Merge branch 'master' into lsp4ij
ericdallo Jan 31, 2025
2db388d
Comment clojure dependencyContents for now
ericdallo Feb 3, 2025
08a8206
Fix code lens references command
ericdallo Feb 3, 2025
a1e49a7
Update lsp4ij
ericdallo Feb 4, 2025
e1f85ae
docs
ericdallo Feb 4, 2025
32d8842
docs
ericdallo Feb 4, 2025
01a5958
error catch for commands
ericdallo Feb 4, 2025
4424096
docs paredit
ericdallo Feb 4, 2025
23606c8
docs
ericdallo Feb 4, 2025
b89065d
Add call hierarchy support
ericdallo Feb 4, 2025
79c0312
docs: add document symbols
ericdallo Feb 4, 2025
edfb175
Add codeblock support
ericdallo Feb 4, 2025
1e397ee
Fix startup activity
ericdallo Feb 6, 2025
f280259
refactor
ericdallo Feb 6, 2025
3acd8dd
Fix server keepAlive + status bar update
ericdallo Feb 7, 2025
047f989
Changelog
ericdallo Feb 10, 2025
83b4c01
README
ericdallo Feb 10, 2025
2fe2224
Update lsp4ij min-version
ericdallo Feb 11, 2025
45e3b3c
changelog
ericdallo Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .lsp/config.edn
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{:cljfmt {:indents {proxy+ [[:block 2] [:inner 1]]}}}
{:cljfmt {:indents {proxy+ [[:block 2] [:inner 1]]}}
:project-specs [{:classpath-cmd ["./gradlew" "-q" "classpath"]
:project-path "build.gradle.kts"}
{:classpath-cmd ["clojure" "-Spath"]
:project-path "deps.edn"}]}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Fix brace matcher to insert closing brace for some missing cases.
- Add imcompatible tag with Cursive and Clojure-Kit plugins.
- 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
- Drop support for older intellijs, supporting 2023.3 onwards.

## 2.6.4

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<p align="center">
<a href="https://clojure-lsp.io"><strong>homepage</strong></a> •
<a href="docs/features.md"><strong>features</strong></a> •
<a href="docs/capabilities.md"><strong>capabilities</strong></a> •
<a href="docs/developing.md"><strong>developing</strong></a> •
<!-- <a href="https://clojure-lsp.io/settings"><strong>settings</strong></a> • -->
<a href="docs/troubleshooting.md"><strong>troubleshooting</strong></a> •
Expand All @@ -30,7 +29,7 @@

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.

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.
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.

Also, this plugin does not use official IntelliJ's LSP support yet for 2 reasons:
- It's only available for Ultimate Edition (paid edition), making this plugin only available for those editions.
Expand Down
29 changes: 14 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,13 @@ repositories {
}

dependencies {
implementation ("org.clojure:clojure:1.11.1")
implementation ("org.clojure:clojure:1.12.0")
implementation ("com.github.ericdallo:clj4intellij:0.5.4")
implementation ("seesaw:seesaw:1.5.0")
implementation ("camel-snake-kebab:camel-snake-kebab:0.4.3")
implementation ("babashka:process:0.5.18")
implementation ("com.github.clojure-lsp:lsp4clj:1.9.3")
implementation ("org.clojure:core.async:1.5.648") {
because("issue https://clojure.atlassian.net/browse/ASYNC-248")
}
implementation ("com.github.clojure-lsp:clojure-lsp:2024.03.01-11.37.51") {
exclude("org.clojure", "core.async")
}
implementation ("com.rpl:proxy-plus:0.0.9")
implementation ("markdown-clj:markdown-clj:1.12.1")
implementation ("dev.weavejester:cljfmt:0.13.0")
implementation ("com.github.clojure-lsp:clojure-lsp:2025.01.22-23.28.23")
}

sourceSets {
Expand Down Expand Up @@ -70,16 +63,22 @@ changelog {
}

java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}

tasks.register("classpath") {
doFirst {
println(sourceSets["main"].compileClasspath.asPath)
}
}

tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "11"
apiVersion = "1.5"
languageVersion = "1.5"
jvmTarget = "17"
apiVersion = "1.9"
languageVersion = "1.9"
freeCompilerArgs = listOf("-Xjvm-default=all")
}
}
Expand Down
23 changes: 1 addition & 22 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
{:paths ["src/main/clojure"]
:mvn/repos {"intellij-1" {:url "https://cache-redirector.jetbrains.com/intellij-dependencies"}
"intellij-2" {:url "https://www.jetbrains.com/intellij-repository/releases"}}
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
com.github.ericdallo/clj4intellij {:mvn/version "0.5.4"}
seesaw/seesaw {:mvn/version "1.5.0"}
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
com.github.clojure-lsp/clojure-lsp {:mvn/version "2024.03.01-11.37.51"}
markdown-clj/markdown-clj {:mvn/version "1.12.1"}
com.rpl/proxy-plus {:mvn/version "0.0.9"}}
:aliases {:dev {:deps {nrepl/nrepl {:mvn/version "1.0.0"}
com.jetbrains.intellij.platform/ide-impl {:mvn/version "213.7172.48"
:exclusions [org.jetbrains.kotlin/kotlin-stdlib-jdk8
org.jetbrains.kotlin/kotlin-reflect
org.jetbrains.kotlinx/kotlinx-coroutines-jdk8
org.jetbrains.kotlinx/kotlinx-serialization-json-jvm
org.jetbrains.kotlinx/kotlinx-serialization-core-jvm

com.jetbrains.intellij.platform/external-system-impl
com.jetbrains.intellij.platform/service-container
com.jetbrains.intellij.platform/statistics-devkit
com.jetbrains.infra/download-pgp-verifier]}}}
:build {:extra-paths ["src/main/resources"]
:aliases {:build {:extra-paths ["src/main/resources"]
:deps {io.github.clojure/tools.build {:git/tag "v0.8.1"
:git/sha "7d40500"}
slipset/deps-deploy {:mvn/version "0.2.0"}}
Expand Down
79 changes: 0 additions & 79 deletions docs/capabilities.md

This file was deleted.

32 changes: 28 additions & 4 deletions docs/features.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Features

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/).
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/).

### Find a function/var definition

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

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

> <kbd>Alt</kbd> + <kbd>F7</kbd>
> <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>h</kbd>

![](../images/find-references.png)

### Find all implementations of a defmulti or defprotocol

> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>B</kbd>
> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>g</kbd>

![](../images/find-implementations.png)

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

> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>l</kbd>

### Call hierarchy

> <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>h</kbd>

![](../images/call-hierarchy.png)

### Document symbols

> <kbd>Ctrl/Cmd</kbd> + <kbd>F12</kbd>

![](../images/document-symbols.png)

### Wizard to create new Clojure projects

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

![](../images/code-actions.png)

#### Clean namespaces
#### Clean namespaces (Organize/Optimize imports)

> <kbd>Ctrl/Cmd</kbd> + <kbd>Alt</kbd> + <kbd>o</kbd>

Expand All @@ -70,22 +82,34 @@ This plugin relies on clojure-lsp features, so most work is done there, for more

> <kbd>Alt</kbd> + <kbd>]</kbd>

![](../images/paredit-slurp-forward.gif)

##### Forward barf

> <kbd>Alt</kbd> + <kbd>[</kbd>

![](../images/paredit-barf-forward.gif)

##### Backward slurp

> <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>]</kbd>

![](../images/paredit-slurp-backward.gif)

##### Backward barf

> <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>[</kbd>

![](../images/paredit-barf-backward.gif)

##### Raise sexpr

> <kbd>Alt</kbd> + <kbd>r</kbd>

![](../images/paredit-raise.gif)

##### Kill sexpr

> <kbd>Alt</kbd> + <kbd>k</kbd>

![](../images/paredit-kill.gif)
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Troubleshooting

You can find details about the server in Intellij's `Settings` > `Tools` > `Clojure LSP`.
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).

For more troubleshooting details related to Clojure LSP server, check the [troubleshooting section](https://clojure-lsp.io/troubleshooting/).
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ pluginVersion = 2.6.4

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

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

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IC
platformVersion = 2021.3
platformVersion = 2023.3

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = com.intellij.java
platformPlugins = com.intellij.java, com.redhat.devtools.lsp4ij:0.10.0

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

# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
Expand Down
Binary file added images/call-hierarchy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/code-actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/code-lens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/diagnostics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/document-symbols.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/find-definition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/find-implementations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/find-references.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paredit-barf-backward.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paredit-barf-forward.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paredit-kill.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paredit-raise.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paredit-slurp-backward.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/paredit-slurp-forward.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/rename.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading