tintoy / msbuild-project-tools-vscode

VS Code extension for MSBuild intellisense (including PackageReference completion).
MIT License
82 stars 16 forks source link

Fine-tune msbuild snippets #30

Closed doggy8088 closed 6 years ago

doggy8088 commented 6 years ago
tintoy commented 6 years ago

Good idea about the prefix; I was going to suggest that but you beat me to it!

tintoy commented 6 years ago

BTW, for snippets that only declare a single property or item, it might be easier to add those to the list of well-known properties / item types since the language service already knows how to insert them.

For example, here's the AssemblyName property and its associated description.

https://github.com/tintoy/msbuild-project-tools-vscode/blob/master/help/properties.json#L221-L223

I could probably look into adding an optional default value for well-known properties (so there could also be a defaultValue property in addition to description).

tintoy commented 6 years ago

And here's the definition for the PackageId property:

https://github.com/tintoy/msbuild-project-tools-vscode/blob/master/help/properties.json#L545

I think the snippets that add multiple required properties together are still a good idea, but perhaps leave out the containing PropertyGroup element? That way, it's easy for them to add those properties into an existing property group (and if they want to add a new property group, they can just type <Prop and the first suggestion will be <PropertyGroup>).

doggy8088 commented 6 years ago

I think defaultValue is a good idea.

These snippets are common usage for me. Wrapping them in a "Group" can be easily identified their purpose. ( It depends. ) No matter what, after these code snippets been inserted into csproj. They can still move their generated code to else where.

doggy8088 commented 6 years ago

I have a .NET Core courses in my country. I also asked to many of my studuents, almost 90% devs don't know what's <ItemGroup> and <PropertyGroup>. That why I want to put these snippets into a "Group".

tintoy commented 6 years ago

Good point - sounds fine to me then :)

tintoy commented 6 years ago

I have to get to bed (I'm in Australia) but I'll get this merged first thing tomorrow :)

doggy8088 commented 6 years ago

Sure, g'nite! 😄

tintoy commented 6 years ago

Looks good, thanks!

tintoy commented 6 years ago

Published in v0.2.22