ligershark / sidewafflev2

Other
30 stars 11 forks source link

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

Open shaggygi opened 7 years ago

shaggygi commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

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.