This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hey @cfleming! 👋 I'm about to launch https://github.com/clojure-lsp/clojure-lsp-intellij which is a new plugin that allows integration with https://clojure-lsp.io/, and I'd like to know if it's possible to make cursive work together with that plugin, specifically the REPL part.
I noticed that both plugins can't be opened together because of the language declared in plugin.xml which is Clojure
, but I kind of worked around that making my plugin language be clojure
, and then after startup select the extension to be used by clojure-lsp but then the Cursive's REPL doesn't recognize the clojure files anymore, is there a way to make that work?
So, I’m not sure, but I suspect that would be complicated. There’s a lot of machinery under the hood for the REPL stuff. How would you see the integration working? It seems to me that your plugin would pretty much do what Cursive does anyway, right?
TBH would be awesome to not even need to declare parser and lexers as clojure-lsp already has all of that , but intellij doesn't like that
Yeah, but the static part is already working, so I was thinking that some users would like to use clojure-lsp-intellij for the static support like code lens, definition, references etc and leave the REPL part for Cursive
What would this offer over using the existing clj-extras-plugin, which if I understand correctly also can use clojure-lsp for that stuff via clj-kondo?
• Code lens • more diagnostics that are not available in kondo like unused public var, clj-depend • code actions from LSP And a bunch more from https://clojure-lsp.io/features/
clj-extras uses only clj-kondo, not clojure-lsp, also, it uses only diagnostics features, clojure-lsp has more
Ok. Well, I suspect that the integration would be tricky. Like I say, there’s a lot of machinery there. You could look for inspiration at the Dart plugin which uses an LSP-like thing, but that still implements a full parser and lexer and does a lot of dancing to make that work with the remote system.
Hum, but I think dart doesn't have a repl right? I meant change cursive repl to support work on files from other languages, does that makes sense? Or enough to work with clojure-lsp-intellij
So… I’m not sure how to put this delicately. I’m not exactly incentivised to do this, because you’re essentially writing a Cursive competitor, and Cursive feeds my family.
I see, I thought would be ok for you since people would still use Cursive along with clojure-lsp, since cursive is the only plugin that supports REPL support ATM, this way one could choose to use static analysis from cursive or clojure-lsp, but the runtime stuff would still come from Cursive
Cursive licensing has always basically used an honesty box model, since I’ve always offered non-commercial licences for free. So anyone interested in using Cursive without paying can just get one of those and use it. But I suspect that a lot more people would feel ok about not paying if they think that clojure-lsp is doing the hard bit and Cursive is “just” providing the REPL.
I don’t know how many users would think like that, but doing something like this is unlikely to get me any more users, and could result in significantly less.
Hum, I do think the REPL editor support is important for intellij and people probably wouldn't use clojure-lsp-intellij without any repl support :/ I'm trying to find a way where both things can work and people don't need to stop using cursive but can leverage clojure-lsp features that are not available in any editor. One example of this is that at Nubank, clojure-lsp linter part (that is another feature that allows using it without the IDE) is used in all hundred of projects, but intellij people doesn't have the feedback in ther IDE like the unused-public-var or the clj-depend integration, clojure-lsp is available in all famous editors but Intellij, so I'm trying to improve that
isn't a better experience for Clojure users a upside? in a way that both plugins would still be used
It’s an upside for Clojure users, but it’s not an upside for me if they stop using Cursive. I don’t know if that’s a real possibility or not, but it’s one I have to consider.
Or at least, stop paying for Cursive even if they still use it, because they think the part they’re using isn’t worth paying for.
it's just that I can't see how one that uses intellij would code Clojure without any REPL support, but I understand your concern
I don’t know, but I can imagine users that might think that “just” that bit isn’t worth paying for, and they would use it without paying for it. Which is trivial right now.
unfortunately, no, because clojure-lsp uses a feature from clj-kondo called custom hooks, which allows to define custom linters like the unused-public-var, also clojure-lsp has other diagnostics integrations besides kondo like the clj-depend project
it's pretty common to intellij users at Nubank have a inconssitency editor feedback than vscode/emacs/vim/sublime :/
Hmm, well possibly we can try to come up with something which scratches that itch without directly competing? I’m not sure what that would look like. It’s getting late here though, I have to go to bed.
yeah, that would be great, would love to see intellij users able to use clojure-lsp and not affect Cursive's REPL support which is amazing, I hope we find a solution that works for both! Thanks for your time and good night!
Cursive's static approach was a huge inspiration for clojure-lsp. I always imagined cursive and lsp pushing each other forward. LSP can still learn a lot from Cursive for other editors and I think Cursive could be improved by supporting common config formats that kondo/lsp have leveraged for CI workflows. Personally, I wonder if a way forward for nubank should be to sponsor unused public vars and clj-depend features in Cursive - if that's a possibility.
Nubank already sponsors Cursive IIRC, not sure though, even so, my point is that LSP is a standard to have one server for multiple clients and ATM the only client that doesn't have LSP support is Intellij, so I do think it makes sense to launch clojure-lsp-intellij, the issue here is if it can be used with cursive's repl