visualzoran / vz-file-templates

File template manager for Visual Studio Code
MIT License
19 stars 10 forks source link

Optional input parameters #11

Open juanfernandoe opened 5 years ago

juanfernandoe commented 5 years ago

Hi,

first of all, thank you. This extension is awesome.

Could you add optional input parameters in order to add things like namespace or specific things for the template apart of itemname.

please let me know if my request doesn't make sense.

visualzoran commented 5 years ago

Hi

How would you like to populate these optional parameters? This extension supports only basic template variables, because I wanted to separate template selection UI and logic from language specific variables, logic and wizards. You can create your own vs code extension that registers wizards and templates using vz-file-templates api. When user selects one of your templates, code in your extension will be invoked. Then you can add variables specific to your language and show a wizard if you need to collect additional information. You can find some examples in these respositories: Templates in vs code extension: https://github.com/visualzoran/vz-templates-sample-ext Templates and wizard: https://github.com/visualzoran/vs-template-wizardsample-ext .NET Core templates and wizards: https://github.com/visualzoran/vz-dotnet-file-templates

All these extensions use interfaces defined in 'vz-file-templates' npm module, so if you want to create your extension, don't forget to install this modue with this command: npm install vz-file-templates