csharpextensions
csharpextensions copied to clipboard
Template creation feature and file creation changes
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).
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 :)
I've been thinking about this and like it. I think we would need to add a Edit Template feature too.