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

More proper run code command and fix dev reloadability #20

Merged
merged 2 commits into from
May 1, 2022
Merged

Conversation

PEZ
Copy link
Collaborator

@PEZ PEZ commented May 1, 2022

The command for running a piece of code was named runScript, which implied it worked similar to the runWorkspaceScript command, which it doesn't. It prompted for the user to input code, and disregarded any argument. The result of evaluating the code was then alerted, causing noice in the UI.

The command is now renamed. to runCode and will evaluate the argument, if handed one, as code. And without any argument it will prompt for code, as before. The results are printed in the Joyride output channel, where it can be copied to the clipboard, or whatever.

While doing this work, I noticed I was losing the output channel reference when I saved the file. Which was because the !db item was defed instead of defonceed. I decided to put in a proper lifecycle managament with shadow-cljs :before and :after hooks. And I also wanted to be able to ”reactivate” the extension w/o restart so I fixed that too, and made it happen on shadow-cljs reload.

PEZ added 2 commits May 1, 2022 18:04
Also fix dev problem with output channel being undefined
after shadow-cljs hot reload
@PEZ PEZ requested a review from borkdude May 1, 2022 16:49
@borkdude
Copy link
Collaborator

borkdude commented May 1, 2022

Can you explain what this PR does and why a name of a command was changed from script -> code? Does that mean a breaking change for the user?

@PEZ
Copy link
Collaborator Author

PEZ commented May 1, 2022

I've now added a description.

Yes, breaking change for any user who has bound keyboard shortcuts to the runScript command. I don't think many have, because we have not advertised the function at all. It was rather shipped by mistake when we hurried Joyride out to the world. The README declares quite clearly that the extension is WIP, so it should be fine. 😄

@borkdude borkdude merged commit b3ea469 into master May 1, 2022
@borkdude borkdude deleted the run-code branch May 1, 2022 18:24
@borkdude
Copy link
Collaborator

borkdude commented May 1, 2022

Thanks!

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.

2 participants