-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
"publisher": "betterthantomorrow", | ||
"author": { | ||
"name": "Better Than Tomorrow", | ||
|
@@ -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 commentThe 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 |
||
"required": false | ||
}, | ||
"menuSelections": { | ||
"type": "object", | ||
"description": "Pre-selected menu options. If a selection is made here. Calva won't prompt for it.", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ interface ReplConnectSequence { | |
name: string, | ||
projectType: ProjectTypes, | ||
afterCLJReplJackInCode?: string, | ||
projectRootDir?: string, | ||
cljsType: CljsTypes | CljsTypeConfig, | ||
menuSelections?: MenuSelections, | ||
nReplPortFile?: string[] | ||
|
@@ -208,7 +209,10 @@ function getConnectSequences(projectTypes: string[]): ReplConnectSequence[] { | |
const customSequences = getCustomConnectSequences(); | ||
const defSequences = projectTypes.reduce((seqs, projectType) => seqs.concat(defaultSequences[projectType]), []); | ||
const defSequenceProjectTypes = [...new Set(defSequences.map(s => s.projectType))]; | ||
const sequences = customSequences.filter(customSequence => defSequenceProjectTypes.includes(customSequence.projectType)).concat(defSequences); | ||
const sequences = customSequences.filter(customSequence => | ||
!!customSequence.projectRootDir | ||
|| defSequenceProjectTypes.includes(customSequence.projectType) | ||
).concat(defSequences); | ||
Comment on lines
+212
to
+215
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. 😄 ) |
||
return sequences; | ||
} | ||
|
||
|
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 usually pick up the VSIX from CircleCI instead. Maybe we should make a script that build a local VSIX...)