|
1 | 1 | // The "Requires *" snippets should be removed if-and-when intellisense is implemented for the script requirement directive syntax.
|
2 | 2 | {
|
3 |
| - "ArgumentCompleterAttribute ScriptBlock": { |
4 |
| - "prefix": "completer-scriptblock", |
5 |
| - "description": "ArgumentCompleter parameter attribute script block definition", |
6 |
| - "body": [ |
7 |
| - "{", |
8 |
| - "\t[OutputType([System.Management.Automation.CompletionResult])] # zero to many", |
9 |
| - "\tparam(", |
10 |
| - "\t\t[string] \\$CommandName,", |
11 |
| - "\t\t[string] \\$ParameterName,", |
12 |
| - "\t\t[string] \\$WordToComplete,", |
13 |
| - "\t\t[System.Management.Automation.Language.CommandAst] \\$CommandAst,", |
14 |
| - "\t\t[System.Collections.IDictionary] \\$FakeBoundParameters", |
15 |
| - "\t)", |
16 |
| - "\t", |
17 |
| - "\t${0:$TM_SELECTED_TEXT}", |
18 |
| - "}" |
19 |
| - ] |
20 |
| - }, |
21 |
| - "ArgumentCompleterAttribute with ScriptBlock": { |
22 |
| - "prefix": "completer-attribute", |
23 |
| - "description": "ArgumentCompleter parameter attribute with script block definition", |
| 3 | + "ArgumentCompleterAttribute": { |
| 4 | + "prefix": "argumentcompleter", |
| 5 | + "description": "The ArgumentCompleter attribute allows you to add tab completion values to a specific parameter by writing a scriptblock that generates zero or more CompletionResult objects. More: Get-Help -Online about_functions_argument_completion", |
24 | 6 | "body": [
|
25 | 7 | "[ArgumentCompleter({",
|
26 |
| - "\t[OutputType([System.Management.Automation.CompletionResult])] # zero to many", |
| 8 | + "\t[OutputType([System.Management.Automation.CompletionResult])]", |
27 | 9 | "\tparam(",
|
28 | 10 | "\t\t[string] \\$CommandName,",
|
29 | 11 | "\t\t[string] \\$ParameterName,",
|
|
32 | 14 | "\t\t[System.Collections.IDictionary] \\$FakeBoundParameters",
|
33 | 15 | "\t)",
|
34 | 16 | "\t",
|
35 |
| - "\t${0:$TM_SELECTED_TEXT}", |
36 |
| - "})]" |
| 17 | + "\t${1:$TM_SELECTED_TEXT}", |
| 18 | + "\t#Output one or more of these objects: [Management.Automation.CompletionResult]'MyPotentialResult'", |
| 19 | + "})]${0}" |
37 | 20 | ]
|
38 | 21 | },
|
39 | 22 | "CalculatedProperty": {
|
|
625 | 608 | },
|
626 | 609 | "function": {
|
627 | 610 | "prefix": "function",
|
628 |
| - "description": "Function definition snippet that contains a param block", |
| 611 | + "description": "A simple function with a parameter block to specify function arguments", |
629 | 612 | "body": [
|
630 | 613 | "function ${1:FunctionName} {",
|
631 | 614 | "\tparam (",
|
|
0 commit comments