Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create New File with Boilerplate Code Extension without a Project or Solution #5

Open
shaggygi opened this issue Aug 21, 2017 · 4 comments

Comments

@shaggygi
Copy link
Contributor

It would be nice to have the ability to create an extension for a template pack to add a specific file type in Visual Studio. This type of extension would not be tied to a project, but in the New File Dialog. I requested this from the Visual Studio team a couple of years ago. They acknowledged request, but don't think they ever implemented. Having it in this new template pack format would be awesome 🎉

NOTE: This is similar to creating a new XML file, but scenario would be for selecting your file type instead.

Scenario Steps:

  1. Open Visual Studio.
  2. Click File > New > File...
  3. In the New File Dialog, select your extension file type in the middle section. It would be even better if you could force the file type to only show up when selecting a specific node on left section. e.g. Demo.Console > MyFileType.
  4. Click Open. No file name is required at this point.
  5. The file is added to Tab Group with the extension's boilerplate code.
@sayedihashimi
Copy link
Member

If I understand the request correctly you're asking to support "solution items". Currently we are focused on getting project template support. After that we will work on standard Item Templates.
I looked into Solution Items a while back and it seemed there wasn't any support for .vstemplate there. I'm not sure exactly how it would work.
We still have some gaps to fill for project templates. I'll keep this issue open, but there may not be any activity here for a while.

@shaggygi
Copy link
Contributor Author

@sayedihashimi I don't know if it considered "solution items" or not since it is not tied to an actual solution. This is basic the same as doing the following...

  1. Open VS (at this point you don't have a solution or project open)
  2. Click File > New > File...
  3. Select XML File
  4. Click Open
  5. An XML file is added to the tab group with the boilerplate XML text and ready to start adding more content.
  6. At this point, the file is in memory and not saved. You would have to click Save and select a folder if you wanted to save the XML file.

So my request here would be to have a template to also include/install your own types of files with its own boilerplate content. Uninstalling the template pack would also remove the file types.

You're right, it is not connected to a project so I understand if there is more priority/focus for project template stuff. However, I could see some good benefits from allowing devs to add this scenario along with project related things within one template pack.

Thx

@sayedihashimi
Copy link
Member

@shaggygi I'm looking into whether these are "solution items" or something else. I'm seeing a different set of templates available when doing File->New File and Add Item on a solution.

I could see some good benefits from allowing devs to add this scenario along with project related things within one template pack.

Yes, I agree that it's important to get done, but we need to ensure that the project template story is solid before moving to new areas.

@sayedihashimi
Copy link
Member

I just chatted with a dev here. File -> New File can be populated via standard Item Templates. Let's keep this open for now. When we do Item Template support lets check if they show up in File -> New File.

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

No branches or pull requests

2 participants