Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Template creation feature and file creation changes #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Yantrio
Copy link
Contributor

@Yantrio Yantrio commented Oct 15, 2016

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 :)

@jchannon
Copy link
Owner

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

James Humphries added 3 commits October 17, 2016 16:40
import * as path from 'path';
import * as vscode from 'vscode';

export class TemplateManager {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Denied

Copy link
Contributor Author

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' ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the latter 😄

Copy link
Contributor Author

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?

Copy link
Owner

@jchannon jchannon left a 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 @@
{
Copy link
Owner

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

Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants