Skip to content

Commit

Permalink
add mg snippet (#6345)
Browse files Browse the repository at this point in the history
  • Loading branch information
egullbrandsson authored Mar 29, 2022
1 parent 9218c32 commit c15cc33
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Bicep.Core.Samples/Files/Completions/declarations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,35 @@
]
}
},
{
"label": "res-mg",
"kind": "snippet",
"detail": "Management Group(for tenant scope)",
"documentation": {
"kind": "markdown",
"value": "```bicep\nresource 'managementGroup' 'Microsoft.Management/managementGroups@2021-04-01' = {\n name: 'name'\n properties: {\n displayName: 'displayName'\n details: {\n parent: {\n id: 'id'\n }\n }\n }\n}\n\n```"
},
"deprecated": false,
"preselect": false,
"sortText": "2_res-mg",
"insertTextFormat": "snippet",
"insertTextMode": "adjustIndentation",
"textEdit": {
"range": {},
"newText": "resource ${1:'managementGroup'} 'Microsoft.Management/managementGroups@2021-04-01' = {\n name: ${2:'name'}\n properties: {\n displayName: ${3:'displayName'}\n details: {\n parent: {\n id: ${4:'id'}\n }\n }\n }\n}\n"
},
"command": {
"command": "bicep.Telemetry",
"arguments": [
{
"EventName": "snippet/toplevel",
"Properties": {
"name": "res-mg"
}
}
]
}
},
{
"label": "res-mysql",
"kind": "snippet",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// $1 = managementGroup
// $2 = 'name'
// $3 = 'displayName'
// $4 = 'id'
targetScope = 'tenant'
// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// $1 = managementGroup
// $2 = 'name'
// $3 = 'displayName'
// $4 = 'id'
targetScope = 'tenant'
resource managementGroup 'Microsoft.Management/managementGroups@2021-04-01' = {
name: 'name'
properties: {
displayName: 'displayName'
details: {
parent: {
id: 'id'
}
}
}
}
// Insert snippet here

12 changes: 12 additions & 0 deletions src/Bicep.LangServer/Snippets/Templates/res-mg.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Management Group(for tenant scope)
resource /*${1:'managementGroup'}*/managementGroup 'Microsoft.Management/managementGroups@2021-04-01' = {
name: /*${2:'name'}*/'name'
properties: {
displayName: /*${3:'displayName'}*/'displayName'
details: {
parent: {
id: /*${4:'id'}*/'id'
}
}
}
}

0 comments on commit c15cc33

Please sign in to comment.