This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-13
Channels
- # announcements (1)
- # beginners (155)
- # calva (104)
- # cider (7)
- # clj-kondo (55)
- # cljdoc (2)
- # cljs-dev (19)
- # cljsrn (22)
- # clojure (230)
- # clojure-europe (1)
- # clojure-italy (15)
- # clojure-losangeles (8)
- # clojure-nl (11)
- # clojure-spec (20)
- # clojure-uk (30)
- # clojurescript (10)
- # code-reviews (32)
- # cursive (2)
- # data-science (6)
- # datascript (3)
- # datomic (141)
- # fulcro (1)
- # graphql (6)
- # jobs-discuss (19)
- # luminus (8)
- # off-topic (30)
- # pathom (2)
- # protorepl (8)
- # reagent (15)
- # reitit (3)
- # shadow-cljs (11)
- # tools-deps (1)
- # xtdb (8)
I am trying to fix so that lein jack-in works on Windows with powershell. Here’s an experiment where I have simplified the quoting of the arguments. Works swell on my Mac. But I have no clue if it works on Windows with cmd.ex, nor with powershell. (My old Mac can’t handle Windows 10 in Virtual Box.) Can I get some help giving it a try. @brandon.ringe, maybe? And everyone, really, because this is a potential major break of vital functionality.
@pez with Powershell i get the exception java.lang.NumberFormatException: Invalid number: 0.6.0 and with cmd also i think the versions needs to be like thiis \"0.6.0\"
Thanks, @slack1038! I suspected that a bit. What happens in cmd.exe
?
Interesting. Have some time to work at it together with me? It’ll be quicker than me building vsix packages blindly. 😃
I have updated the wiki page about evaluating code. I’d like feedback. ❤️ https://github.com/BetterThanTomorrow/calva/wiki/Code-Evaluation-Tips (ping @lspector )
gentle reminder, feel free to vote on a convention for tooling (something which calva may eventually also support, if it does things like clean-ns in emacs): https://github.com/borkdude/clj-kondo/issues/241#issuecomment-500805941
Thanks @borkdude. I think I may be trying to complicate the decision here, but I proposed another alternative (`^:require/implicitly_used`) that is hopefully more intention-revealing than imperative (“keep”). 😅
Good news! @slack1038 and I worked at this together and found a way to make jack-in work also for when powershell is the shell used by vscode. We tried for two solid hours to make nice changes that would make it work, but in the end we had to resort to a somewhat ugly workaround. Anyway, here is a build that works on both our setups. I am going to publish it soon, but am giving people here a chance to find problems before our users out there gets them. Thanks in advance for help testing this! ❤️

@pez @slack1038 Thanks for the work. Did you make it switch the shell to cmd before running the cmd-friendly version of the command? It did ask me to allow the workspace to modify my shell (to cmd when I had it set to powershell).
I guess the other way would be to read what shell they have set and issue the proper command for that shell?
Yes, issuing the proper command for lein.bat
in powershell proved too hard for us. We could construct a command line that worked when issued in the terminal, but not when it was issued from the jack-in task.
lein seems to do something with the formatting after it takes it in. PS wants a specific format. Issuing from jack-in probably does something to it as well
I guess that when the quoting requirements of the powershell clashes with those of whatever a .bat
needs it gets REALLY complicated. We do get the quoting to work for cli-deps
, but that is a .ps1
script.
The quoting for cli/deps
is really complicated, by the way. Done in several steps and involves tripple backslashes and stuff. 😃
I think that if people don’t have it on their machines then it isn’t of much use for Calva.
This may be a very silly question, but can calva put lein.ps1 on someone's system during install? Like a dependency? Maybe even in a sandboxed way?
I guess it could be done. But I wonder if it’s worth it. And first we should confirm that it would help, even. 😃
Probably not worth it right now with the other more urgent things. I'm looking into the go-loop printing issue just to see if I can make sense of what's happening and if I can try something new.
Need help testing again. Added an escape out of jack-in for powershell users who do not allow the change of the setting. Ping @slack1038 and @brandon.ringe.
So to test ^ this ^ try with having both cmd.exe
and powershell.exe
set as shell default. And try with both allowing and not allowing Calva to change it when it needs to. I’m not sure how you reset things so that VS Code will ask again, but I hope you will figure that out. 😃
Somehow I cannot change my default shell -_-. The command won't work like it did before. I even checked the settings.json and it's set to something other than powershell when I change it, but powershell keeps being used when I open a new terminal
the thing is we change the workspace settings from the code and i dont know how to do it on a global part that means if the user changes the settings globaly it wont change for the workspace itself
There is no global part. There is user and workspace. But maybe user has precedence over workspace?
So when I have powershell set as default shell in user settings (what the built-in command/task sets, and it is powershell by default on new install of vscode), then I run the jack-in command, calva is setting the workspace shell to cmd, running the jack-in command, and setting it back to powershell, but in the workspace
Then when you use the built-in change default shell task, it changes the user settings, but the workspace overrides
It needs to change the user setting for default shell, not the workspace, if that is possible
But if the workspace had another shell set to begin with, then changing the user one would not work for calva probably
I have pushed the code to master. I must do other things right now, but if someone else can look at it, the code is there.
just as reference the link and yes this is the problem when the user changed its settings for the workspace we cant just removed it and i dont think there is a api to get the user setting and the workspace setting
I also don't think that api exists. Have had use for it before, but then it wasn't there.
Well at least what we have now will work for people who just installed vscode and have PS set as default
They just will have to go change workspace settings when they try to change their default shell after using the jack-in command
@brandon.ringe can checkout your PR and build his own for testing. 😀
Though my not-so-well-payed day job wouldn't allow me to go do this for three months, so it would take that someone else was ready to take the assignment.
I’m a bit tired right now, @slack1038, but it looks like you didn’t base your changes on my latest changes. I know github says there are no conflicts, but I hesitate to pull the PR since it looks like it will revert stuff…
Quite strange actually. And could just mean I should close the lid on my laptop for today.
Yeah i did something wrong But i had to make a merge because of it That is the second commit But i can also just revert my fork back and do the change again
Please do. I could probably fix it on my end, but it would be easier with a clean change.
https://clojurians.slack.com/archives/CBE668G4R/p1560446670426900 disagree, I'd support this. calva oddly works perfectly for my workflow, really happy with it. especially combined with live share, remote development, etc.
