Skip to content

Commit

Permalink
Moved parent snippet to the beginning of file
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsubra committed May 4, 2021
1 parent 5a480e3 commit 43a0fe1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/Bicep.Core.Samples/Files/Completions/declarations.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"detail": "Automation Module",
"documentation": {
"kind": "markdown",
"value": "```bicep\nresource automationAccountVariable 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {\n parent: automationAccount\n name: 'name'\n properties: {\n contentLink: {\n uri: 'https://content-url.nupkg'\n }\n }\n}\n\nresource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {\n name: 'name'\n}\n```"
"value": "```bicep\nresource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {\n name: 'name'\n}\n\nresource automationAccountVariable 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {\n parent: automationAccount\n name: 'name'\n properties: {\n contentLink: {\n uri: 'https://content-url.nupkg'\n }\n }\n}\n```"
},
"deprecated": false,
"preselect": false,
Expand All @@ -236,7 +236,7 @@
"insertTextMode": "adjustIndentation",
"textEdit": {
"range": {},
"newText": "resource ${1:automationAccountVariable} 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {\n parent: automationAccount\n name: ${2:'name'}\n properties: {\n contentLink: {\n uri: ${3:'https://content-url.nupkg'}\n }\n }\n}\n\nresource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {\n name: ${4:'name'}\n}"
"newText": "resource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {\n name: ${1:'name'}\n}\n\nresource ${2:automationAccountVariable} 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {\n parent: automationAccount\n name: ${3:'name'}\n properties: {\n contentLink: {\n uri: ${4:'https://content-url.nupkg'}\n }\n }\n}"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"detail": "Required properties",
"documentation": {
"kind": "markdown",
"value": "```bicep\n{\n\tlocation: \n\tname: \n\t\n}\n```"
"value": "```bicep\n{\n\tname: \n\tlocation: \n\t\n}\n```"
},
"deprecated": false,
"preselect": true,
Expand All @@ -82,7 +82,7 @@
"insertTextMode": "adjustIndentation",
"textEdit": {
"range": {},
"newText": "{\n\tlocation: $1\n\tname: $2\n\t$0\n}"
"newText": "{\n\tname: $1\n\tlocation: $2\n\t$0\n}"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// $1 = automationAccountVariable
// $2 = 'name'
// $3 = 'https://test-content-url.nupkg'
// $4 = 'name'
// $1 = 'name'
// $2 = automationAccountVariable
// $3 = 'name'
// $4 = 'https://test-content-url.nupkg'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
resource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {
name: 'name'
}

resource automationAccountVariable 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {
parent: automationAccount
name: 'name'
Expand All @@ -7,7 +11,3 @@ resource automationAccountVariable 'Microsoft.Automation/automationAccounts/modu
}
}
}

resource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {
name: 'name'
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ public void GetResourceBodyCompletionSnippets_WithStaticTemplateAndResourceDepen
x.CompletionPriority.Should().Be(CompletionPriority.Medium);
x.Text.Should().BeEquivalentToIgnoringNewlines(@"{
parent: automationAccount
name: ${2:'name'}
name: ${3:'name'}
properties: {
contentLink: {
uri: ${3:'https://content-url.nupkg'}
uri: ${4:'https://content-url.nupkg'}
}
}
}
resource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {
name: ${4:'name'}
name: ${1:'name'}
}
");
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Automation Module
resource ${1:automationAccountVariable} 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {
resource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {
name: ${1:'name'}
}

resource ${2:automationAccountVariable} 'Microsoft.Automation/automationAccounts/modules@2015-10-31' = {
parent: automationAccount
name: ${2:'name'}
name: ${3:'name'}
properties: {
contentLink: {
uri: ${3:'https://content-url.nupkg'}
uri: ${4:'https://content-url.nupkg'}
}
}
}

resource automationAccount 'Microsoft.Automation/automationAccounts@2015-10-31' = {
name: ${4:'name'}
}

0 comments on commit 43a0fe1

Please sign in to comment.