Open nkolev92 opened 5 years ago
From @dfkeenan on February 2, 2019 15:45
I think this is a great idea. I would also like to be able to distribute item templates this way.
From @CodeTherapist on February 4, 2019 8:10
@dfkeenan Item templates can be distributed as a nuget packages, see the docs.
@CodeTherapist Thanks for creating this issue.
The snippets are not usually project or solution specific. They are user specific, and the IDE team already has a recommended way of distributing them through VSIXs. See https://docs.microsoft.com/en-us/visualstudio/ide/how-to-distribute-code-snippets?view=vs-2017.
I'd suggest that the discussion starts on that end, and then involve NuGet. I'm not sure the IDE would be able to handle project specific snippets at all (it might be a large architectural change on their end).
I'd recommend starting with dotnet/roslyn.
@CodeTherapist If you want, I can move this issue for you there.
From @dfkeenan on February 5, 2019 8:12
I thought those templates were for projects/solutions not items. Besides I don't want to use the command line to add a new file to a project. Ideally from Visual Studio I could add a NuGet package then using the Add New Item
dialog choose a file I wan to add.
From @CodeTherapist on February 5, 2019 11:1
@nkolev92 Thanks for reviewing my issue - yes please, you can move it.
This would be very nice!
We've absolutely love this feature too. We have lots of OSS projects which layer up architectural patterns, but would love to also be able to include snippets as the "instruction manual" to easily deliver that pit of quality experience for consumers.
any progress on it?
I'm not really sure why this is on Roslyn. We don't own anything in the packaging/project space. If you wanted to include snippets in a package as the "instruction manual"
, we wouldn't really have anything to do with that.
From @CodeTherapist on February 1, 2019 15:56
Similar how we can today distribute a
msbuild task
per nuget package, We could distribute code snippet(s) with a nuget package. When a nuget package is referenced in a project that contains snippets, they become available for the specific project.This feature would enable library authors to provide useful code fragments that are common with the usage of the library. For example:
Razor could provide snippets for tag helpers
The snippets inside the class library that is packed
The internal structure of the nuget package
I'm not sure if my suggestion is feasible and in the correct repository here. Some aspects of the feature are related to Roslyn and Visual Studio.
Copied from original issue: NuGet/Home#7758