-
-
Notifications
You must be signed in to change notification settings - Fork 219
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 projectRootDir for monorepo connection sequences #1100
base: dev
Are you sure you want to change the base?
Conversation
There's still one issue to resolve with this, currently when you jack-in the results doc is created before we prompt for the connection sequence and potentially change the project root dir based on this new setting. This is causing the results doc to become disconnected due to the directory change. There's a couple potential solutions:
My preference would be 2 since it also solves the multiple results doc issue, WDYT? |
I think option 2 would be strange when you are working with more than one project. And option 1 sounds like it would risk opening a can of worms. Do we have other options? |
@PEZ Can you elaborate more on this? I don't work with multiple projects simultaneously much, so maybe it's hard for me to see the issue. Do you mean contextually? Like, I'm working on A and B, and I run some things in A and then switch to B and run some things, and now there's output from two different projects in the output window, but it's unclear from which project they came? If that is the case, I don't see that being an issue, since output is output and happened in the past. I may be way off here from what you're thinking though. Maybe you also mean the context for working directly in the output/repl window could be confusing ("which project am I in?") - though there is the namespace in the prompt, at least. |
@bpringe you basically elaborated it to what I was thinking about. The difference in viewpoint being that I see a huge issue with it. 😄 I have five to ten different projects open almost all the time and having some system.log kind of output would be awful. I think that can of worms (option 1) is interesting. We've pulled off similar things in the past. Maybe it is not as scary as I first thought it was. |
Yeah, I see. Good point. |
@PEZ did you intend to delete this branch? |
I was wondering the same. I know he did some cleanup earlier. 🤔 |
My apologies! Not intended. At. All. |
@@ -3,7 +3,7 @@ | |||
"displayName": "Calva: Clojure & ClojureScript Interactive Programming", | |||
"description": "Integrated REPL, formatter, Paredit, and more. Powered by cider-nrepl and clojure-lsp.", | |||
"icon": "assets/calva.png", | |||
"version": "2.0.185", | |||
"version": "2.0.185-monorepo-proj-root-dir", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"version": "2.0.185-monorepo-proj-root-dir", | |
"version": "2.0.185", |
(I usually pick up the VSIX from CircleCI instead. Maybe we should make a script that build a local VSIX...)
@@ -373,6 +373,11 @@ | |||
"description": "Here you can give Calva some Clojure code to evaluate in the CLJ REPL, once it has been created.", | |||
"required": false | |||
}, | |||
"projectRootDir": { | |||
"type": "string", | |||
"descripion": "The root directory to execute the Jack-in command from. This will override the default behavior for determining the root directory relative to the current open file. This is useful for working in monorepos.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI (and this should go to the dev docs): I've started to use markdownDescription
to boost the schema help a bit.
const sequences = customSequences.filter(customSequence => | ||
!!customSequence.projectRootDir | ||
|| defSequenceProjectTypes.includes(customSequence.projectType) | ||
).concat(defSequences); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite remember where the result from this function is used. Can you explain why you filter away sequences with the setting? (I'm sure it is the right thing to do, just want to understand why. 😄 )
Good morning. Again my apologies for deleting the branch. Thanks for restoring, @bpringe! I left some comments in the review. Overall it looks good. I wonder if you have tested this with the Connect to a running REPL scenario? I expected that there would need to be some changes in the |
@stefan-toubia bump |
What has Changed?
Adds a
projectRootDir
option for custom connection sequences to specify a root dir to use instead of resolving the root dir based on the current open file context.Fixes #579
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.ci/circleci: build
test. NB: There is a CircleCI bug that makes the Artifacts hard to find. Please see this issue for workarounds.The Calva Team PR Checklist:
Before merging we (at least one of us) have:
dev
branch (unless reasons).Ping @PEZ, @kstehn, @cfehse, @bpringe