Fork me on GitHub
#cursive
<
2021-12-02
>
Drew Verlee01:12:43

Is curisve using clojure-lsp at all?

practicalli-john08:12:06

As I understand it, cursive static analysis features are based on the years of work that JetBrains put into Intellij static analysis. clojure-lsp is written from scratch and is used as a core component in Clava for VS Code and can be use with any editors that support the fairly recently published Language Server protocol standard (Emacs, Neovim, etc) Intellij was built way before that standard came out. I wonder if JetBraint Fleet editor will support the LSP standard (I assume it will have to support LSP if it's trying to compete with VS Code). If fleet does support LSP, then in theory cursive could be modified to use that approt, but as fleet hasn't even been properly release yet, there seem a lot of unknowns.

👍 3
ericdallo12:12:41

There is a intellij LSP plugin to to use clojure-lsp, but it's not actively maintained AFAIK

tanzoniteblack19:12:29

Fleet provides a polyglot experience, offering smart support for many languages and technologies out of the box, with support for even more planned via dedicated plugins. With the help of LSPs you will also be able to use other language services in Fleet.

tanzoniteblack19:12:42

so we’ll see what happens there, I guess

cfleming21:12:05

Cursive doesn’t use LSP at all, no. There are a couple of LSP plugins but I see a lot of complaints about them, and JetBrains have made it clear that they’re not going to support it natively in IntelliJ. Fleet should use it out of the box, though.

😔 1
favila21:12:19

I think I found a bug in symbol resolution through an if-let or if-some. In this screenshot, it thinks bug in the “else” branch references the one bound by if-let , but actually it’s from the outer let

cfleming21:12:17

Yes, the scope should be restricted to the true arm, but isn’t currently.

favila21:12:18

Actually the identity function calls are not needed, I was just reducing from a more complex case.

favila21:12:05

ah, ok, I haven’t noticed it until now!

kennytilton14:12:31

"the scope should be restricted to the true arm" Really? bug will be falsey in the false arm, but it will still be bound (and in scope). No?

favila14:12:30

It will be bound, but by the let in this particular case.

favila14:12:45

E.g. this is a syntax error:

favila14:12:05

(if-some [bug :foo]
  bug
  bug)

favila14:12:15

Syntax error compiling at (...).
Unable to resolve symbol: bug in this context

favila14:12:26

but cursive doesn’t see it

favila14:12:14

It thinks the last “bug” is not an error

kennytilton14:12:12

"If test is not nil, evaluates then with binding-form bound to the value of test..." That is evil. 🙂

misha15:01:55

(clojure.walk/macroexpand-all
  '(if-let [b 1]
     b
     b)) 
(let* [temp__5455__auto__ 1]
  (if temp__5455__auto__
    (let* [b temp__5455__auto__]
      b)
    b))
just hit it myself. btw I don't see any upside in temp binding instead of using user-specified one if anything, it might mislead you in cases where sym is shadowing existing one, like test or
(let [b 2]
   (if-let [b 1]
     b    ;; b=1
     b))) ;; b=2