Replies: 2 comments 1 reply
-
|
This could have potential to tie in really nicely with #2 IDE integration, since IDE snippet engines already kind of account for this! It seems like most IDE's have adopted the same way vscode handles it, so maybe doing the same here would be helpful. Here's an example from the vscode docs - The autocomplete typically will let you tab through and populate each paramter field once the code is pasted by the IDE. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for suggesting this! I do like this idea quite a bit because I have found myself doing something similar which was writing caddy snippets and then locally exporting variables. I think we can have multiple paths to handle templates
I think to start maybe copy + fill is the easiest way to get something off the ground to fit your immediate need. Thoughts? @KevinStirling it would be nice if we could integrate your #2 with templating as well making a much more feature rich too. By any chance do you know if this differs from IDE to IDE or if there is a standard in place for this? (or should codecaddy introduce its own templating format?) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What problem does this solve?
When I have snippets (especially shell scripts, kubectl commands, Docker runs, config templates, teleport commands) oftentimes they contain variables, which I end up having to fix after I've pasted (or
exportif it's a script snippet)ie)
${NAMESPACE},${IMAGE_TAG},${REGION}, etc.Right now I am forced to do one of two things after copying:
export VAR=valcommands in my terminal before pastingI want to try and eliminate any editing after copy/paste and any pre-exporting of env vars. I like the idea that the text I copy from CodeCaddy already being 100% ready to paste and use
Your proposed solution
Add parameterized snippet templates with pre-copy substitution:
Snippets can contain placeholders (
${VAR_NAME}, or similar)On any template snippet, show something like a "Fill & Copy" button next to the normal Copy button
Clicking it opens a dialog that lists every variable with:
• Text inputs (pre-filled with optional defaults)
• Per-project memory or profiles dropdown for the template
Then people can:
• Copy Filled → clipboard gets the fully substituted, ready to use text
• Copy Raw → clipboard gets the original raw template text
This ultimately gives me a complete snippet I can paste -- no manual edits after pasting or
exportcommands needed for shell scriptsAlternatives considered
envsubstor just plain pasteHow important is this to you?
Nice to have
Beta Was this translation helpful? Give feedback.
All reactions