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

1733 paredit awaitable #1734

Merged
merged 7 commits into from
May 22, 2022
Merged

1733 paredit awaitable #1734

merged 7 commits into from
May 22, 2022

Conversation

PEZ
Copy link
Collaborator

@PEZ PEZ commented May 21, 2022

What has Changed?

Changed a lot of paredit code to stop using void on the edit promises and instead return them. At some places we were doing return await, and there I removed the await.

Also changed the Paredit extension command handlers to always return the promise to whoever is using the commands. E.g, a Joyrider:

joyride-paredit

Fixes #1733

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
    • Tested the VSIX built from the PR (so, after you've submitted the PR). You'll find the artifacts by clicking Show all checks in the CI section of the PR page, and then Details on the ci/circleci: build test.
  • Referenced the issue I am fixing/addressing in a commit message for the pull request.
  • Created the issue I am fixing/addressing, if it was not present.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • Confirmed that there are no linter warnings or errors (use the eslint extension, run npm run eslint before creating your PR, or run npm run eslint-watch to eslint as you go).

Ping @PEZ, @bpringe, @corasaurus-hex, @Cyrik

@PEZ PEZ requested review from bpringe, riotrah and corasaurus-hex May 21, 2022 22:53
@Cyrik
Copy link
Member

Cyrik commented May 21, 2022

I think in general I'd rather see the promise returned. When you do it async but only return the result, you're taking away the option for the caller to run them in parallel with something else.
The question is if it's ever useful to run any of this in parallel. But even if there's not, we're taking away an option without gaining anything.

@PEZ
Copy link
Collaborator Author

PEZ commented May 22, 2022

Thanks for the general pointer @Cyrik! 🙏 I have updated the PR according to that and we now return the promises all the way out to any user of the commands (via vscode.commands.executeCommand(). So if they want to try use the commands in parallell, they can. (And they will suffer from it, but we are not patronizing 😄.)

@PEZ PEZ merged commit e237dc0 into dev May 22, 2022
@PEZ PEZ deleted the 1733-paredit-awaitable branch May 22, 2022 12:36
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