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

Initial version of snippet file #4803

Merged
merged 1 commit into from Dec 12, 2018

Conversation

Projects
None yet
2 participants
@wsmelton
Copy link
Member

wsmelton commented Dec 12, 2018

VS Code supports project-level snippets (just found out).

I will expand this out as time goes. Initially just includes a few function templates but will work on adding the test templates referenced in sqlcollaborative/dbatools-templates#20

Type of Change

  • Bug fix (non-breaking change, fixes #)
  • New feature (non-breaking change, adds functionality)
  • Breaking change (effects multiple commands or functionality)
  • Ran manual Pester test and has passed (`.\tests\manual.pester.ps1)
  • Adding code coverage to existing functionality
  • Pester test is included
  • Nunit test is included
  • Documentation
  • Build system

Purpose

Snippets can be a replacement for having to upkeep the template repository for contributors that use VS Code.

Approach

The project level snippet file is detected by VS Code once it loads the project/workspace folder. A user would follow the steps below to utilize them as they need/want based on what they are contributing. The example below would be for adding a new command/function.

  1. Create a new file in the .\functions\Set-DbaMyFunction.ps1
  2. Use keyboard shortcut: CTRL + ALT + J
  3. Select the required snippet within the workspace snippets listed:

image

These can be adjusted to be full command templates like the two listed. I can also include code snippets for whatever pattern we would like to setup for this project (e.g. foreach-dbs).

Initial version of snippet file
VS Code supports project-level snippets (just found out)

@potatoqualitee potatoqualitee merged commit 4b1db58 into sqlcollaborative:development Dec 12, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@potatoqualitee

This comment has been minimized.

Copy link
Member

potatoqualitee commented Dec 12, 2018

:bananadance: :bananadance: :bananadance:

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