Skip to content

Commit 8e4d1c0

Browse files
Fix snippet prefixes (especially #region) (#3900)
The snippets' prefixes should all be consistently lower-cased, and moreover, the region/endregion snippet must not start with a hashtag, because this triggers the completion when users are trying to type comments. VS Code also has two built-in snippets with this issue, that should be removed upstream.
1 parent 1b830ce commit 8e4d1c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

snippets/PowerShell.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
]
235235
},
236236
"Function-Inline": {
237-
"prefix": "Function-Inline",
237+
"prefix": "function-inline",
238238
"description": "Function definition snippet that does not contain a param block, but defines parameters inline. This syntax is commonly used in other languages. More: Get-Help about_Functions",
239239
"body": [
240240
"function ${1:FunctionName} (${2:OptionalParameters}) {",
@@ -256,7 +256,7 @@
256256
]
257257
},
258258
"Hashtable": {
259-
"prefix": "Hashtable",
259+
"prefix": "hashtable",
260260
"description": "A key/value store that are very efficient for finding and retrieving data. More: Get-Help about_Hash_Tables",
261261
"body": [
262262
"\\$${1:Var} = @{",
@@ -328,7 +328,7 @@
328328
]
329329
},
330330
"IfShouldProcess": {
331-
"prefix": "if-Should-Process",
331+
"prefix": "if-should-process",
332332
"description": "Defines a condition that only executes if -WhatIf is not set, and returns a message otherwise. More: https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-shouldprocess",
333333
"body": [
334334
"if (\\$PSCmdlet.ShouldProcess(\"${1:Target}\", \"${2:Operation}\")) {",
@@ -539,7 +539,7 @@
539539
]
540540
},
541541
"Region Block": {
542-
"prefix": "#region",
542+
"prefix": "region",
543543
"description": "Region block for organizing and folding of your code",
544544
"body": [
545545
"#region ${1}",

0 commit comments

Comments
 (0)