Skip to content
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

Please enable stub generation for Rama #2855

Closed
holyjak opened this issue Oct 28, 2023 · 7 comments
Closed

Please enable stub generation for Rama #2855

holyjak opened this issue Oct 28, 2023 · 7 comments
Labels
changed Marks issues describing changes to existing features released Marks issues which have had the fixes released in a stable build released-eap Marks issues which have had the fixes released in an EAP build
Milestone

Comments

@holyjak
Copy link

holyjak commented Oct 28, 2023

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! 🙏

@cursive-ide cursive-ide added this to the 1.13.1 milestone Oct 30, 2023
@cursive-ide cursive-ide added the changed Marks issues describing changes to existing features label Oct 30, 2023
@cursive-ide
Copy link
Owner

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.

@holyjak
Copy link
Author

holyjak commented Nov 8, 2023

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

🙏

@cursive-ide cursive-ide modified the milestones: 1.13.1, 1.13.1-eap9 Nov 27, 2023
@cursive-ide
Copy link
Owner

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

@cursive-ide cursive-ide added the released-eap Marks issues which have had the fixes released in an EAP build label Nov 27, 2023
@cursive-ide
Copy link
Owner

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.

@holyjak
Copy link
Author

holyjak commented Nov 28, 2023

Amazing! Thank you for the super quick improvement!

@cursive-ide
Copy link
Owner

Fix released in 1.13.1 on 2023-12-07.

@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Dec 7, 2023
@holyjak
Copy link
Author

holyjak commented Dec 14, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changed Marks issues describing changes to existing features released Marks issues which have had the fixes released in a stable build released-eap Marks issues which have had the fixes released in an EAP build
Projects
None yet
Development

No branches or pull requests

2 participants