-
Notifications
You must be signed in to change notification settings - Fork 105
Template creation feature and file creation changes #3
base: master
Are you sure you want to change the base?
Conversation
I've been thinking about this and like it. I think we would need to add a Edit Template feature too. |
Added description to templates
Changed vscode opening to use node process spawning
import * as path from 'path'; | ||
import * as vscode from 'vscode'; | ||
|
||
export class TemplateManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Denied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you have against classes? or is it that I called it 'Manager' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the latter 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is hard, what do you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished review with Github new stuff
@@ -0,0 +1,12 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is tslint something that needs to go in package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it should be bought in as a dev dependency, but for now, I was just installing it globally.
This PR brings around 2 features.
Firstly, I have removed the
New C# class
andNew C# Interface
options, in favour ofNew 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 :)