|
64 | 64 | "Example-Class": {
|
65 | 65 | "prefix": "ex-class",
|
66 | 66 | "body": [
|
67 |
| - "class ${classname:MyClass} {", |
| 67 | + "class ${1:MyClass} {", |
68 | 68 | "\t# Property: Holds name",
|
69 | 69 | "\t[String] \\$Name",
|
70 | 70 | "",
|
71 | 71 | "\t# Constructor: Creates a new MyClass object, with the specified name",
|
72 |
| - "\t${classname:MyClass}([String] \\$NewName) {", |
73 |
| - "\t\t# Set name for ${classname:MyClass}", |
| 72 | + "\t${1:MyClass}([String] \\$NewName) {", |
| 73 | + "\t\t# Set name for ${1:MyClass}", |
74 | 74 | "\t\t\\$this.Name = \\$NewName",
|
75 | 75 | "\t}",
|
76 | 76 | "",
|
|
465 | 465 | "Class": {
|
466 | 466 | "prefix": "class",
|
467 | 467 | "body": [
|
468 |
| - "class ${ClassName} {", |
| 468 | + "class ${1:ClassName} {", |
469 | 469 | "\t$0",
|
470 | 470 | "}"
|
471 | 471 | ],
|
|
474 | 474 | "Constructor": {
|
475 | 475 | "prefix": "ctor",
|
476 | 476 | "body": [
|
477 |
| - "${ClassName}(${OptionalParameters}) {", |
| 477 | + "${1:ClassName}(${2:OptionalParameters}) {", |
478 | 478 | "\t$0",
|
479 | 479 | "}"
|
480 | 480 | ],
|
|
483 | 483 | "Hidden Property": {
|
484 | 484 | "prefix": "proph",
|
485 | 485 | "body": [
|
486 |
| - "hidden [${string}] $${PropertyName}" |
| 486 | + "hidden [${1:string}] $${0:PropertyName}" |
487 | 487 | ],
|
488 | 488 | "description": "Class hidden property definition snippet"
|
489 | 489 | },
|
490 | 490 | "Property": {
|
491 | 491 | "prefix": "prop",
|
492 | 492 | "body": [
|
493 |
| - "[${string}] $${PropertyName}" |
| 493 | + "[${1:string}] $${0:PropertyName}" |
494 | 494 | ],
|
495 | 495 | "description": "Class property definition snippet"
|
496 | 496 | },
|
497 | 497 | "Method": {
|
498 | 498 | "prefix": "method",
|
499 | 499 | "body": [
|
500 |
| - "[${void}] ${MethodName}($${OptionalParameters}) {", |
| 500 | + "[${1:void}] ${2:MethodName}($${3:OptionalParameters}) {", |
501 | 501 | "\t$0",
|
502 | 502 | "}"
|
503 | 503 | ],
|
|
506 | 506 | "Enum": {
|
507 | 507 | "prefix": "enum",
|
508 | 508 | "body": [
|
509 |
| - "enum ${EnumName} {", |
| 509 | + "enum ${1:EnumName} {", |
510 | 510 | "\t$0",
|
511 | 511 | "}"
|
512 | 512 | ],
|
|
515 | 515 | "Cmdlet": {
|
516 | 516 | "prefix": "cmdlet",
|
517 | 517 | "body": [
|
518 |
| - "function ${name:Verb-Noun} {", |
| 518 | + "function ${1:Verb-Noun} {", |
519 | 519 | "\t[CmdletBinding()]",
|
520 | 520 | "\tparam (",
|
521 | 521 | "\t\t$0",
|
|
557 | 557 | "Parameter": {
|
558 | 558 | "prefix": "parameter",
|
559 | 559 | "body": [
|
560 |
| - "# ${Parameter help description}", |
561 |
| - "[Parameter(${AttributeValues})]", |
562 |
| - "[${ParameterType}]", |
563 |
| - "$${ParameterName}" |
| 560 | + "# ${1:Parameter help description}", |
| 561 | + "[Parameter(${2:AttributeValues})]", |
| 562 | + "[${3:ParameterType}]", |
| 563 | + "$${0:ParameterName}" |
564 | 564 | ],
|
565 | 565 | "description": "Parameter declaration snippet"
|
566 | 566 | },
|
|
569 | 569 | "body": [
|
570 | 570 | "# Specifies a path to one or more locations.",
|
571 | 571 | "[Parameter(Mandatory=\\$true,",
|
572 |
| - " Position=${Position:0},", |
573 |
| - " ParameterSetName=\"${ParameterSetName:Path}\",", |
| 572 | + " Position=${1:0},", |
| 573 | + " ParameterSetName=\"${2:ParameterSetName}\",", |
574 | 574 | " ValueFromPipeline=\\$true,",
|
575 | 575 | " ValueFromPipelineByPropertyName=\\$true,",
|
576 | 576 | " HelpMessage=\"Path to one or more locations.\")]",
|
577 | 577 | "[Alias(\"PSPath\")]",
|
578 | 578 | "[ValidateNotNullOrEmpty()]",
|
579 | 579 | "[string[]]",
|
580 |
| - "$${ParameterName:Path}$0" |
| 580 | + "$${3:ParameterName}$0" |
581 | 581 | ],
|
582 | 582 | "description": "Parameter declaration snippet for Path parameter that does not accept wildcards. Do not use with parameter-literalpath."
|
583 | 583 | },
|
|
586 | 586 | "body": [
|
587 | 587 | "# Specifies a path to one or more locations. Wildcards are permitted.",
|
588 | 588 | "[Parameter(Mandatory=\\$true,",
|
589 |
| - " Position=${Position:0},", |
590 |
| - " ParameterSetName=\"${ParameterSetName:Path}\",", |
| 589 | + " Position=${1:Position},", |
| 590 | + " ParameterSetName=\"${2:ParameterSetName}\",", |
591 | 591 | " ValueFromPipeline=\\$true,",
|
592 | 592 | " ValueFromPipelineByPropertyName=\\$true,",
|
593 | 593 | " HelpMessage=\"Path to one or more locations.\")]",
|
594 | 594 | "[ValidateNotNullOrEmpty()]",
|
595 | 595 | "[SupportsWildcards()]",
|
596 | 596 | "[string[]]",
|
597 |
| - "$${ParameterName:Path}$0" |
| 597 | + "$${3:ParameterName}$0" |
598 | 598 | ],
|
599 | 599 | "description": "Parameter declaration snippet for Path parameter that accepts wildcards. Add parameter-literalpath to handle paths with embedded wildcard chars."
|
600 | 600 | },
|
|
606 | 606 | "# enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any",
|
607 | 607 | "# characters as escape sequences.",
|
608 | 608 | "[Parameter(Mandatory=\\$true,",
|
609 |
| - " Position=${Position:0},", |
610 |
| - " ParameterSetName=\"${ParameterSetName:LiteralPath}\",", |
| 609 | + " Position=${1:0},", |
| 610 | + " ParameterSetName=\"${2:LiteralPath}\",", |
611 | 611 | " ValueFromPipelineByPropertyName=\\$true,",
|
612 | 612 | " HelpMessage=\"Literal path to one or more locations.\")]",
|
613 | 613 | "[Alias(\"PSPath\")]",
|
614 | 614 | "[ValidateNotNullOrEmpty()]",
|
615 | 615 | "[string[]]",
|
616 |
| - "$${ParameterName:LiteralPath}$0" |
| 616 | + "$${2:LiteralPath}$0" |
617 | 617 | ],
|
618 | 618 | "description": "Parameter declaration snippet for a LiteralPath parameter"
|
619 | 619 | },
|
|
690 | 690 | "body": [
|
691 | 691 | "do {",
|
692 | 692 | "\t$0",
|
693 |
| - "} until (${condition})" |
| 693 | + "} until (${1:condition})" |
694 | 694 | ],
|
695 | 695 | "description": "do-until loop snippet"
|
696 | 696 | },
|
|
699 | 699 | "body": [
|
700 | 700 | "do {",
|
701 | 701 | "\t$0",
|
702 |
| - "} while (${condition})" |
| 702 | + "} while (${1:condition})" |
703 | 703 | ],
|
704 | 704 | "description": "do-while loop snippet"
|
705 | 705 | },
|
706 | 706 | "while": {
|
707 | 707 | "prefix": "while",
|
708 | 708 | "body": [
|
709 |
| - "while (${condition}) {", |
| 709 | + "while (${1:condition}) {", |
710 | 710 | "\t$0",
|
711 | 711 | "}"
|
712 | 712 | ],
|
|
715 | 715 | "for": {
|
716 | 716 | "prefix": "for",
|
717 | 717 | "body": [
|
718 |
| - "for ($${variable:i} = 0; $${variable:i} -lt $${array}.Count; $${variable:i}++) {", |
| 718 | + "for ($${1:i} = 0; $${1:i} -lt $${2:array}.Count; $${1:i}++) {", |
719 | 719 | "\t$0",
|
720 | 720 | "}"
|
721 | 721 | ],
|
|
724 | 724 | "for-reversed": {
|
725 | 725 | "prefix": "forr",
|
726 | 726 | "body": [
|
727 |
| - "for ($${variable:i} = $${array}.Count - 1; $${variable:i} -ge 0 ; $${variable:i}--) {", |
| 727 | + "for ($${1:i} = $${2:array}.Count - 1; $${1:i} -ge 0 ; $${1:i}--) {", |
728 | 728 | "\t$0",
|
729 | 729 | "}"
|
730 | 730 | ],
|
|
733 | 733 | "foreach": {
|
734 | 734 | "prefix": "foreach",
|
735 | 735 | "body": [
|
736 |
| - "foreach ($${variable:item} in $${collection:collection}) {", |
| 736 | + "foreach ($${1:item} in $${2:collection}) {", |
737 | 737 | "\t$0",
|
738 | 738 | "}"
|
739 | 739 | ],
|
|
742 | 742 | "function": {
|
743 | 743 | "prefix": "function",
|
744 | 744 | "body": [
|
745 |
| - "function ${FunctionName} (${OptionalParameters}) {", |
| 745 | + "function ${1:FunctionName} (${2:OptionalParameters}) {", |
746 | 746 | "\t$0",
|
747 | 747 | "}"
|
748 | 748 | ],
|
|
751 | 751 | "if": {
|
752 | 752 | "prefix": "if",
|
753 | 753 | "body": [
|
754 |
| - "if (${condition}) {", |
| 754 | + "if (${1:condition}) {", |
755 | 755 | "\t$0",
|
756 | 756 | "}"
|
757 | 757 | ],
|
|
760 | 760 | "elseif": {
|
761 | 761 | "prefix": "elseif",
|
762 | 762 | "body": [
|
763 |
| - "elseif (${condition}) {", |
| 763 | + "elseif (${1:condition}) {", |
764 | 764 | "\t$0",
|
765 | 765 | "}"
|
766 | 766 | ],
|
|
778 | 778 | "switch": {
|
779 | 779 | "prefix": "switch",
|
780 | 780 | "body": [
|
781 |
| - "switch (${variable:\\$x}) {", |
782 |
| - "\t${condition} { $0 }", |
| 781 | + "switch (${1:\\$x}) {", |
| 782 | + "\t${2:condition} { $0 }", |
783 | 783 | "\tDefault {}",
|
784 | 784 | "}"
|
785 | 785 | ],
|
|
0 commit comments