csharpextensions icon indicating copy to clipboard operation
csharpextensions copied to clipboard

Template creation feature and file creation changes

Open Yantrio opened this issue 8 years ago • 1 comments

This PR brings around 2 features.

Firstly, I have removed the New C# class and New C# Interface options, in favour of New C# File which will then prompt the user from a drop down to select which template they want to use.This dropdown menu pulls information in from the template file (using ${Description: test description here} to show the template name and a description (See image below).

screen shot 2016-10-15 at 01 01 09

To implement this, the files are iterated in the template directory, and a promise is returned to generate the QuickPickItem which has the information for our templates. Because we are using promises, vs code will show us a loading bar in the quick pick menu if for some reason it takes a while to load.

Secondly, I have added a second command, to create a new template file. Once executed, this command prompts the user to input a template name, this template file is then created and the templates folder is opened in a new window of vs code, allowing the user to edit and save the new template, and use it immediately.

I haven't yet found a way to open the template file after creating the new vs code instance to edit the template, as soon as I find that, I will implement it.

Feel free to tell me this isn't how you wanted it to work, and I can re-work this as needed :)

Yantrio avatar Oct 15 '16 00:10 Yantrio

I've been thinking about this and like it. I think we would need to add a Edit Template feature too.

jchannon avatar Oct 16 '16 16:10 jchannon