tintoy / msbuild-project-tools-vscode

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

Create Code Snippets for MSBuild #29

Closed doggy8088 closed 6 years ago

doggy8088 commented 6 years ago

Here are my initial code snippets for MSBuild common tasks. I'll add more when I have more spare time.

Complete this issue: https://github.com/tintoy/msbuild-project-tools-vscode/issues/28

tintoy commented 6 years ago

Thanks! Looking over it now :)

tintoy commented 6 years ago

These look great!

I was thinking maybe it would be good if these snippets only show up in MSBuild project files (rather than all XML files) - what do you think? If you agree, and while you're in there, would you mind removing these 3 lines from package.json?

https://github.com/tintoy/msbuild-project-tools-vscode/blob/master/package.json#L226-L229

tintoy commented 6 years ago

That was quick! :)

tintoy commented 6 years ago

BTW, if you don't have time to make the package.json change, I'm happy to do that. If you disagree with having it limited to project files, I'm open to being wrong :wink:

doggy8088 commented 6 years ago

@tintoy I think you can take over it. 😄

doggy8088 commented 6 years ago

If these snippets only show up in MSBuild project files, that will be awesome. But I don't know it's possible or not. The VSCode looks like not support MSBuild file only snippets.

tintoy commented 6 years ago

The way snippets work (at least in an extension's package.json file), they are declared per-language. We define our own language called "MSBuild" (LanguageId = "msbuild"), which is a specialisation of the XML language (so we can do that quite easily). To try it out, see this section of the README (that's also how you enable stuff like intellisense and syntax highlighting for MSBuild expressions).

tintoy commented 6 years ago

Thanks, @doggy8088! I'm going to merge this into a feature branch now and will publish a new release over the weekend once I've had time to fully integrate your changes.

I'll let you know once there's a new VSIX package you can try out (to let me know if you're happy with the result).