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

Add get-extension-context to joyride.core #34

Merged
merged 3 commits into from May 8, 2022
Merged

Conversation

PEZ
Copy link
Collaborator

@PEZ PEZ commented May 7, 2022

Adds a function to joyride.core for getting the Joyride extension context.

Fixes #33

@PEZ PEZ requested a review from borkdude May 7, 2022 21:42
@borkdude
Copy link
Collaborator

borkdude commented May 7, 2022

I'll have a look tomorrow!

@@ -20,7 +22,9 @@
(sci/init {:classes {'js goog/global
:allow :all}
:namespaces (assoc (:namespaces pconfig/config)
'joyride.core {'*file* sci/file})
'joyride.core {'*file* sci/file
'get-extension-context (fn []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good, but I'd prefer if get-extension context was a "true" var inside the SCI config. You can create it by defining get-extension-context with defn and then use (sci/copy-var get-extension (sci/create-ns 'joyride.core))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also allow you to add a docstring to it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And get it using clojure.repl/doc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Where would I do the copying?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look around in nbb.core for copy-var and you'll find an example. Sorry, tight schedule today!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had already started poking around there. I think I have fixed it in a proper way now. And doc lookup works as well, added it to the Joyride API example while at it.

Good to merge?

@PEZ PEZ merged commit 657710f into master May 8, 2022
@PEZ PEZ deleted the 33-extension-context branch May 8, 2022 10:11
@PEZ
Copy link
Collaborator Author

PEZ commented May 8, 2022

I took the ”PR looks good” hint. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give the scripts access to the Joyride extension context
2 participants