Skip to content
New issue

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

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

Already on GitHub? # to your account

[doc] Intellij setup: Cursive/Ultimate not required #802

Merged

Conversation

timothypratley
Copy link
Contributor

Updates the install instructions for people without Cursive/Ultimate

Fixes #786

Updates the install instructions for people without Cursive/Ultimate
@borkdude
Copy link
Member

borkdude commented Mar 12, 2020

@timothypratley Feedback:

The LSP server does not provide features other than diagnostics, so if you are unsure, prefer the File Watchers approach.

Can you remove the addition you did there? , so if you are unsure, prefer the File Watchers approach.. Some people have report a more fluid experience with the LSP server than the File Watchers approach. Also you don't need to install a binary, which may another benefit. So I don't think I agree with the addition to that sentence. The File Watcher approach also only offers diagnostics, so it's not even logical to add it to that phrase. This sentence is there to clarify that the LSP server does not offer refactoring and navigation support.

Cursive automatically creates these file types, but if you don't use Cursive, you can still register clj filetypes2.

I've tried this a while before. I uninstalled Cursive and tried to make these filetypes myself, but somehow I couldn't get it to work. I even remember posting an issue about this to Jetbrains:

https://youtrack.jetbrains.com/issue/WEB-38366?p=IDEA-210755

Can you verify if what you wrote really works?

@timothypratley
Copy link
Contributor Author

RE 2:
a) ClojureKit -- works great with clj-kondo following the instructions
b) Cursive -- works great with clj-kondo following the instructions
c) No plugins -- puts a grey line which if you hover over it shows the lint warning messages... but it does underline all text in the file, not scoped to the appropriate location. it is annoying that IntelliJ underlines the whole file; maybe it requires some minimal AST knowledge. clj-kondo is definitely doing the right thing and the warnings are available to the user, but the presentation suffers.
Using clj-kondo in IntelliJ with no plugins is inadvisable, it makes sense to encourage users to install either Cursive or ClojureKit which means they don't have to create the filetypes either.

RE 1:
Taking a step back; one of the reasons I was a slow adopter of clj-kondo was confusion between what these options offered me. Clearly I came away with the wrong interpretation 😄 I think it is valuable to provide some guidance to new users who are unable to decide the tradeoffs upfront. I previously thought that the descriptions meant that LSP was more limited than File Watchers, until now. In your opinion is it that:
LSP should be preferred, or that they are identical?
I'll play around with LSP mode to try to understand more.

Screen Shot 2020-03-12 at 2 47 20 PM

Screen Shot 2020-03-12 at 2 55 12 PM

@borkdude
Copy link
Member

You might be right that it can be overwhelming to offer multiple choices without a clear explanation when to choose what.

As of now I think the following trade-offs can be made:

  • LSP: no installation of the binary required. It does require some manual configuration (downloading a jar, installing a plugin). Earlier this was a nice option on Windows when the binary didn't work there.

  • FileWatchers with Cursive or ClojureKit: additional binary installation (via e.g. brew or download) required.

The experience should be exactly the same for all of these options, although some users have suggested that LSP feedback was running smoother for them.

I don't have a strong preference for either approach / plugin.

@timothypratley
Copy link
Contributor Author

Just adding some observations about LSP after trying it out:

a) LSP setup requires fewer steps
b) LSP provides Clojure syntax highlighting (without either ClojureKit or Cursive)
c) LSP highlights the warnings slightly differently from Cursive+Filewatchers, screenshots below. FWIW I subjectively prefer the Cursive+Filewatchers output. The LSP one is a light yellow that appears on one character. The Cursive+Filewatchers one is grey and underlines the relevant word.
d) Filewatchers uses the currently installed version of clj-kondo, which is a feature for me as my workmates use a pinned version for consistency in our build tools, and when I want to use other versions I can upgrade with brew and downgrade conveniently. Downloading a jar means I'm in charge of versioning manually. But for some people not having to install is a feature.

Your summary accurately describes the tradeoffs. I'll revisit the PR later tonight.

@timothypratley
Copy link
Contributor Author

LSP
lsp

Cursive + Filewatcher
filewatcher

@borkdude
Copy link
Member

Thanks. The syntax highlighting in LSP: no idea where that comes from. I didn't implement anything specific to syntax highlighting.

Also some minor formatting as the list numbers rendered were out of sync
with the numbering that was rendered in the Markup
@timothypratley
Copy link
Contributor Author

Updated as discussed; LMK if this accurately captures how you would like to present the information.

@borkdude borkdude merged commit 703425d into clj-kondo:master Mar 14, 2020
@borkdude
Copy link
Member

Thanks!

@timothypratley timothypratley deleted the tim/786/fix-intellij-non-cursive branch March 15, 2020 04:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document setting up clj-kondo with Clojure-Kit on IntelliJ
2 participants