-
-
Notifications
You must be signed in to change notification settings - Fork 228
Custom snippet variable interpolation #2769
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Copilot reviewed 3 out of 8 changed files in this pull request and generated no comments.
Files not reviewed (5)
- shadow-cljs.edn: Language not supported
- src/cljs-lib/src/calva/interpolate.cljs: Language not supported
- src/cljs-lib/test/calva/interpolate_test.cljs: Language not supported
- test-data/.vscode/settings.json: Language not supported
- test-data/projects/pirate-lang/deps.edn: Language not supported
✅ Deploy Preview for calva-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What has changed?
-str
substitution variables to custom REPL commands #2282repl
entry for the snippets not being honored.repl
setting not honored #2770$ns-form
snippet variable$ns-form
custom command variable #2771See updated docs. But here's an example:
So, the with the first one there is nothing new, but the second one has
${top-level-form|replace|^\\(defn-?|(defn*}
which invokes thereplace
modifier so that thedefn
form will be evaluated using Snitch'sdefn*
macro.There is also a
pr-str
modifier, that doesn't take any argument, which is what fixes #2282.The syntax is slightly bash inspired, but a bit more verbose in that we use Clojure function names to make the ClojureScript semantics clear.
@djblue, can you check and see if you agree that this fixes the stringify suggestion?
@seancorfield, can you take the VSIX for a spin and make sure your current snippets still work?
@skylize, I believe you once pointed at the lack of usefulness for some of the snippet variables because they are not stringified? Please have a look at the docs and please take the VSIX for a spin.
The VSIX is available on CircleCI, linked in the jobs/test output below. It's in Artifacts in the build step.
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