akosyakov / myprompts

VS Code Extension to manage custom prompts
MIT License
3 stars 0 forks source link

Add support for having input placeholders for prompts #1

Closed mads-hartmann closed 4 days ago

mads-hartmann commented 5 days ago

I would be useful to be able to have input placeholders in prompts. When executing the prompt it should provide a quick way to type in values for the inputs.

E.g. for this prompt

{
      "title": "React: Add new prop",
      "prompt": [
        "Extend the component's prop types with a new value named foo of type Foo. The component is using the FC type from React so remember to update both the type signature and the prop deconstruction in the function"
      ],
      "codeAction": "quickfix"
}

I'd like to be able to use an input placeholders instead of foo and Foo.

{
      "title": "React: Add new prop",
      "prompt": [
        "Extend the component's prop types with a new value named {name} of type {type}. The component is using the FC type from React so remember to update both the type signature and the prop deconstruction in the function"
      ],
      "codeAction": "quickfix"
}
akosyakov commented 4 days ago

@mads-hartmann there is a new version (0.0.12) which will produce vs code snippets like edits, so you need to follow https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets

I also added a doc to README: https://marketplace.visualstudio.com/items?itemName=akosyakov.myprompts (see snippets)

It relies on the language model and your input 🤞