diff --git a/src/Bicep.Core.Samples/Files/Completions/declarations.json b/src/Bicep.Core.Samples/Files/Completions/declarations.json index 0deec98629f..86607c356f5 100644 --- a/src/Bicep.Core.Samples/Files/Completions/declarations.json +++ b/src/Bicep.Core.Samples/Files/Completions/declarations.json @@ -1172,6 +1172,35 @@ ] } }, + { + "label": "res-expressroute-gateway", + "kind": "snippet", + "detail": "ExpressRoute Gateway", + "documentation": { + "kind": "markdown", + "value": "```bicep\nresource expressRouteGateways 'Microsoft.Network/expressRouteGateways@2021-02-01' = {\n name: 'name'\n location: resourceGroup().location\n properties: {\n virtualHub: {\n id: 'virtualHub.id'\n }\n autoScaleConfiguration: {\n bounds: {\n min: 1\n max: 1\n }\n }\n }\n}\n\n```" + }, + "deprecated": false, + "preselect": false, + "sortText": "2_res-expressroute-gateway", + "insertTextFormat": "snippet", + "insertTextMode": "adjustIndentation", + "textEdit": { + "range": {}, + "newText": "resource ${1:expressRouteGateways} 'Microsoft.Network/expressRouteGateways@2021-02-01' = {\n name: ${2:'name'}\n location: resourceGroup().location\n properties: {\n virtualHub: {\n id: ${3:'virtualHub.id'}\n }\n autoScaleConfiguration: {\n bounds: {\n min: ${4|1,2,3,4,5,6,7,8|}\n max: ${5|1,2,3,4,5,6,7,8|}\n }\n }\n }\n}\n" + }, + "command": { + "command": "bicep.Telemetry", + "arguments": [ + { + "EventName": "TopLevelDeclarationSnippetInsertion", + "Properties": { + "name": "res-expressroute-gateway" + } + } + ] + } + }, { "label": "res-firewall", "kind": "snippet", diff --git a/src/Bicep.LangServer.IntegrationTests/Completions/SnippetTemplates/res-expressroute-gateway/main.bicep b/src/Bicep.LangServer.IntegrationTests/Completions/SnippetTemplates/res-expressroute-gateway/main.bicep new file mode 100644 index 00000000000..dfad39c7a71 --- /dev/null +++ b/src/Bicep.LangServer.IntegrationTests/Completions/SnippetTemplates/res-expressroute-gateway/main.bicep @@ -0,0 +1,7 @@ +// $1 = expressRouteGateways +// $2 = 'name' +// $3 = 'virtualHub.id' +// $4 = 1 +// $5 = 2 + +// Insert snippet here diff --git a/src/Bicep.LangServer.IntegrationTests/Completions/SnippetTemplates/res-expressroute-gateway/main.combined.bicep b/src/Bicep.LangServer.IntegrationTests/Completions/SnippetTemplates/res-expressroute-gateway/main.combined.bicep new file mode 100644 index 00000000000..09286659a3d --- /dev/null +++ b/src/Bicep.LangServer.IntegrationTests/Completions/SnippetTemplates/res-expressroute-gateway/main.combined.bicep @@ -0,0 +1,22 @@ +// $1 = expressRouteGateways +// $2 = 'name' +// $3 = 'virtualHub.id' +// $4 = 1 +// $5 = 2 + +resource expressRouteGateways 'Microsoft.Network/expressRouteGateways@2021-02-01' = { + name: 'name' + location: resourceGroup().location + properties: { + virtualHub: { + id: 'virtualHub.id' + } + autoScaleConfiguration: { + bounds: { + min: 1 + max: 2 + } + } + } +} +// Insert snippet here diff --git a/src/Bicep.LangServer/Snippets/Templates/res-expressroute-gateway.bicep b/src/Bicep.LangServer/Snippets/Templates/res-expressroute-gateway.bicep new file mode 100644 index 00000000000..91c8c41d0e5 --- /dev/null +++ b/src/Bicep.LangServer/Snippets/Templates/res-expressroute-gateway.bicep @@ -0,0 +1,16 @@ +// ExpressRoute Gateway +resource /*${1:expressRouteGateways}*/expressRouteGateways 'Microsoft.Network/expressRouteGateways@2021-02-01' = { + name: /*${2:'name'}*/'name' + location: resourceGroup().location + properties: { + virtualHub: { + id: /*${3:'virtualHub.id'}*/'virtualHub.id' + } + autoScaleConfiguration: { + bounds: { + min: /*${4|1,2,3,4,5,6,7,8|}*/1 + max: /*${5|1,2,3,4,5,6,7,8|}*/2 + } + } + } +}