cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please enable stub generation for Rama

holyjak opened this issue · comments

Hello!

Nathan Marz's Rama is a new fascinating platform with first-class Clojure API, but similarly to Datomic it is distributed without source code, and thus barely usable in Cursive (contrary to Cider and Calva). I suppose the solution is to enable Stub generation for its namespaces, i.e. I guess com.rpl.rama, com.rpl.rama.path, com.rpl.rama.aggs, com.rpl.rama.ops, com.rpl.rama.test (see the Rama Clojure Api docs)

Thank you! 🙏

Just to let you know that I'm working on this, but it's trickier than I expected. Just enabling stubs is not enough, Cursive needs to know how to resolve the dataflow API which is quite unlike Clojure.

Thank you! I imagine that could be pretty hard. IMO it does not need to be perfect, every improvement counts :-)

Also, perhaps the Rama people would be willing to help with this? BTW it has been mentioned they are going to release their clj-kondo config, perhaps that could be a good guide...

🙏

Fix released in 1.13.1-eap9 on 2023-11-27.

This is mostly fixed, but there are still some rough edges due to the fact that the dataflow DSL isn't really Clojure code. Some problems I'm aware of:

  • Highlighting doesn't work correctly for :keys destructuring of Rama output variables.
  • Highlighting is inconsistent for %% vars, which can lead to spurious unused variable markings.
  • Highlighting doesn't currently work for $$ vars, for unknown reasons.
  • $$ don't really have a scope in Rama, currently if they're used outside the form where they're defined they won't be resolved correctly.

I plan to fix more of these but I need to get this release out, I'm interested in feedback on how well this works in practice.

Amazing! Thank you for the super quick improvement!

Fix released in 1.13.1 on 2023-12-07.

Hi @holyjak ! It is awesome, many thanks! Before, Cursive was almost unusable for Rama code. Now it works really well.

I have only noticed 2 tiny inconveniences:

  • Some macros lack docstring, e.g. <<sources, source>
  • Currently, Rama has Clojure 1.11.1 built-in but Cursive believes random-uuid doesn't exist (though it works fine in the repl)