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 command for copying jack-in command to clipboard #995

Merged
merged 11 commits into from
Jan 31, 2021

Conversation

bpringe
Copy link
Member

@bpringe bpringe commented Jan 30, 2021

What has Changed?

  • Adds command to copy jack-in command (that would be executed in a terminal) to clipboard
  • Refactors the jack-in code in order to make this work

@PEZ This will need a review and testing, of course.

Closes #992

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.
  • 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. NB: There is a CircleCI bug that makes the Artifacts hard to find. Please see this issue for workarounds.
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
  • Referenced the issue I am fixing/addressing in a commit message for the pull request.
    • If I am fixing the issue, I have used GitHub's fixes/closes syntax
    • If I am fixing just part of the issue, I have just referenced it w/o any of the "fixes” keywords.
  • Created the issue I am fixing/addressing, if it was not present.
  • Added to or updated docs in this branch, if appropriate

The Calva Team PR Checklist:

Before merging we (at least one of us) have:

  • Made sure the PR is directed at the dev branch (unless reasons).
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and tested it there if so.
  • Read the source changes.
  • Given feedback and guidance on source changes, if needed. (Please consider noting extra nice stuff as well.)
  • Tested the VSIX built from the PR (well, if this is a PR that changes the source code.)
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
  • If need be, had a chat within the team about particular changes.

Ping @PEZ, @kstehn, @cfehse, @bpringe

@bpringe bpringe requested a review from PEZ January 30, 2021 01:16
@bpringe
Copy link
Member Author

bpringe commented Jan 30, 2021

@PEZ If you could test the jack-in env thing that would be helpful. I did slightly change the code for that but it should do the same thing.

@PEZ
Copy link
Collaborator

PEZ commented Jan 30, 2021

jackInEnv is still working, afaict:

    "calva.jackInEnv": {
        "foo": 100
    }

Jack-in!

(System/getenv "foo") => "100"

Copy link
Collaborator

@PEZ PEZ left a comment

Choose a reason for hiding this comment

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

Looks good. I renamed a function whose name confused me.

The only thing to consider is if we want it to copy out a complete command line, including the jackInEnv. Don't know how to do that on Windows, and it might bring us in to that quoting hell that is so fun. Maybe it can remain a TODO. =)

@bpringe
Copy link
Member Author

bpringe commented Jan 30, 2021

Adding a note here for myself to add back analytics that were removed, as per our convo outside of here.

@bpringe
Copy link
Member Author

bpringe commented Jan 30, 2021

The only thing to consider is if we want it to copy out a complete command line, including the jackInEnv.

I don't think I fully understand what you mean, but as far as I can tell we currently are copying to clipboard everything that would be printed/run in the terminal at jack-in. Maybe leaving it as a todo would be good.

@PEZ
Copy link
Collaborator

PEZ commented Jan 30, 2021

Say we the user has a jackInEnv setting an environment of foo=bar. Then the jack-in command-line is not enough for recreating the jack-in. But something like

foo=bar clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.8"}}}' -A:reveal

would.

Anyway. I'm totally fine with merging as it is now.

@PEZ PEZ merged commit 26aa656 into dev Jan 31, 2021
@PEZ PEZ deleted the add_jack-in_command_copy_command branch January 31, 2021 11:03
@PEZ
Copy link
Collaborator

PEZ commented Jan 31, 2021

Merged as I am working at another jack-in thing and don't want to stitch it together later. 😄

@bpringe
Copy link
Member Author

bpringe commented Jan 31, 2021

You still want me to add back analytics that were removed?

@PEZ
Copy link
Collaborator

PEZ commented Feb 1, 2021

Maybe you can add that back in #1004? Since it refactors some of the jack-in further...

@bpringe
Copy link
Member Author

bpringe commented Feb 1, 2021

I'll leave it as a todo (#1002) until the dust settles on all the current jack-in work.

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.

None yet

2 participants