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
Jack-in without prompt #2073
Jack-in without prompt #2073
Conversation
Hi @PEZ! Please review this PR. I also added an integration test for it and I guess I need to edit the documentation. I wanted to record the video, but actually I was not able to do it today, so I can incude it somewhere tomorrow. |
Cool! I hadn't thought about this way to do it. I was stuck in how this used to work. I think I like this way better, because it is so straightforward. We need to be a bit careful with pop-ups. This one is very helpful, but I can see how it could get annoying for someone closing it without selecting an option. Some alternatives:
I haven't tested this myself yet, so here questions:
I requested review by @bpringe now, so that we can get his opinions on the Ux. This is great work! 🙏 |
Thank you for the great detailed answer! I agree about pop-ups, it's a kinda slippery road. What do you mean by not pop-up, do you mean to set the selected project as a default for this workspace if we call Jack-in? About testing. It should work with custom sequences and I guess it doesn't suppress the menu, but I will check it twice in a day or two and will let you know. |
@SillyCoon Thanks for the PR!
@PEZ I think we can go with this:
It seems fairly simple and very little code to maintain overall, plus this PR is already geared toward this. |
Co-authored-by: Brandon Ringe <12722744+bpringe@users.noreply.github.com>
Co-authored-by: Brandon Ringe <12722744+bpringe@users.noreply.github.com>
Co-authored-by: Brandon Ringe <12722744+bpringe@users.noreply.github.com>
I'm still hesitating about the popup. Reasons:
I think that for now it is better we print a message in the Output window about adding the setting. We can print the value there, and the user can copy it. |
@PEZ I agree with your reasons. I think we should avoid the pop-up as well. |
Can't argue with that, thanks for your help! I will move the message to Output Window then, should be pretty easy |
Thanks! I like your suggestions for Output window texts. It is rather few people who read the output in this window, I think. In some other PR we can consider cleaning all that text it up and rather link to calva.io. We might want to move the instructions for this setting there. Then we can elaborate a bit more on how it works. Not sure where, but I think that for now, just before this section on the Connect the REPL page: https://calva.io/connect/#monorepos-multiple-clojure-projects-in-one-workspace will do. Something like: ## Auto-select Project Type
You can make both Jack-in and Connect stop prompting you for project type in projects where you always want to use the same. The setting `calva.autoSelectReplConnectProjectType` is used for this. Here's how to use it:
1. Connect the REPL and manually select the project type/connect sequence you want to use.
1. In the Output/REPL window Calva will print about auto-selecting project type, including the value you need. **Copy this value**
1. In VS Code Settings, search for ”Calva auto” and you will find the setting
1. Make sure you are editing Workspace settings
1. **Paste the project type value you copied above**
Next time you connect the REPL, Calva will use this value and the project type prompt will not be shown.
To make Calva prompt for the project type, reset this setting (there's a cog icon there giving you an option to do this).
!!! Or edit Workspace Settings JSON
You can of course also edit this setting manually in `.vscode/settings.json` for the workspace. ”Reset” is then equivalent to removing the setting from this file. Then in the Output REPL window we can link to https://calva.io/connect/#auto-select-project-type, with short prompts like:
For the last case there I think we should show the menu, which will then make us print the correct settings value. WDYT? |
Sounds great! I'll create the PR with the updated documentation later then. |
Sounds exactly like what I had in mind. |
I think the docs should be updated in this PR, btw. |
sorry, I forgot that the code and the docs are in the same repo, will do it in this PR 😌 |
Thanks so much for this work, @SillyCoon! It's interesting this with settings. I start with ”no” when someone suggests a setting, because they add more work than I often first calculate with. They add cognitive load for the users too. And in supporting users, a layer of ”which settings for X are you using?” to all other permeations of things. As we can see with this little setting there is a lot to consider right off the bat. That said, I know we made the right call here making this configurable. When testing this I noticed how nice jack-in got. Let's go for that connect prompt as well, which asks for port with a pre-populated text input. I noticed a problem with this setting, as well as almost all Calva settings, when testing this PR. I tested in a workspace where I had several root folders. When I have set a default for auto-selecting project type, that was used regardless of which folder I was jacking in to. Because I had set it with the Workspace settings... Trying to set it on Folder settings didn't work because we lack |
What has changed?
Fixes #2049
Now you can set up the default project for Jack-in via config or after the Jack-in run by click on
Yes
.I'm not sure that it's great UI/UX but it's pretty simple and the information window doesn't block other input.
My Calva PR Checklist
I have:
dev
branch. (Or have specific reasons to target some other branch.)published
. (Sorry for the nagging.)[Unreleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.npm run prettier-format
)npm run eslint
before creating your PR, or runnpm run eslint-watch
to eslint as you go).Ping @PEZ, @bpringe, @corasaurus-hex, @Cyrik