diff --git a/.gitignore b/.gitignore index 05d73710280..9fd039e7711 100644 --- a/.gitignore +++ b/.gitignore @@ -365,3 +365,6 @@ FodyWeavers.xsd # Language Server bits bicepLanguageServer/ src/vscode-bicep/bicepLanguageServer + +# user-specific launch settings for .net apps +launchSettings.json \ No newline at end of file diff --git a/docs/examples/201/key-vault-secret-create/main.bicep b/docs/examples/201/key-vault-secret-create/main.bicep index 9b76ec0be3e..e0e8b11d22f 100644 --- a/docs/examples/201/key-vault-secret-create/main.bicep +++ b/docs/examples/201/key-vault-secret-create/main.bicep @@ -116,29 +116,12 @@ resource vault 'Microsoft.KeyVault/vaults@2019-09-01' = { } } -// workaround for missing loop support - just using the first secret for now -var firstSecretName = first(secretsObject.secrets).secretName -var firstSecretValue = first(secretsObject.secrets).secretValue - -resource secret 'Microsoft.KeyVault/vaults/secrets@2019-09-01' = { - name: '${vault.name}/${firstSecretName}' +resource secrets 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: { + name: '${keyVaultName}/${secret.secretName}' properties: { - value: firstSecretValue - } -} -/* -TODO: Replace the first secret workaround above with this once we have loops - -resource[] secrets 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [ - for secret in secretsObject.secrets: { - dependsOn: [ - vault - ] - name: '${keyVaultName}/${secret.secretName}' - properties: { - value: secret.secretValue - } + value: secret.secretValue } -] - -*/ + dependsOn: [ + vault + ] +}] diff --git a/docs/examples/201/key-vault-secret-create/main.json b/docs/examples/201/key-vault-secret-create/main.json index 9107bb8b94b..0783e139181 100644 --- a/docs/examples/201/key-vault-secret-create/main.json +++ b/docs/examples/201/key-vault-secret-create/main.json @@ -89,10 +89,6 @@ } }, "functions": [], - "variables": { - "firstSecretName": "[first(parameters('secretsObject').secrets).secretName]", - "firstSecretValue": "[first(parameters('secretsObject').secrets).secretValue]" - }, "resources": [ { "type": "Microsoft.KeyVault/vaults", @@ -128,11 +124,15 @@ } }, { + "copy": { + "name": "secrets", + "count": "[length(parameters('secretsObject').secrets)]" + }, "type": "Microsoft.KeyVault/vaults/secrets", - "apiVersion": "2019-09-01", - "name": "[format('{0}/{1}', parameters('keyVaultName'), variables('firstSecretName'))]", + "apiVersion": "2018-02-14", + "name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('secretsObject').secrets[copyIndex()].secretName)]", "properties": { - "value": "[variables('firstSecretValue')]" + "value": "[parameters('secretsObject').secrets[copyIndex()].secretValue]" }, "dependsOn": [ "[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]" @@ -143,7 +143,7 @@ "_generator": { "name": "bicep", "version": "dev", - "templateHash": "11344596542059036316" + "templateHash": "3958365733885473830" } } } \ No newline at end of file diff --git a/docs/spec/loops.md b/docs/spec/loops.md index 4771b6af85a..12957e7c925 100644 --- a/docs/spec/loops.md +++ b/docs/spec/loops.md @@ -15,7 +15,7 @@ In the below example, we are looping over `storageAccounts` array. For each loop // array of storage account names param storageAccounts array -resource[] storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for storageName in storageAccounts: { +resource storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for storageName in storageAccounts: { name: storageName location: resourceGroup().location properties: { @@ -57,7 +57,7 @@ var storageConfigurations = [ } ] -resource[] storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for (config, i) in storageConfigurations: { +resource storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for (config, i) in storageConfigurations: { name: storageAccountNamePrefix + config.suffix + i location: resourceGroup().location properties: { @@ -121,7 +121,7 @@ resource vnet 'Microsoft.Network/virtualNetworks@2018-11-01' = { The example below demonstrates a nested loop combined with filters at each loop. Filters must be expressions that evaluate to a boolean value. ``` -resource[] parentResources 'Microsoft.Example/examples@2020-06-06' = [for parent in parents where parent.enabled: { +resource parentResources 'Microsoft.Example/examples@2020-06-06' = [for parent in parents where parent.enabled: { name: parent.name properties: { children: [for child in parent.children where parent.includeChildren && child.enabled: { diff --git a/src/Bicep.Cli/Properties/launchSettings.json b/src/Bicep.Cli/Properties/launchSettings.json deleted file mode 100644 index eda54a2cafc..00000000000 --- a/src/Bicep.Cli/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "Bicep.Cli": { - "commandName": "Project", - "commandLineArgs": "build D:\\DSL\\EladDemo.arm", - "remoteDebugEnabled": false - } - } -} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/DataSets.cs b/src/Bicep.Core.Samples/DataSets.cs index bca8071ee4e..aa03380fc7f 100644 --- a/src/Bicep.Core.Samples/DataSets.cs +++ b/src/Bicep.Core.Samples/DataSets.cs @@ -32,6 +32,8 @@ public static class DataSets public static DataSet InvalidVariables_LF => CreateDataSet(); + public static DataSet Loops_LF => CreateDataSet(); + public static DataSet Outputs_CRLF => CreateDataSet(); public static DataSet Parameters_CRLF => CreateDataSet(); @@ -40,6 +42,12 @@ public static class DataSets public static DataSet Resources_CRLF => CreateDataSet(); + public static DataSet ResourcesSubscription_CRLF => CreateDataSet(); + + public static DataSet ResourcesManagementGroup_CRLF => CreateDataSet(); + + public static DataSet ResourcesTenant_CRLF => CreateDataSet(); + public static DataSet Unicode_LF => CreateDataSet(); public static DataSet Variables_LF => CreateDataSet(); diff --git a/src/Bicep.Core.Samples/Files/Functions/sys.json b/src/Bicep.Core.Samples/Files/Functions/sys.json index a6dce51e902..8d7df17ca90 100644 --- a/src/Bicep.Core.Samples/Files/Functions/sys.json +++ b/src/Bicep.Core.Samples/Files/Functions/sys.json @@ -754,7 +754,7 @@ "minimumArgumentCount": 2, "maximumArgumentCount": 2, "flags": "default", - "typeSignature": "(startIndex: int, count: int): array", + "typeSignature": "(startIndex: int, count: int): int[]", "parameterTypeSignatures": [ "startIndex: int", "count: int" diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelProperties.json b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelProperties.json index c97dd6ba411..0bf5f03bf2e 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelProperties.json +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelProperties.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelPropertiesMinusName.json b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelPropertiesMinusName.json index dbf109b2b8f..42823155339 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelPropertiesMinusName.json +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleATopLevelPropertiesMinusName.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelProperties.json b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelProperties.json index c97dd6ba411..0bf5f03bf2e 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelProperties.json +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelProperties.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelPropertiesMinusName.json b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelPropertiesMinusName.json index dbf109b2b8f..42823155339 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelPropertiesMinusName.json +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/moduleAWithConditionTopLevelPropertiesMinusName.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/symbolsPlusX.json b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/symbolsPlusX.json new file mode 100644 index 00000000000..0a57d359fce --- /dev/null +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/Completions/symbolsPlusX.json @@ -0,0 +1,2138 @@ +[ + { + "label": "any", + "kind": "function", + "detail": "any()", + "deprecated": false, + "preselect": false, + "sortText": "3_any", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "any($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "array", + "kind": "function", + "detail": "array()", + "deprecated": false, + "preselect": false, + "sortText": "3_array", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "array($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "az", + "kind": "folder", + "detail": "az", + "deprecated": false, + "preselect": false, + "sortText": "3_az", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "az" + } + }, + { + "label": "base64", + "kind": "function", + "detail": "base64()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToJson", + "kind": "function", + "detail": "base64ToJson()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToJson", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToJson($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToString", + "kind": "function", + "detail": "base64ToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "bool", + "kind": "function", + "detail": "bool()", + "deprecated": false, + "preselect": false, + "sortText": "3_bool", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bool($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "childCompletionA", + "kind": "module", + "detail": "childCompletionA", + "deprecated": false, + "preselect": false, + "sortText": "2_childCompletionA", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "childCompletionA" + } + }, + { + "label": "childCompletionB", + "kind": "module", + "detail": "childCompletionB", + "deprecated": false, + "preselect": false, + "sortText": "2_childCompletionB", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "childCompletionB" + } + }, + { + "label": "childCompletionC", + "kind": "module", + "detail": "childCompletionC", + "deprecated": false, + "preselect": false, + "sortText": "2_childCompletionC", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "childCompletionC" + } + }, + { + "label": "childCompletionD", + "kind": "module", + "detail": "childCompletionD", + "deprecated": false, + "preselect": false, + "sortText": "2_childCompletionD", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "childCompletionD" + } + }, + { + "label": "coalesce", + "kind": "function", + "detail": "coalesce()", + "deprecated": false, + "preselect": false, + "sortText": "3_coalesce", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "coalesce($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "completionB", + "kind": "module", + "detail": "completionB", + "deprecated": false, + "preselect": false, + "sortText": "2_completionB", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "completionB" + } + }, + { + "label": "completionC", + "kind": "module", + "detail": "completionC", + "deprecated": false, + "preselect": false, + "sortText": "2_completionC", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "completionC" + } + }, + { + "label": "completionD", + "kind": "module", + "detail": "completionD", + "deprecated": false, + "preselect": false, + "sortText": "2_completionD", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "completionD" + } + }, + { + "label": "completionE", + "kind": "module", + "detail": "completionE", + "deprecated": false, + "preselect": false, + "sortText": "2_completionE", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "completionE" + } + }, + { + "label": "concat", + "kind": "function", + "detail": "concat()", + "deprecated": false, + "preselect": false, + "sortText": "3_concat", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "concat($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "contains", + "kind": "function", + "detail": "contains()", + "deprecated": false, + "preselect": false, + "sortText": "3_contains", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "contains($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "cwdFileCompletionA", + "kind": "module", + "detail": "cwdFileCompletionA", + "deprecated": false, + "preselect": false, + "sortText": "2_cwdFileCompletionA", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cwdFileCompletionA" + } + }, + { + "label": "cwdFileCompletionB", + "kind": "module", + "detail": "cwdFileCompletionB", + "deprecated": false, + "preselect": false, + "sortText": "2_cwdFileCompletionB", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cwdFileCompletionB" + } + }, + { + "label": "cwdFileCompletionC", + "kind": "module", + "detail": "cwdFileCompletionC", + "deprecated": false, + "preselect": false, + "sortText": "2_cwdFileCompletionC", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cwdFileCompletionC" + } + }, + { + "label": "dataUri", + "kind": "function", + "detail": "dataUri()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dataUriToString", + "kind": "function", + "detail": "dataUriToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUriToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUriToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dateTimeAdd", + "kind": "function", + "detail": "dateTimeAdd()", + "deprecated": false, + "preselect": false, + "sortText": "3_dateTimeAdd", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dateTimeAdd($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "deployment", + "kind": "function", + "detail": "deployment()", + "deprecated": false, + "preselect": false, + "sortText": "3_deployment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "deployment()$0" + } + }, + { + "label": "directRefToCollectionViaLoopBody", + "kind": "module", + "detail": "directRefToCollectionViaLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefToCollectionViaLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefToCollectionViaLoopBody" + } + }, + { + "label": "directRefToCollectionViaLoopBodyWithExtraDependsOn", + "kind": "module", + "detail": "directRefToCollectionViaLoopBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefToCollectionViaLoopBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefToCollectionViaLoopBodyWithExtraDependsOn" + } + }, + { + "label": "directRefToCollectionViaSingleBody", + "kind": "module", + "detail": "directRefToCollectionViaSingleBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefToCollectionViaSingleBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefToCollectionViaSingleBody" + } + }, + { + "label": "directRefToCollectionViaSingleConditionalBody", + "kind": "module", + "detail": "directRefToCollectionViaSingleConditionalBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefToCollectionViaSingleConditionalBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefToCollectionViaSingleConditionalBody" + } + }, + { + "label": "empty", + "kind": "function", + "detail": "empty()", + "deprecated": false, + "preselect": false, + "sortText": "3_empty", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "empty($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "emptyArray", + "kind": "variable", + "detail": "emptyArray", + "deprecated": false, + "preselect": false, + "sortText": "2_emptyArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "emptyArray" + } + }, + { + "label": "endsWith", + "kind": "function", + "detail": "endsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_endsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "endsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "environment", + "kind": "function", + "detail": "environment()", + "deprecated": false, + "preselect": false, + "sortText": "3_environment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "environment()$0" + } + }, + { + "label": "evenMoreDuplicates", + "kind": "variable", + "detail": "evenMoreDuplicates", + "deprecated": false, + "preselect": false, + "sortText": "2_evenMoreDuplicates", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "evenMoreDuplicates" + } + }, + { + "label": "expectedArrayExpression", + "kind": "module", + "detail": "expectedArrayExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedArrayExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedArrayExpression" + } + }, + { + "label": "expectedColon", + "kind": "module", + "detail": "expectedColon", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedColon", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedColon" + } + }, + { + "label": "expectedForKeyword", + "kind": "module", + "detail": "expectedForKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword" + } + }, + { + "label": "expectedForKeyword2", + "kind": "module", + "detail": "expectedForKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword2" + } + }, + { + "label": "expectedInKeyword", + "kind": "module", + "detail": "expectedInKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword" + } + }, + { + "label": "expectedInKeyword2", + "kind": "module", + "detail": "expectedInKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword2" + } + }, + { + "label": "expectedLoopBody", + "kind": "module", + "detail": "expectedLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopBody" + } + }, + { + "label": "expectedLoopVar", + "kind": "module", + "detail": "expectedLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopVar" + } + }, + { + "label": "extensionResourceId", + "kind": "function", + "detail": "extensionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_extensionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "extensionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "first", + "kind": "function", + "detail": "first()", + "deprecated": false, + "preselect": false, + "sortText": "3_first", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "first($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "format", + "kind": "function", + "detail": "format()", + "deprecated": false, + "preselect": false, + "sortText": "3_format", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "format($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "guid", + "kind": "function", + "detail": "guid()", + "deprecated": false, + "preselect": false, + "sortText": "3_guid", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "guid($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "indexOf", + "kind": "function", + "detail": "indexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_indexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "indexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "int", + "kind": "function", + "detail": "int()", + "deprecated": false, + "preselect": false, + "sortText": "3_int", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "int($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "interp", + "kind": "variable", + "detail": "interp", + "deprecated": false, + "preselect": false, + "sortText": "2_interp", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "interp" + } + }, + { + "label": "intersection", + "kind": "function", + "detail": "intersection()", + "deprecated": false, + "preselect": false, + "sortText": "3_intersection", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "intersection($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "json", + "kind": "function", + "detail": "json()", + "deprecated": false, + "preselect": false, + "sortText": "3_json", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "json($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "last", + "kind": "function", + "detail": "last()", + "deprecated": false, + "preselect": false, + "sortText": "3_last", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "last($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "lastIndexOf", + "kind": "function", + "detail": "lastIndexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_lastIndexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "lastIndexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "length", + "kind": "function", + "detail": "length()", + "deprecated": false, + "preselect": false, + "sortText": "3_length", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "length($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "listKeys", + "kind": "function", + "detail": "listKeys()", + "deprecated": false, + "preselect": false, + "sortText": "3_listKeys", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "listKeys($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "managementGroup", + "kind": "function", + "detail": "managementGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_managementGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "managementGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "max", + "kind": "function", + "detail": "max()", + "deprecated": false, + "preselect": false, + "sortText": "3_max", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "max($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "min", + "kind": "function", + "detail": "min()", + "deprecated": false, + "preselect": false, + "sortText": "3_min", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "min($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "missingFewerLoopBodyProperties", + "kind": "module", + "detail": "missingFewerLoopBodyProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingFewerLoopBodyProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingFewerLoopBodyProperties" + } + }, + { + "label": "missingLoopBodyProperties", + "kind": "module", + "detail": "missingLoopBodyProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingLoopBodyProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingLoopBodyProperties" + } + }, + { + "label": "missingValue", + "kind": "module", + "detail": "missingValue", + "deprecated": false, + "preselect": false, + "sortText": "2_missingValue", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingValue" + } + }, + { + "label": "modAEmptyInputs", + "kind": "module", + "detail": "modAEmptyInputs", + "deprecated": false, + "preselect": false, + "sortText": "2_modAEmptyInputs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modAEmptyInputs" + } + }, + { + "label": "modAEmptyInputsWithCondition", + "kind": "module", + "detail": "modAEmptyInputsWithCondition", + "deprecated": false, + "preselect": false, + "sortText": "2_modAEmptyInputsWithCondition", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modAEmptyInputsWithCondition" + } + }, + { + "label": "modANoInputs", + "kind": "module", + "detail": "modANoInputs", + "deprecated": false, + "preselect": false, + "sortText": "2_modANoInputs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modANoInputs" + } + }, + { + "label": "modANoInputsWithCondition", + "kind": "module", + "detail": "modANoInputsWithCondition", + "deprecated": false, + "preselect": false, + "sortText": "2_modANoInputsWithCondition", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modANoInputsWithCondition" + } + }, + { + "label": "modANoName", + "kind": "module", + "detail": "modANoName", + "deprecated": false, + "preselect": false, + "sortText": "2_modANoName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modANoName" + } + }, + { + "label": "modANoNameWithCondition", + "kind": "module", + "detail": "modANoNameWithCondition", + "deprecated": false, + "preselect": false, + "sortText": "2_modANoNameWithCondition", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modANoNameWithCondition" + } + }, + { + "label": "modAUnspecifiedInputs", + "kind": "module", + "detail": "modAUnspecifiedInputs", + "deprecated": false, + "preselect": false, + "sortText": "2_modAUnspecifiedInputs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modAUnspecifiedInputs" + } + }, + { + "label": "modCycle", + "kind": "module", + "detail": "modCycle", + "deprecated": false, + "preselect": false, + "sortText": "2_modCycle", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modCycle" + } + }, + { + "label": "modWithListKeysInCondition", + "kind": "module", + "detail": "modWithListKeysInCondition", + "deprecated": false, + "preselect": false, + "sortText": "2_modWithListKeysInCondition", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modWithListKeysInCondition" + } + }, + { + "label": "modWithReferenceInCondition", + "kind": "module", + "detail": "modWithReferenceInCondition", + "deprecated": false, + "preselect": false, + "sortText": "2_modWithReferenceInCondition", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modWithReferenceInCondition" + } + }, + { + "label": "moduleOutputsCompletions", + "kind": "variable", + "detail": "moduleOutputsCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleOutputsCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleOutputsCompletions" + } + }, + { + "label": "modulePropertyAccessCompletions", + "kind": "variable", + "detail": "modulePropertyAccessCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_modulePropertyAccessCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "modulePropertyAccessCompletions" + } + }, + { + "label": "moduleWithAbsolutePath", + "kind": "module", + "detail": "moduleWithAbsolutePath", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithAbsolutePath", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithAbsolutePath" + } + }, + { + "label": "moduleWithBackslash", + "kind": "module", + "detail": "moduleWithBackslash", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithBackslash", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithBackslash" + } + }, + { + "label": "moduleWithBadScope", + "kind": "module", + "detail": "moduleWithBadScope", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithBadScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithBadScope" + } + }, + { + "label": "moduleWithConditionAndInterpPath", + "kind": "module", + "detail": "moduleWithConditionAndInterpPath", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithConditionAndInterpPath", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithConditionAndInterpPath" + } + }, + { + "label": "moduleWithConditionAndSelfCycle", + "kind": "module", + "detail": "moduleWithConditionAndSelfCycle", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithConditionAndSelfCycle", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithConditionAndSelfCycle" + } + }, + { + "label": "moduleWithConditionOutputsCompletions", + "kind": "variable", + "detail": "moduleWithConditionOutputsCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithConditionOutputsCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithConditionOutputsCompletions" + } + }, + { + "label": "moduleWithConditionPropertyAccessCompletions", + "kind": "variable", + "detail": "moduleWithConditionPropertyAccessCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithConditionPropertyAccessCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithConditionPropertyAccessCompletions" + } + }, + { + "label": "moduleWithDuplicateName1", + "kind": "module", + "detail": "moduleWithDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithDuplicateName1" + } + }, + { + "label": "moduleWithDuplicateName2", + "kind": "module", + "detail": "moduleWithDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithDuplicateName2" + } + }, + { + "label": "moduleWithEmptyPath", + "kind": "module", + "detail": "moduleWithEmptyPath", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithEmptyPath", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithEmptyPath" + } + }, + { + "label": "moduleWithInterpPath", + "kind": "module", + "detail": "moduleWithInterpPath", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithInterpPath", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithInterpPath" + } + }, + { + "label": "moduleWithInvalidChar", + "kind": "module", + "detail": "moduleWithInvalidChar", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithInvalidChar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithInvalidChar" + } + }, + { + "label": "moduleWithInvalidScope", + "kind": "module", + "detail": "moduleWithInvalidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithInvalidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithInvalidScope" + } + }, + { + "label": "moduleWithInvalidScope2", + "kind": "module", + "detail": "moduleWithInvalidScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithInvalidScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithInvalidScope2" + } + }, + { + "label": "moduleWithInvalidTerminatorChar", + "kind": "module", + "detail": "moduleWithInvalidTerminatorChar", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithInvalidTerminatorChar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithInvalidTerminatorChar" + } + }, + { + "label": "moduleWithMissingRequiredScope", + "kind": "module", + "detail": "moduleWithMissingRequiredScope", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithMissingRequiredScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithMissingRequiredScope" + } + }, + { + "label": "moduleWithNotAttachableDecorators", + "kind": "module", + "detail": "moduleWithNotAttachableDecorators", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithNotAttachableDecorators", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithNotAttachableDecorators" + } + }, + { + "label": "moduleWithSelfCycle", + "kind": "module", + "detail": "moduleWithSelfCycle", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithSelfCycle", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithSelfCycle" + } + }, + { + "label": "moduleWithUnsupprtedScope1", + "kind": "module", + "detail": "moduleWithUnsupprtedScope1", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithUnsupprtedScope1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithUnsupprtedScope1" + } + }, + { + "label": "moduleWithUnsupprtedScope2", + "kind": "module", + "detail": "moduleWithUnsupprtedScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithUnsupprtedScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithUnsupprtedScope2" + } + }, + { + "label": "moduleWithValidScope", + "kind": "module", + "detail": "moduleWithValidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithValidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithValidScope" + } + }, + { + "label": "moduleWithoutPath", + "kind": "module", + "detail": "moduleWithoutPath", + "deprecated": false, + "preselect": false, + "sortText": "2_moduleWithoutPath", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "moduleWithoutPath" + } + }, + { + "label": "nonExistentFileRef", + "kind": "module", + "detail": "nonExistentFileRef", + "deprecated": false, + "preselect": false, + "sortText": "2_nonExistentFileRef", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonExistentFileRef" + } + }, + { + "label": "nonExistentFileRefDuplicate", + "kind": "module", + "detail": "nonExistentFileRefDuplicate", + "deprecated": false, + "preselect": false, + "sortText": "2_nonExistentFileRefDuplicate", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonExistentFileRefDuplicate" + } + }, + { + "label": "nonExistentFileRefEquivalentPath", + "kind": "module", + "detail": "nonExistentFileRefEquivalentPath", + "deprecated": false, + "preselect": false, + "sortText": "2_nonExistentFileRefEquivalentPath", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonExistentFileRefEquivalentPath" + } + }, + { + "label": "nonObjectModuleBody", + "kind": "module", + "detail": "nonObjectModuleBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectModuleBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectModuleBody" + } + }, + { + "label": "nonObjectModuleBody2", + "kind": "module", + "detail": "nonObjectModuleBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectModuleBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectModuleBody2" + } + }, + { + "label": "nonexistentArrays", + "kind": "module", + "detail": "nonexistentArrays", + "deprecated": false, + "preselect": false, + "sortText": "2_nonexistentArrays", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonexistentArrays" + } + }, + { + "label": "notAnArray", + "kind": "variable", + "detail": "notAnArray", + "deprecated": false, + "preselect": false, + "sortText": "2_notAnArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAnArray" + } + }, + { + "label": "padLeft", + "kind": "function", + "detail": "padLeft()", + "deprecated": false, + "preselect": false, + "sortText": "3_padLeft", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "padLeft($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "pickZones", + "kind": "function", + "detail": "pickZones()", + "deprecated": false, + "preselect": false, + "sortText": "3_pickZones", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "pickZones($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "providers", + "kind": "function", + "detail": "providers()", + "deprecated": false, + "preselect": false, + "sortText": "3_providers", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "providers($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "range", + "kind": "function", + "detail": "range()", + "deprecated": false, + "preselect": false, + "sortText": "3_range", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "range($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "reference", + "kind": "function", + "detail": "reference()", + "deprecated": false, + "preselect": false, + "sortText": "3_reference", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "reference($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "replace", + "kind": "function", + "detail": "replace()", + "deprecated": false, + "preselect": false, + "sortText": "3_replace", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "replace($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceGroup", + "kind": "function", + "detail": "resourceGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceId", + "kind": "function", + "detail": "resourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "runtimeInvalidModule1", + "kind": "module", + "detail": "runtimeInvalidModule1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidModule1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidModule1" + } + }, + { + "label": "runtimeInvalidModule2", + "kind": "module", + "detail": "runtimeInvalidModule2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidModule2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidModule2" + } + }, + { + "label": "runtimeInvalidModule3", + "kind": "module", + "detail": "runtimeInvalidModule3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidModule3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidModule3" + } + }, + { + "label": "runtimeInvalidModule4", + "kind": "module", + "detail": "runtimeInvalidModule4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidModule4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidModule4" + } + }, + { + "label": "runtimeInvalidModule5", + "kind": "module", + "detail": "runtimeInvalidModule5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidModule5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidModule5" + } + }, + { + "label": "runtimeInvalidModule6", + "kind": "module", + "detail": "runtimeInvalidModule6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidModule6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidModule6" + } + }, + { + "label": "runtimeValidModule1", + "kind": "module", + "detail": "runtimeValidModule1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidModule1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidModule1" + } + }, + { + "label": "runtimeValidRes1", + "kind": "interface", + "detail": "runtimeValidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes1" + } + }, + { + "label": "skip", + "kind": "function", + "detail": "skip()", + "deprecated": false, + "preselect": false, + "sortText": "3_skip", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "skip($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "split", + "kind": "function", + "detail": "split()", + "deprecated": false, + "preselect": false, + "sortText": "3_split", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "split($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "startsWith", + "kind": "function", + "detail": "startsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_startsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "string", + "kind": "function", + "detail": "string()", + "deprecated": false, + "preselect": false, + "sortText": "3_string", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscription", + "kind": "function", + "detail": "subscription()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscription", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscription($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscriptionResourceId", + "kind": "function", + "detail": "subscriptionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscriptionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscriptionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "substring", + "kind": "function", + "detail": "substring()", + "deprecated": false, + "preselect": false, + "sortText": "3_substring", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "substring($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "sys", + "kind": "folder", + "detail": "sys", + "deprecated": false, + "preselect": false, + "sortText": "3_sys", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sys" + } + }, + { + "label": "take", + "kind": "function", + "detail": "take()", + "deprecated": false, + "preselect": false, + "sortText": "3_take", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "take($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "tenant", + "kind": "function", + "detail": "tenant()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenant", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenant()$0" + } + }, + { + "label": "tenantResourceId", + "kind": "function", + "detail": "tenantResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenantResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenantResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toLower", + "kind": "function", + "detail": "toLower()", + "deprecated": false, + "preselect": false, + "sortText": "3_toLower", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toLower($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toUpper", + "kind": "function", + "detail": "toUpper()", + "deprecated": false, + "preselect": false, + "sortText": "3_toUpper", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toUpper($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "trim", + "kind": "function", + "detail": "trim()", + "deprecated": false, + "preselect": false, + "sortText": "3_trim", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trim($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "union", + "kind": "function", + "detail": "union()", + "deprecated": false, + "preselect": false, + "sortText": "3_union", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "union($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uniqueString", + "kind": "function", + "detail": "uniqueString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uniqueString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uniqueString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "unspecifiedOutput", + "kind": "variable", + "detail": "unspecifiedOutput", + "deprecated": false, + "preselect": false, + "sortText": "2_unspecifiedOutput", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "unspecifiedOutput" + } + }, + { + "label": "uri", + "kind": "function", + "detail": "uri()", + "deprecated": false, + "preselect": false, + "sortText": "3_uri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponent", + "kind": "function", + "detail": "uriComponent()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponent", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponent($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponentToString", + "kind": "function", + "detail": "uriComponentToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponentToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponentToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "wrongArrayType", + "kind": "module", + "detail": "wrongArrayType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongArrayType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongArrayType" + } + }, + { + "label": "wrongLoopBodyType", + "kind": "module", + "detail": "wrongLoopBodyType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongLoopBodyType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongLoopBodyType" + } + }, + { + "label": "x", + "kind": "variable", + "detail": "x", + "deprecated": false, + "preselect": false, + "sortText": "2_x", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "x" + } + } +] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.bicep b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.bicep index 1fb10565d4b..a270496e6c1 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.bicep @@ -322,6 +322,7 @@ module missingFewerLoopBodyProperties 'modulea.bicep' = [for x in emptyArray:{ // wrong parameter in the module loop module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ + // #completionTest(17) -> symbolsPlusX name: 'hello-${x}' params: { arrayParam: [] @@ -343,70 +344,51 @@ module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNo } }] -/* - valid loop - this should be moved to Modules_* test case after E2E works -*/ -var myModules = [ - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' - } -] +output directRefToCollectionViaOutput array = nonexistentArrays -// duplicate identifiers across scopes are allowed (inner hides the outer) -module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ - name: 'hello-${x}' +module directRefToCollectionViaSingleBody 'modulea.bicep' = { + name: 'hello' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: y] + stringParamB: '' } -}] +} -// duplicate identifiers across scopes are allowed (inner hides the outer) -var duplicateAcrossScopes = 'hello' -module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { - name: 'hello-${duplicateAcrossScopes}' +module directRefToCollectionViaSingleConditionalBody 'modulea.bicep' = if(true) { + name: 'hello2' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: x] + stringParamB: '' } -}] +} -var someDuplicate = true -var otherDuplicate = false -module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { - name: 'hello-${someDuplicate}' +module directRefToCollectionViaLoopBody 'modulea.bicep' = [for test in []: { + name: 'hello3' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamB: 'test' - arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] + stringParamB: '' } }] -// simple module loop -module storageResources 'modulea.bicep' = [for module in myModules: { - name: module.name +module directRefToCollectionViaLoopBodyWithExtraDependsOn 'modulea.bicep' = [for test in []: { + name: 'hello4' params: { - arrayParam: [] - objParam: module - stringParamB: module.location + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) + objParam: {} + stringParamB: '' + dependsOn: [ + nonexistentArrays + ] } + dependsOn: [ + + ] }] -// nested module loop -module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { - name: module.name - params: { - arrayParam: [for i in range(0,3): concat('test', i)] - objParam: module - stringParamB: module.location - } -}] \ No newline at end of file + +// module body that isn't an object +module nonObjectModuleBody 'modulea.bicep' = [for thing in []: 'hello'] +module nonObjectModuleBody2 'modulea.bicep' = [for thing in []: concat()] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.diagnostics.bicep index cf12758b9c9..c09a6281509 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.diagnostics.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.diagnostics.bicep @@ -386,54 +386,44 @@ module expectedForKeyword2 'modulea.bicep' = [f] //@[46:47) [BCP012 (Error)] Expected the "for" keyword at this location. |f| module expectedLoopVar 'modulea.bicep' = [for] -//@[42:45) [BCP138 (Error)] Loops are not currently supported. |for| //@[45:46) [BCP136 (Error)] Expected a loop variable identifier at this location. |]| module expectedInKeyword 'modulea.bicep' = [for x] -//@[44:47) [BCP138 (Error)] Loops are not currently supported. |for| //@[49:50) [BCP012 (Error)] Expected the "in" keyword at this location. |]| module expectedInKeyword2 'modulea.bicep' = [for x b] -//@[45:48) [BCP138 (Error)] Loops are not currently supported. |for| //@[51:52) [BCP012 (Error)] Expected the "in" keyword at this location. |b| //@[52:53) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. |]| module expectedArrayExpression 'modulea.bicep' = [for x in] -//@[50:53) [BCP138 (Error)] Loops are not currently supported. |for| //@[58:59) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. |]| module expectedColon 'modulea.bicep' = [for x in y] -//@[40:43) [BCP138 (Error)] Loops are not currently supported. |for| //@[49:50) [BCP057 (Error)] The name "y" does not exist in the current context. |y| //@[50:51) [BCP018 (Error)] Expected the ":" character at this location. |]| module expectedLoopBody 'modulea.bicep' = [for x in y:] -//@[43:46) [BCP138 (Error)] Loops are not currently supported. |for| //@[52:53) [BCP057 (Error)] The name "y" does not exist in the current context. |y| -//@[54:55) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. |]| +//@[54:55) [BCP018 (Error)] Expected the "{" character at this location. |]| // wrong loop body type var emptyArray = [] module wrongLoopBodyType 'modulea.bicep' = [for x in emptyArray:4] -//@[44:47) [BCP138 (Error)] Loops are not currently supported. |for| -//@[64:65) [BCP033 (Error)] Expected a value of type "module" but the provided value is of type "int". |4| +//@[64:65) [BCP018 (Error)] Expected the "{" character at this location. |4| // missing loop body properties module missingLoopBodyProperties 'modulea.bicep' = [for x in emptyArray:{ //@[7:32) [BCP035 (Error)] The specified "module" declaration is missing the following required properties: "name", "params". |missingLoopBodyProperties| -//@[52:55) [BCP138 (Error)] Loops are not currently supported. |for| }] // wrong array type var notAnArray = true module wrongArrayType 'modulea.bicep' = [for x in notAnArray:{ -//@[41:44) [BCP138 (Error)] Loops are not currently supported. |for| //@[50:60) [BCP137 (Error)] Loop expected an expression of type "array" but the provided value is of type "bool". |notAnArray| }] // missing fewer properties module missingFewerLoopBodyProperties 'modulea.bicep' = [for x in emptyArray:{ -//@[57:60) [BCP138 (Error)] Loops are not currently supported. |for| name: 'hello-${x}' params: { //@[2:8) [BCP035 (Error)] The specified "object" declaration is missing the following required properties: "arrayParam", "objParam", "stringParamB". |params| @@ -443,7 +433,7 @@ module missingFewerLoopBodyProperties 'modulea.bicep' = [for x in emptyArray:{ // wrong parameter in the module loop module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ -//@[53:56) [BCP138 (Error)] Loops are not currently supported. |for| + // #completionTest(17) -> symbolsPlusX name: 'hello-${x}' params: { arrayParam: [] @@ -458,7 +448,6 @@ module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ // nonexistent arrays and loop variables var evenMoreDuplicates = 'there' module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNotExist: { -//@[44:47) [BCP138 (Error)] Loops are not currently supported. |for| //@[70:86) [BCP057 (Error)] The name "alsoDoesNotExist" does not exist in the current context. |alsoDoesNotExist| name: 'hello-${whyChooseRealVariablesWhenWeCanPretend}' //@[17:55) [BCP057 (Error)] The name "whyChooseRealVariablesWhenWeCanPretend" does not exist in the current context. |whyChooseRealVariablesWhenWeCanPretend| @@ -466,86 +455,69 @@ module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNo objParam: {} stringParamB: 'test' arrayParam: [for evenMoreDuplicates in totallyFake: doesNotExist] -//@[17:20) [BCP138 (Error)] Loops are not currently supported. |for| //@[43:54) [BCP057 (Error)] The name "totallyFake" does not exist in the current context. |totallyFake| //@[56:68) [BCP057 (Error)] The name "doesNotExist" does not exist in the current context. |doesNotExist| } }] -/* - valid loop - this should be moved to Modules_* test case after E2E works -*/ -var myModules = [ - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' - } -] +output directRefToCollectionViaOutput array = nonexistentArrays +//@[46:63) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |nonexistentArrays| -// duplicate identifiers across scopes are allowed (inner hides the outer) -module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ -//@[57:60) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'hello-${x}' +module directRefToCollectionViaSingleBody 'modulea.bicep' = { + name: 'hello' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[23:49) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |wrongModuleParameterInLoop| +//@[51:68) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |nonexistentArrays| objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: y] -//@[17:20) [BCP138 (Error)] Loops are not currently supported. |for| -//@[38:39) [BCP057 (Error)] The name "y" does not exist in the current context. |y| + stringParamB: '' } -}] +} -// duplicate identifiers across scopes are allowed (inner hides the outer) -var duplicateAcrossScopes = 'hello' -module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { -//@[54:57) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'hello-${duplicateAcrossScopes}' +module directRefToCollectionViaSingleConditionalBody 'modulea.bicep' = if(true) { + name: 'hello2' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[23:49) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |wrongModuleParameterInLoop| +//@[51:68) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |nonexistentArrays| objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: x] -//@[17:20) [BCP138 (Error)] Loops are not currently supported. |for| + stringParamB: '' } -}] +} -var someDuplicate = true -var otherDuplicate = false -module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { -//@[47:50) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'hello-${someDuplicate}' +module directRefToCollectionViaLoopBody 'modulea.bicep' = [for test in []: { + name: 'hello3' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[23:49) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |wrongModuleParameterInLoop| +//@[51:68) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |nonexistentArrays| objParam: {} - stringParamB: 'test' - arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] -//@[17:20) [BCP138 (Error)] Loops are not currently supported. |for| + stringParamB: '' } }] -// simple module loop -module storageResources 'modulea.bicep' = [for module in myModules: { -//@[43:46) [BCP138 (Error)] Loops are not currently supported. |for| - name: module.name +module directRefToCollectionViaLoopBodyWithExtraDependsOn 'modulea.bicep' = [for test in []: { + name: 'hello4' params: { - arrayParam: [] - objParam: module - stringParamB: module.location + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[23:49) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |wrongModuleParameterInLoop| +//@[51:68) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |nonexistentArrays| + objParam: {} + stringParamB: '' + dependsOn: [ +//@[4:13) [BCP038 (Error)] The property "dependsOn" is not allowed on objects of type "params". Permissible properties include "stringParamA". |dependsOn| + nonexistentArrays +//@[6:23) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |nonexistentArrays| + ] } + dependsOn: [ + + ] }] -// nested module loop -module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { -//@[43:46) [BCP138 (Error)] Loops are not currently supported. |for| - name: module.name - params: { - arrayParam: [for i in range(0,3): concat('test', i)] -//@[17:20) [BCP138 (Error)] Loops are not currently supported. |for| - objParam: module - stringParamB: module.location - } -}] + +// module body that isn't an object +module nonObjectModuleBody 'modulea.bicep' = [for thing in []: 'hello'] +//@[63:70) [BCP018 (Error)] Expected the "{" character at this location. |'hello'| +module nonObjectModuleBody2 'modulea.bicep' = [for thing in []: concat()] +//@[64:70) [BCP018 (Error)] Expected the "{" character at this location. |concat| diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.formatted.bicep index 523d1df29eb..540b8db2a34 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.formatted.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.formatted.bicep @@ -269,7 +269,7 @@ module expectedLoopBody 'modulea.bicep' = [for x in y:] // wrong loop body type var emptyArray = [] -module wrongLoopBodyType 'modulea.bicep' = [for x in emptyArray: 4] +module wrongLoopBodyType 'modulea.bicep' = [for x in emptyArray:4] // missing loop body properties module missingLoopBodyProperties 'modulea.bicep' = [for x in emptyArray: {}] @@ -286,6 +286,7 @@ module missingFewerLoopBodyProperties 'modulea.bicep' = [for x in emptyArray: { // wrong parameter in the module loop module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray: { + // #completionTest(17) -> symbolsPlusX name: 'hello-${x}' params: { arrayParam: [] @@ -307,70 +308,48 @@ module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNo } }] -/* - valid loop - this should be moved to Modules_* test case after E2E works -*/ -var myModules = [ - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' - } -] +output directRefToCollectionViaOutput array = nonexistentArrays -// duplicate identifiers across scopes are allowed (inner hides the outer) -module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray: { - name: 'hello-${x}' +module directRefToCollectionViaSingleBody 'modulea.bicep' = { + name: 'hello' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: y] + stringParamB: '' } -}] +} -// duplicate identifiers across scopes are allowed (inner hides the outer) -var duplicateAcrossScopes = 'hello' -module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { - name: 'hello-${duplicateAcrossScopes}' +module directRefToCollectionViaSingleConditionalBody 'modulea.bicep' = if (true) { + name: 'hello2' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: x] + stringParamB: '' } -}] +} -var someDuplicate = true -var otherDuplicate = false -module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { - name: 'hello-${someDuplicate}' +module directRefToCollectionViaLoopBody 'modulea.bicep' = [for test in []: { + name: 'hello3' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamB: 'test' - arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] + stringParamB: '' } }] -// simple module loop -module storageResources 'modulea.bicep' = [for module in myModules: { - name: module.name +module directRefToCollectionViaLoopBodyWithExtraDependsOn 'modulea.bicep' = [for test in []: { + name: 'hello4' params: { - arrayParam: [] - objParam: module - stringParamB: module.location + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) + objParam: {} + stringParamB: '' + dependsOn: [ + nonexistentArrays + ] } + dependsOn: [] }] -// nested module loop -module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { - name: module.name - params: { - arrayParam: [for i in range(0, 3): concat('test', i)] - objParam: module - stringParamB: module.location - } -}] +// module body that isn't an object +module nonObjectModuleBody 'modulea.bicep' = [for thing in []: 'hello'] +module nonObjectModuleBody2 'modulea.bicep' = [for thing in []: concat()] diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.symbols.bicep index 9ba4e555bd2..f1b7dcb4572 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.symbols.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.symbols.bicep @@ -417,7 +417,8 @@ module missingFewerLoopBodyProperties 'modulea.bicep' = [for x in emptyArray:{ // wrong parameter in the module loop module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ //@[57:58) Local x. Type: any. Declaration start char: 57, length: 1 -//@[7:33) Module wrongModuleParameterInLoop. Type: module[]. Declaration start char: 0, length: 222 +//@[7:33) Module wrongModuleParameterInLoop. Type: module[]. Declaration start char: 0, length: 263 + // #completionTest(17) -> symbolsPlusX name: 'hello-${x}' params: { arrayParam: [] @@ -443,88 +444,62 @@ module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNo } }] -/* - valid loop - this should be moved to Modules_* test case after E2E works -*/ -var myModules = [ -//@[4:13) Variable myModules. Type: array. Declaration start char: 0, length: 114 - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' - } -] +output directRefToCollectionViaOutput array = nonexistentArrays +//@[7:37) Output directRefToCollectionViaOutput. Type: array. Declaration start char: 0, length: 63 -// duplicate identifiers across scopes are allowed (inner hides the outer) -module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ -//@[61:62) Local x. Type: any. Declaration start char: 61, length: 1 -//@[7:37) Module duplicateIdentifiersWithinLoop. Type: module[]. Declaration start char: 0, length: 226 - name: 'hello-${x}' +module directRefToCollectionViaSingleBody 'modulea.bicep' = { +//@[7:41) Module directRefToCollectionViaSingleBody. Type: module. Declaration start char: 0, length: 203 + name: 'hello' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: y] -//@[21:22) Local x. Type: any. Declaration start char: 21, length: 1 + stringParamB: '' } -}] +} -// duplicate identifiers across scopes are allowed (inner hides the outer) -var duplicateAcrossScopes = 'hello' -//@[4:25) Variable duplicateAcrossScopes. Type: 'hello'. Declaration start char: 0, length: 35 -module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { -//@[58:79) Local duplicateAcrossScopes. Type: any. Declaration start char: 58, length: 21 -//@[7:34) Module duplicateInGlobalAndOneLoop. Type: module[]. Declaration start char: 0, length: 256 - name: 'hello-${duplicateAcrossScopes}' +module directRefToCollectionViaSingleConditionalBody 'modulea.bicep' = if(true) { +//@[7:52) Module directRefToCollectionViaSingleConditionalBody. Type: module. Declaration start char: 0, length: 224 + name: 'hello2' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamA: 'test' - stringParamB: 'test' - arrayParam: [for x in emptyArray: x] -//@[21:22) Local x. Type: any. Declaration start char: 21, length: 1 + stringParamB: '' } -}] +} -var someDuplicate = true -//@[4:17) Variable someDuplicate. Type: bool. Declaration start char: 0, length: 24 -var otherDuplicate = false -//@[4:18) Variable otherDuplicate. Type: bool. Declaration start char: 0, length: 26 -module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { -//@[51:64) Local someDuplicate. Type: any. Declaration start char: 51, length: 13 -//@[7:27) Module duplicatesEverywhere. Type: module[]. Declaration start char: 0, length: 256 - name: 'hello-${someDuplicate}' +module directRefToCollectionViaLoopBody 'modulea.bicep' = [for test in []: { +//@[63:67) Local test. Type: any. Declaration start char: 63, length: 4 +//@[7:39) Module directRefToCollectionViaLoopBody. Type: module[]. Declaration start char: 0, length: 220 + name: 'hello3' params: { + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) objParam: {} - stringParamB: 'test' - arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] -//@[21:35) Local otherDuplicate. Type: any. Declaration start char: 21, length: 14 + stringParamB: '' } }] -// simple module loop -module storageResources 'modulea.bicep' = [for module in myModules: { -//@[47:53) Local module. Type: any. Declaration start char: 47, length: 6 -//@[7:23) Module storageResources. Type: module[]. Declaration start char: 0, length: 182 - name: module.name +module directRefToCollectionViaLoopBodyWithExtraDependsOn 'modulea.bicep' = [for test in []: { +//@[81:85) Local test. Type: any. Declaration start char: 81, length: 4 +//@[7:57) Module directRefToCollectionViaLoopBodyWithExtraDependsOn. Type: module[]. Declaration start char: 0, length: 309 + name: 'hello4' params: { - arrayParam: [] - objParam: module - stringParamB: module.location + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) + objParam: {} + stringParamB: '' + dependsOn: [ + nonexistentArrays + ] } + dependsOn: [ + + ] }] -// nested module loop -module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { -//@[47:53) Local module. Type: any. Declaration start char: 47, length: 6 -//@[7:23) Module nestedModuleLoop. Type: module[]. Declaration start char: 0, length: 220 - name: module.name - params: { - arrayParam: [for i in range(0,3): concat('test', i)] -//@[21:22) Local i. Type: any. Declaration start char: 21, length: 1 - objParam: module - stringParamB: module.location - } -}] + +// module body that isn't an object +module nonObjectModuleBody 'modulea.bicep' = [for thing in []: 'hello'] +//@[50:55) Local thing. Type: any. Declaration start char: 50, length: 5 +//@[7:26) Module nonObjectModuleBody. Type: module[]. Declaration start char: 0, length: 71 +module nonObjectModuleBody2 'modulea.bicep' = [for thing in []: concat()] +//@[51:56) Local thing. Type: any. Declaration start char: 51, length: 5 +//@[7:27) Module nonObjectModuleBody2. Type: module[]. Declaration start char: 0, length: 73 diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.syntax.bicep index 528a12198de..f68eec0bbe3 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.syntax.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.syntax.bicep @@ -1913,7 +1913,7 @@ module wrongLoopBodyType 'modulea.bicep' = [for x in emptyArray:4] //@[53:63) IdentifierSyntax //@[53:63) Identifier |emptyArray| //@[63:64) Colon |:| -//@[64:65) IntegerLiteralSyntax +//@[64:65) SkippedTriviaSyntax //@[64:65) Integer |4| //@[65:66) RightSquare |]| //@[66:68) NewLine |\n\n| @@ -2041,14 +2041,14 @@ module missingFewerLoopBodyProperties 'modulea.bicep' = [for x in emptyArray:{ // wrong parameter in the module loop //@[37:38) NewLine |\n| module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ -//@[0:222) ModuleDeclarationSyntax +//@[0:263) ModuleDeclarationSyntax //@[0:6) Identifier |module| //@[7:33) IdentifierSyntax //@[7:33) Identifier |wrongModuleParameterInLoop| //@[34:49) StringSyntax //@[34:49) StringComplete |'modulea.bicep'| //@[50:51) Assignment |=| -//@[52:222) ForSyntax +//@[52:263) ForSyntax //@[52:53) LeftSquare |[| //@[53:56) Identifier |for| //@[57:58) LocalVariableSyntax @@ -2059,9 +2059,11 @@ module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ //@[62:72) IdentifierSyntax //@[62:72) Identifier |emptyArray| //@[72:73) Colon |:| -//@[73:221) ObjectSyntax +//@[73:262) ObjectSyntax //@[73:74) LeftBrace |{| //@[74:75) NewLine |\n| + // #completionTest(17) -> symbolsPlusX +//@[40:41) NewLine |\n| name: 'hello-${x}' //@[2:20) ObjectPropertySyntax //@[2:6) IdentifierSyntax @@ -2231,107 +2233,116 @@ module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNo //@[1:2) RightSquare |]| //@[2:4) NewLine |\n\n| -/* - valid loop - this should be moved to Modules_* test case after E2E works -*/ -//@[3:4) NewLine |\n| -var myModules = [ -//@[0:114) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:13) IdentifierSyntax -//@[4:13) Identifier |myModules| -//@[14:15) Assignment |=| -//@[16:114) ArraySyntax -//@[16:17) LeftSquare |[| -//@[17:18) NewLine |\n| - { -//@[2:47) ArrayItemSyntax -//@[2:47) ObjectSyntax -//@[2:3) LeftBrace |{| -//@[3:4) NewLine |\n| - name: 'one' -//@[4:15) ObjectPropertySyntax -//@[4:8) IdentifierSyntax -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringSyntax -//@[10:15) StringComplete |'one'| -//@[15:16) NewLine |\n| - location: 'eastus2' -//@[4:23) ObjectPropertySyntax -//@[4:12) IdentifierSyntax -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:23) StringSyntax -//@[14:23) StringComplete |'eastus2'| -//@[23:24) NewLine |\n| - } -//@[2:3) RightBrace |}| -//@[3:4) NewLine |\n| - { -//@[2:46) ArrayItemSyntax -//@[2:46) ObjectSyntax -//@[2:3) LeftBrace |{| -//@[3:4) NewLine |\n| - name: 'two' -//@[4:15) ObjectPropertySyntax -//@[4:8) IdentifierSyntax -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringSyntax -//@[10:15) StringComplete |'two'| -//@[15:16) NewLine |\n| - location: 'westus' -//@[4:22) ObjectPropertySyntax +output directRefToCollectionViaOutput array = nonexistentArrays +//@[0:63) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:37) IdentifierSyntax +//@[7:37) Identifier |directRefToCollectionViaOutput| +//@[38:43) TypeSyntax +//@[38:43) Identifier |array| +//@[44:45) Assignment |=| +//@[46:63) VariableAccessSyntax +//@[46:63) IdentifierSyntax +//@[46:63) Identifier |nonexistentArrays| +//@[63:65) NewLine |\n\n| + +module directRefToCollectionViaSingleBody 'modulea.bicep' = { +//@[0:203) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:41) IdentifierSyntax +//@[7:41) Identifier |directRefToCollectionViaSingleBody| +//@[42:57) StringSyntax +//@[42:57) StringComplete |'modulea.bicep'| +//@[58:59) Assignment |=| +//@[60:203) ObjectSyntax +//@[60:61) LeftBrace |{| +//@[61:62) NewLine |\n| + name: 'hello' +//@[2:15) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringSyntax +//@[8:15) StringComplete |'hello'| +//@[15:16) NewLine |\n| + params: { +//@[2:123) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:123) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:69) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:69) FunctionCallSyntax +//@[16:22) IdentifierSyntax +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:50) FunctionArgumentSyntax +//@[23:49) VariableAccessSyntax +//@[23:49) IdentifierSyntax +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) FunctionArgumentSyntax +//@[51:68) VariableAccessSyntax +//@[51:68) IdentifierSyntax +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| + objParam: {} +//@[4:16) ObjectPropertySyntax //@[4:12) IdentifierSyntax -//@[4:12) Identifier |location| +//@[4:12) Identifier |objParam| //@[12:13) Colon |:| -//@[14:22) StringSyntax -//@[14:22) StringComplete |'westus'| -//@[22:23) NewLine |\n| +//@[14:16) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:17) NewLine |\n| + stringParamB: '' +//@[4:20) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:20) StringSyntax +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| } //@[2:3) RightBrace |}| //@[3:4) NewLine |\n| -] -//@[0:1) RightSquare |]| +} +//@[0:1) RightBrace |}| //@[1:3) NewLine |\n\n| -// duplicate identifiers across scopes are allowed (inner hides the outer) -//@[74:75) NewLine |\n| -module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ -//@[0:226) ModuleDeclarationSyntax -//@[0:6) Identifier |module| -//@[7:37) IdentifierSyntax -//@[7:37) Identifier |duplicateIdentifiersWithinLoop| -//@[38:53) StringSyntax -//@[38:53) StringComplete |'modulea.bicep'| -//@[54:55) Assignment |=| -//@[56:226) ForSyntax -//@[56:57) LeftSquare |[| -//@[57:60) Identifier |for| -//@[61:62) LocalVariableSyntax -//@[61:62) IdentifierSyntax -//@[61:62) Identifier |x| -//@[63:65) Identifier |in| -//@[66:76) VariableAccessSyntax -//@[66:76) IdentifierSyntax -//@[66:76) Identifier |emptyArray| -//@[76:77) Colon |:| -//@[77:225) ObjectSyntax -//@[77:78) LeftBrace |{| -//@[78:79) NewLine |\n| - name: 'hello-${x}' -//@[2:20) ObjectPropertySyntax +module directRefToCollectionViaSingleConditionalBody 'modulea.bicep' = if(true) { +//@[0:224) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:52) IdentifierSyntax +//@[7:52) Identifier |directRefToCollectionViaSingleConditionalBody| +//@[53:68) StringSyntax +//@[53:68) StringComplete |'modulea.bicep'| +//@[69:70) Assignment |=| +//@[71:224) IfConditionSyntax +//@[71:73) Identifier |if| +//@[73:79) ParenthesizedExpressionSyntax +//@[73:74) LeftParen |(| +//@[74:78) BooleanLiteralSyntax +//@[74:78) TrueKeyword |true| +//@[78:79) RightParen |)| +//@[80:224) ObjectSyntax +//@[80:81) LeftBrace |{| +//@[81:82) NewLine |\n| + name: 'hello2' +//@[2:16) ObjectPropertySyntax //@[2:6) IdentifierSyntax //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:20) StringSyntax -//@[8:17) StringLeftPiece |'hello-${| -//@[17:18) VariableAccessSyntax -//@[17:18) IdentifierSyntax -//@[17:18) Identifier |x| -//@[18:20) StringRightPiece |}'| -//@[20:21) NewLine |\n| +//@[8:16) StringSyntax +//@[8:16) StringComplete |'hello2'| +//@[16:17) NewLine |\n| params: { //@[2:123) ObjectPropertySyntax //@[2:8) IdentifierSyntax @@ -2340,6 +2351,26 @@ module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ //@[10:123) ObjectSyntax //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:69) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:69) FunctionCallSyntax +//@[16:22) IdentifierSyntax +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:50) FunctionArgumentSyntax +//@[23:49) VariableAccessSyntax +//@[23:49) IdentifierSyntax +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) FunctionArgumentSyntax +//@[51:68) VariableAccessSyntax +//@[51:68) IdentifierSyntax +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| objParam: {} //@[4:16) ObjectPropertySyntax //@[4:12) IdentifierSyntax @@ -2349,96 +2380,51 @@ module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ //@[14:15) LeftBrace |{| //@[15:16) RightBrace |}| //@[16:17) NewLine |\n| - stringParamA: 'test' -//@[4:24) ObjectPropertySyntax -//@[4:16) IdentifierSyntax -//@[4:16) Identifier |stringParamA| -//@[16:17) Colon |:| -//@[18:24) StringSyntax -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - stringParamB: 'test' -//@[4:24) ObjectPropertySyntax + stringParamB: '' +//@[4:20) ObjectPropertySyntax //@[4:16) IdentifierSyntax //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:24) StringSyntax -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - arrayParam: [for x in emptyArray: y] -//@[4:40) ObjectPropertySyntax -//@[4:14) IdentifierSyntax -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:40) ForSyntax -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:22) LocalVariableSyntax -//@[21:22) IdentifierSyntax -//@[21:22) Identifier |x| -//@[23:25) Identifier |in| -//@[26:36) VariableAccessSyntax -//@[26:36) IdentifierSyntax -//@[26:36) Identifier |emptyArray| -//@[36:37) Colon |:| -//@[38:39) VariableAccessSyntax -//@[38:39) IdentifierSyntax -//@[38:39) Identifier |y| -//@[39:40) RightSquare |]| -//@[40:41) NewLine |\n| +//@[18:20) StringSyntax +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| } //@[2:3) RightBrace |}| //@[3:4) NewLine |\n| -}] +} //@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:4) NewLine |\n\n| +//@[1:3) NewLine |\n\n| -// duplicate identifiers across scopes are allowed (inner hides the outer) -//@[74:75) NewLine |\n| -var duplicateAcrossScopes = 'hello' -//@[0:35) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:25) IdentifierSyntax -//@[4:25) Identifier |duplicateAcrossScopes| -//@[26:27) Assignment |=| -//@[28:35) StringSyntax -//@[28:35) StringComplete |'hello'| -//@[35:36) NewLine |\n| -module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { -//@[0:256) ModuleDeclarationSyntax +module directRefToCollectionViaLoopBody 'modulea.bicep' = [for test in []: { +//@[0:220) ModuleDeclarationSyntax //@[0:6) Identifier |module| -//@[7:34) IdentifierSyntax -//@[7:34) Identifier |duplicateInGlobalAndOneLoop| -//@[35:50) StringSyntax -//@[35:50) StringComplete |'modulea.bicep'| -//@[51:52) Assignment |=| -//@[53:256) ForSyntax -//@[53:54) LeftSquare |[| -//@[54:57) Identifier |for| -//@[58:79) LocalVariableSyntax -//@[58:79) IdentifierSyntax -//@[58:79) Identifier |duplicateAcrossScopes| -//@[80:82) Identifier |in| -//@[83:85) ArraySyntax -//@[83:84) LeftSquare |[| -//@[84:85) RightSquare |]| -//@[85:86) Colon |:| -//@[87:255) ObjectSyntax -//@[87:88) LeftBrace |{| -//@[88:89) NewLine |\n| - name: 'hello-${duplicateAcrossScopes}' -//@[2:40) ObjectPropertySyntax +//@[7:39) IdentifierSyntax +//@[7:39) Identifier |directRefToCollectionViaLoopBody| +//@[40:55) StringSyntax +//@[40:55) StringComplete |'modulea.bicep'| +//@[56:57) Assignment |=| +//@[58:220) ForSyntax +//@[58:59) LeftSquare |[| +//@[59:62) Identifier |for| +//@[63:67) LocalVariableSyntax +//@[63:67) IdentifierSyntax +//@[63:67) Identifier |test| +//@[68:70) Identifier |in| +//@[71:73) ArraySyntax +//@[71:72) LeftSquare |[| +//@[72:73) RightSquare |]| +//@[73:74) Colon |:| +//@[75:219) ObjectSyntax +//@[75:76) LeftBrace |{| +//@[76:77) NewLine |\n| + name: 'hello3' +//@[2:16) ObjectPropertySyntax //@[2:6) IdentifierSyntax //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:40) StringSyntax -//@[8:17) StringLeftPiece |'hello-${| -//@[17:38) VariableAccessSyntax -//@[17:38) IdentifierSyntax -//@[17:38) Identifier |duplicateAcrossScopes| -//@[38:40) StringRightPiece |}'| -//@[40:41) NewLine |\n| +//@[8:16) StringSyntax +//@[8:16) StringComplete |'hello3'| +//@[16:17) NewLine |\n| params: { //@[2:123) ObjectPropertySyntax //@[2:8) IdentifierSyntax @@ -2447,6 +2433,26 @@ module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes //@[10:123) ObjectSyntax //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:69) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:69) FunctionCallSyntax +//@[16:22) IdentifierSyntax +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:50) FunctionArgumentSyntax +//@[23:49) VariableAccessSyntax +//@[23:49) IdentifierSyntax +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) FunctionArgumentSyntax +//@[51:68) VariableAccessSyntax +//@[51:68) IdentifierSyntax +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| objParam: {} //@[4:16) ObjectPropertySyntax //@[4:12) IdentifierSyntax @@ -2456,43 +2462,14 @@ module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes //@[14:15) LeftBrace |{| //@[15:16) RightBrace |}| //@[16:17) NewLine |\n| - stringParamA: 'test' -//@[4:24) ObjectPropertySyntax -//@[4:16) IdentifierSyntax -//@[4:16) Identifier |stringParamA| -//@[16:17) Colon |:| -//@[18:24) StringSyntax -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - stringParamB: 'test' -//@[4:24) ObjectPropertySyntax + stringParamB: '' +//@[4:20) ObjectPropertySyntax //@[4:16) IdentifierSyntax //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:24) StringSyntax -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - arrayParam: [for x in emptyArray: x] -//@[4:40) ObjectPropertySyntax -//@[4:14) IdentifierSyntax -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:40) ForSyntax -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:22) LocalVariableSyntax -//@[21:22) IdentifierSyntax -//@[21:22) Identifier |x| -//@[23:25) Identifier |in| -//@[26:36) VariableAccessSyntax -//@[26:36) IdentifierSyntax -//@[26:36) Identifier |emptyArray| -//@[36:37) Colon |:| -//@[38:39) VariableAccessSyntax -//@[38:39) IdentifierSyntax -//@[38:39) Identifier |x| -//@[39:40) RightSquare |]| -//@[40:41) NewLine |\n| +//@[18:20) StringSyntax +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| } //@[2:3) RightBrace |}| //@[3:4) NewLine |\n| @@ -2501,66 +2478,64 @@ module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes //@[1:2) RightSquare |]| //@[2:4) NewLine |\n\n| -var someDuplicate = true -//@[0:24) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:17) IdentifierSyntax -//@[4:17) Identifier |someDuplicate| -//@[18:19) Assignment |=| -//@[20:24) BooleanLiteralSyntax -//@[20:24) TrueKeyword |true| -//@[24:25) NewLine |\n| -var otherDuplicate = false -//@[0:26) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:18) IdentifierSyntax -//@[4:18) Identifier |otherDuplicate| -//@[19:20) Assignment |=| -//@[21:26) BooleanLiteralSyntax -//@[21:26) FalseKeyword |false| -//@[26:27) NewLine |\n| -module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { -//@[0:256) ModuleDeclarationSyntax +module directRefToCollectionViaLoopBodyWithExtraDependsOn 'modulea.bicep' = [for test in []: { +//@[0:309) ModuleDeclarationSyntax //@[0:6) Identifier |module| -//@[7:27) IdentifierSyntax -//@[7:27) Identifier |duplicatesEverywhere| -//@[28:43) StringSyntax -//@[28:43) StringComplete |'modulea.bicep'| -//@[44:45) Assignment |=| -//@[46:256) ForSyntax -//@[46:47) LeftSquare |[| -//@[47:50) Identifier |for| -//@[51:64) LocalVariableSyntax -//@[51:64) IdentifierSyntax -//@[51:64) Identifier |someDuplicate| -//@[65:67) Identifier |in| -//@[68:70) ArraySyntax -//@[68:69) LeftSquare |[| -//@[69:70) RightSquare |]| -//@[70:71) Colon |:| -//@[72:255) ObjectSyntax -//@[72:73) LeftBrace |{| -//@[73:74) NewLine |\n| - name: 'hello-${someDuplicate}' -//@[2:32) ObjectPropertySyntax +//@[7:57) IdentifierSyntax +//@[7:57) Identifier |directRefToCollectionViaLoopBodyWithExtraDependsOn| +//@[58:73) StringSyntax +//@[58:73) StringComplete |'modulea.bicep'| +//@[74:75) Assignment |=| +//@[76:309) ForSyntax +//@[76:77) LeftSquare |[| +//@[77:80) Identifier |for| +//@[81:85) LocalVariableSyntax +//@[81:85) IdentifierSyntax +//@[81:85) Identifier |test| +//@[86:88) Identifier |in| +//@[89:91) ArraySyntax +//@[89:90) LeftSquare |[| +//@[90:91) RightSquare |]| +//@[91:92) Colon |:| +//@[93:308) ObjectSyntax +//@[93:94) LeftBrace |{| +//@[94:95) NewLine |\n| + name: 'hello4' +//@[2:16) ObjectPropertySyntax //@[2:6) IdentifierSyntax //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:32) StringSyntax -//@[8:17) StringLeftPiece |'hello-${| -//@[17:30) VariableAccessSyntax -//@[17:30) IdentifierSyntax -//@[17:30) Identifier |someDuplicate| -//@[30:32) StringRightPiece |}'| -//@[32:33) NewLine |\n| +//@[8:16) StringSyntax +//@[8:16) StringComplete |'hello4'| +//@[16:17) NewLine |\n| params: { -//@[2:146) ObjectPropertySyntax +//@[2:170) ObjectPropertySyntax //@[2:8) IdentifierSyntax //@[2:8) Identifier |params| //@[8:9) Colon |:| -//@[10:146) ObjectSyntax +//@[10:170) ObjectSyntax //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:69) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:69) FunctionCallSyntax +//@[16:22) IdentifierSyntax +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:50) FunctionArgumentSyntax +//@[23:49) VariableAccessSyntax +//@[23:49) IdentifierSyntax +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) FunctionArgumentSyntax +//@[51:68) VariableAccessSyntax +//@[51:68) IdentifierSyntax +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| objParam: {} //@[4:16) ObjectPropertySyntax //@[4:12) IdentifierSyntax @@ -2570,245 +2545,100 @@ module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { //@[14:15) LeftBrace |{| //@[15:16) RightBrace |}| //@[16:17) NewLine |\n| - stringParamB: 'test' -//@[4:24) ObjectPropertySyntax -//@[4:16) IdentifierSyntax -//@[4:16) Identifier |stringParamB| -//@[16:17) Colon |:| -//@[18:24) StringSyntax -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] -//@[4:88) ObjectPropertySyntax -//@[4:14) IdentifierSyntax -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:88) ForSyntax -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:35) LocalVariableSyntax -//@[21:35) IdentifierSyntax -//@[21:35) Identifier |otherDuplicate| -//@[36:38) Identifier |in| -//@[39:49) VariableAccessSyntax -//@[39:49) IdentifierSyntax -//@[39:49) Identifier |emptyArray| -//@[49:50) Colon |:| -//@[51:87) StringSyntax -//@[51:54) StringLeftPiece |'${| -//@[54:67) VariableAccessSyntax -//@[54:67) IdentifierSyntax -//@[54:67) Identifier |someDuplicate| -//@[67:71) StringMiddlePiece |}-${| -//@[71:85) VariableAccessSyntax -//@[71:85) IdentifierSyntax -//@[71:85) Identifier |otherDuplicate| -//@[85:87) StringRightPiece |}'| -//@[87:88) RightSquare |]| -//@[88:89) NewLine |\n| - } -//@[2:3) RightBrace |}| -//@[3:4) NewLine |\n| -}] -//@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:4) NewLine |\n\n| - -// simple module loop -//@[21:22) NewLine |\n| -module storageResources 'modulea.bicep' = [for module in myModules: { -//@[0:182) ModuleDeclarationSyntax -//@[0:6) Identifier |module| -//@[7:23) IdentifierSyntax -//@[7:23) Identifier |storageResources| -//@[24:39) StringSyntax -//@[24:39) StringComplete |'modulea.bicep'| -//@[40:41) Assignment |=| -//@[42:182) ForSyntax -//@[42:43) LeftSquare |[| -//@[43:46) Identifier |for| -//@[47:53) LocalVariableSyntax -//@[47:53) IdentifierSyntax -//@[47:53) Identifier |module| -//@[54:56) Identifier |in| -//@[57:66) VariableAccessSyntax -//@[57:66) IdentifierSyntax -//@[57:66) Identifier |myModules| -//@[66:67) Colon |:| -//@[68:181) ObjectSyntax -//@[68:69) LeftBrace |{| -//@[69:70) NewLine |\n| - name: module.name -//@[2:19) ObjectPropertySyntax -//@[2:6) IdentifierSyntax -//@[2:6) Identifier |name| -//@[6:7) Colon |:| -//@[8:19) PropertyAccessSyntax -//@[8:14) VariableAccessSyntax -//@[8:14) IdentifierSyntax -//@[8:14) Identifier |module| -//@[14:15) Dot |.| -//@[15:19) IdentifierSyntax -//@[15:19) Identifier |name| -//@[19:20) NewLine |\n| - params: { -//@[2:89) ObjectPropertySyntax -//@[2:8) IdentifierSyntax -//@[2:8) Identifier |params| -//@[8:9) Colon |:| -//@[10:89) ObjectSyntax -//@[10:11) LeftBrace |{| -//@[11:12) NewLine |\n| - arrayParam: [] -//@[4:18) ObjectPropertySyntax -//@[4:14) IdentifierSyntax -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:18) ArraySyntax -//@[16:17) LeftSquare |[| -//@[17:18) RightSquare |]| -//@[18:19) NewLine |\n| - objParam: module + stringParamB: '' //@[4:20) ObjectPropertySyntax -//@[4:12) IdentifierSyntax -//@[4:12) Identifier |objParam| -//@[12:13) Colon |:| -//@[14:20) VariableAccessSyntax -//@[14:20) IdentifierSyntax -//@[14:20) Identifier |module| -//@[20:21) NewLine |\n| - stringParamB: module.location -//@[4:33) ObjectPropertySyntax //@[4:16) IdentifierSyntax //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:33) PropertyAccessSyntax -//@[18:24) VariableAccessSyntax -//@[18:24) IdentifierSyntax -//@[18:24) Identifier |module| -//@[24:25) Dot |.| -//@[25:33) IdentifierSyntax -//@[25:33) Identifier |location| -//@[33:34) NewLine |\n| +//@[18:20) StringSyntax +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| + dependsOn: [ +//@[4:46) ObjectPropertySyntax +//@[4:13) IdentifierSyntax +//@[4:13) Identifier |dependsOn| +//@[13:14) Colon |:| +//@[15:46) ArraySyntax +//@[15:16) LeftSquare |[| +//@[16:17) NewLine |\n| + nonexistentArrays +//@[6:23) ArrayItemSyntax +//@[6:23) VariableAccessSyntax +//@[6:23) IdentifierSyntax +//@[6:23) Identifier |nonexistentArrays| +//@[23:24) NewLine |\n| + ] +//@[4:5) RightSquare |]| +//@[5:6) NewLine |\n| } //@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:23) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:23) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + +//@[4:5) NewLine |\n| + ] +//@[2:3) RightSquare |]| //@[3:4) NewLine |\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\n\n| +//@[2:5) NewLine |\n\n\n| -// nested module loop -//@[21:22) NewLine |\n| -module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { -//@[0:220) ModuleDeclarationSyntax + +// module body that isn't an object +//@[35:36) NewLine |\n| +module nonObjectModuleBody 'modulea.bicep' = [for thing in []: 'hello'] +//@[0:71) ModuleDeclarationSyntax //@[0:6) Identifier |module| -//@[7:23) IdentifierSyntax -//@[7:23) Identifier |nestedModuleLoop| -//@[24:39) StringSyntax -//@[24:39) StringComplete |'modulea.bicep'| -//@[40:41) Assignment |=| -//@[42:220) ForSyntax -//@[42:43) LeftSquare |[| -//@[43:46) Identifier |for| -//@[47:53) LocalVariableSyntax -//@[47:53) IdentifierSyntax -//@[47:53) Identifier |module| -//@[54:56) Identifier |in| -//@[57:66) VariableAccessSyntax -//@[57:66) IdentifierSyntax -//@[57:66) Identifier |myModules| -//@[66:67) Colon |:| -//@[68:219) ObjectSyntax -//@[68:69) LeftBrace |{| -//@[69:70) NewLine |\n| - name: module.name -//@[2:19) ObjectPropertySyntax -//@[2:6) IdentifierSyntax -//@[2:6) Identifier |name| -//@[6:7) Colon |:| -//@[8:19) PropertyAccessSyntax -//@[8:14) VariableAccessSyntax -//@[8:14) IdentifierSyntax -//@[8:14) Identifier |module| -//@[14:15) Dot |.| -//@[15:19) IdentifierSyntax -//@[15:19) Identifier |name| -//@[19:20) NewLine |\n| - params: { -//@[2:127) ObjectPropertySyntax -//@[2:8) IdentifierSyntax -//@[2:8) Identifier |params| -//@[8:9) Colon |:| -//@[10:127) ObjectSyntax -//@[10:11) LeftBrace |{| -//@[11:12) NewLine |\n| - arrayParam: [for i in range(0,3): concat('test', i)] -//@[4:56) ObjectPropertySyntax -//@[4:14) IdentifierSyntax -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:56) ForSyntax -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:22) LocalVariableSyntax -//@[21:22) IdentifierSyntax -//@[21:22) Identifier |i| -//@[23:25) Identifier |in| -//@[26:36) FunctionCallSyntax -//@[26:31) IdentifierSyntax -//@[26:31) Identifier |range| -//@[31:32) LeftParen |(| -//@[32:34) FunctionArgumentSyntax -//@[32:33) IntegerLiteralSyntax -//@[32:33) Integer |0| -//@[33:34) Comma |,| -//@[34:35) FunctionArgumentSyntax -//@[34:35) IntegerLiteralSyntax -//@[34:35) Integer |3| -//@[35:36) RightParen |)| -//@[36:37) Colon |:| -//@[38:55) FunctionCallSyntax -//@[38:44) IdentifierSyntax -//@[38:44) Identifier |concat| -//@[44:45) LeftParen |(| -//@[45:52) FunctionArgumentSyntax -//@[45:51) StringSyntax -//@[45:51) StringComplete |'test'| -//@[51:52) Comma |,| -//@[53:54) FunctionArgumentSyntax -//@[53:54) VariableAccessSyntax -//@[53:54) IdentifierSyntax -//@[53:54) Identifier |i| -//@[54:55) RightParen |)| -//@[55:56) RightSquare |]| -//@[56:57) NewLine |\n| - objParam: module -//@[4:20) ObjectPropertySyntax -//@[4:12) IdentifierSyntax -//@[4:12) Identifier |objParam| -//@[12:13) Colon |:| -//@[14:20) VariableAccessSyntax -//@[14:20) IdentifierSyntax -//@[14:20) Identifier |module| -//@[20:21) NewLine |\n| - stringParamB: module.location -//@[4:33) ObjectPropertySyntax -//@[4:16) IdentifierSyntax -//@[4:16) Identifier |stringParamB| -//@[16:17) Colon |:| -//@[18:33) PropertyAccessSyntax -//@[18:24) VariableAccessSyntax -//@[18:24) IdentifierSyntax -//@[18:24) Identifier |module| -//@[24:25) Dot |.| -//@[25:33) IdentifierSyntax -//@[25:33) Identifier |location| -//@[33:34) NewLine |\n| - } -//@[2:3) RightBrace |}| -//@[3:4) NewLine |\n| -}] -//@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:2) EndOfFile || +//@[7:26) IdentifierSyntax +//@[7:26) Identifier |nonObjectModuleBody| +//@[27:42) StringSyntax +//@[27:42) StringComplete |'modulea.bicep'| +//@[43:44) Assignment |=| +//@[45:71) ForSyntax +//@[45:46) LeftSquare |[| +//@[46:49) Identifier |for| +//@[50:55) LocalVariableSyntax +//@[50:55) IdentifierSyntax +//@[50:55) Identifier |thing| +//@[56:58) Identifier |in| +//@[59:61) ArraySyntax +//@[59:60) LeftSquare |[| +//@[60:61) RightSquare |]| +//@[61:62) Colon |:| +//@[63:70) SkippedTriviaSyntax +//@[63:70) StringComplete |'hello'| +//@[70:71) RightSquare |]| +//@[71:72) NewLine |\n| +module nonObjectModuleBody2 'modulea.bicep' = [for thing in []: concat()] +//@[0:73) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:27) IdentifierSyntax +//@[7:27) Identifier |nonObjectModuleBody2| +//@[28:43) StringSyntax +//@[28:43) StringComplete |'modulea.bicep'| +//@[44:45) Assignment |=| +//@[46:73) ForSyntax +//@[46:47) LeftSquare |[| +//@[47:50) Identifier |for| +//@[51:56) LocalVariableSyntax +//@[51:56) IdentifierSyntax +//@[51:56) Identifier |thing| +//@[57:59) Identifier |in| +//@[60:62) ArraySyntax +//@[60:61) LeftSquare |[| +//@[61:62) RightSquare |]| +//@[62:63) Colon |:| +//@[64:72) SkippedTriviaSyntax +//@[64:70) Identifier |concat| +//@[70:71) LeftParen |(| +//@[71:72) RightParen |)| +//@[72:73) RightSquare |]| +//@[73:73) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.tokens.bicep index 917d672f927..d64f690e4dc 100644 --- a/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.tokens.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidModules_LF/main.tokens.bicep @@ -1349,6 +1349,8 @@ module wrongModuleParameterInLoop 'modulea.bicep' = [for x in emptyArray:{ //@[72:73) Colon |:| //@[73:74) LeftBrace |{| //@[74:75) NewLine |\n| + // #completionTest(17) -> symbolsPlusX +//@[40:41) NewLine |\n| name: 'hello-${x}' //@[2:6) Identifier |name| //@[6:7) Colon |:| @@ -1460,250 +1462,153 @@ module nonexistentArrays 'modulea.bicep' = [for evenMoreDuplicates in alsoDoesNo //@[1:2) RightSquare |]| //@[2:4) NewLine |\n\n| -/* - valid loop - this should be moved to Modules_* test case after E2E works -*/ -//@[3:4) NewLine |\n| -var myModules = [ -//@[0:3) Identifier |var| -//@[4:13) Identifier |myModules| -//@[14:15) Assignment |=| -//@[16:17) LeftSquare |[| -//@[17:18) NewLine |\n| - { -//@[2:3) LeftBrace |{| -//@[3:4) NewLine |\n| - name: 'one' -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringComplete |'one'| -//@[15:16) NewLine |\n| - location: 'eastus2' -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:23) StringComplete |'eastus2'| -//@[23:24) NewLine |\n| - } -//@[2:3) RightBrace |}| -//@[3:4) NewLine |\n| - { -//@[2:3) LeftBrace |{| -//@[3:4) NewLine |\n| - name: 'two' -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringComplete |'two'| -//@[15:16) NewLine |\n| - location: 'westus' -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:22) StringComplete |'westus'| -//@[22:23) NewLine |\n| - } -//@[2:3) RightBrace |}| -//@[3:4) NewLine |\n| -] -//@[0:1) RightSquare |]| -//@[1:3) NewLine |\n\n| +output directRefToCollectionViaOutput array = nonexistentArrays +//@[0:6) Identifier |output| +//@[7:37) Identifier |directRefToCollectionViaOutput| +//@[38:43) Identifier |array| +//@[44:45) Assignment |=| +//@[46:63) Identifier |nonexistentArrays| +//@[63:65) NewLine |\n\n| -// duplicate identifiers across scopes are allowed (inner hides the outer) -//@[74:75) NewLine |\n| -module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ +module directRefToCollectionViaSingleBody 'modulea.bicep' = { //@[0:6) Identifier |module| -//@[7:37) Identifier |duplicateIdentifiersWithinLoop| -//@[38:53) StringComplete |'modulea.bicep'| -//@[54:55) Assignment |=| -//@[56:57) LeftSquare |[| -//@[57:60) Identifier |for| -//@[61:62) Identifier |x| -//@[63:65) Identifier |in| -//@[66:76) Identifier |emptyArray| -//@[76:77) Colon |:| -//@[77:78) LeftBrace |{| -//@[78:79) NewLine |\n| - name: 'hello-${x}' +//@[7:41) Identifier |directRefToCollectionViaSingleBody| +//@[42:57) StringComplete |'modulea.bicep'| +//@[58:59) Assignment |=| +//@[60:61) LeftBrace |{| +//@[61:62) NewLine |\n| + name: 'hello' //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:17) StringLeftPiece |'hello-${| -//@[17:18) Identifier |x| -//@[18:20) StringRightPiece |}'| -//@[20:21) NewLine |\n| +//@[8:15) StringComplete |'hello'| +//@[15:16) NewLine |\n| params: { //@[2:8) Identifier |params| //@[8:9) Colon |:| //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| objParam: {} //@[4:12) Identifier |objParam| //@[12:13) Colon |:| //@[14:15) LeftBrace |{| //@[15:16) RightBrace |}| //@[16:17) NewLine |\n| - stringParamA: 'test' -//@[4:16) Identifier |stringParamA| -//@[16:17) Colon |:| -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - stringParamB: 'test' + stringParamB: '' //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - arrayParam: [for x in emptyArray: y] -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:22) Identifier |x| -//@[23:25) Identifier |in| -//@[26:36) Identifier |emptyArray| -//@[36:37) Colon |:| -//@[38:39) Identifier |y| -//@[39:40) RightSquare |]| -//@[40:41) NewLine |\n| +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| } //@[2:3) RightBrace |}| //@[3:4) NewLine |\n| -}] +} //@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:4) NewLine |\n\n| +//@[1:3) NewLine |\n\n| -// duplicate identifiers across scopes are allowed (inner hides the outer) -//@[74:75) NewLine |\n| -var duplicateAcrossScopes = 'hello' -//@[0:3) Identifier |var| -//@[4:25) Identifier |duplicateAcrossScopes| -//@[26:27) Assignment |=| -//@[28:35) StringComplete |'hello'| -//@[35:36) NewLine |\n| -module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { -//@[0:6) Identifier |module| -//@[7:34) Identifier |duplicateInGlobalAndOneLoop| -//@[35:50) StringComplete |'modulea.bicep'| -//@[51:52) Assignment |=| -//@[53:54) LeftSquare |[| -//@[54:57) Identifier |for| -//@[58:79) Identifier |duplicateAcrossScopes| -//@[80:82) Identifier |in| -//@[83:84) LeftSquare |[| -//@[84:85) RightSquare |]| -//@[85:86) Colon |:| -//@[87:88) LeftBrace |{| -//@[88:89) NewLine |\n| - name: 'hello-${duplicateAcrossScopes}' +module directRefToCollectionViaSingleConditionalBody 'modulea.bicep' = if(true) { +//@[0:6) Identifier |module| +//@[7:52) Identifier |directRefToCollectionViaSingleConditionalBody| +//@[53:68) StringComplete |'modulea.bicep'| +//@[69:70) Assignment |=| +//@[71:73) Identifier |if| +//@[73:74) LeftParen |(| +//@[74:78) TrueKeyword |true| +//@[78:79) RightParen |)| +//@[80:81) LeftBrace |{| +//@[81:82) NewLine |\n| + name: 'hello2' //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:17) StringLeftPiece |'hello-${| -//@[17:38) Identifier |duplicateAcrossScopes| -//@[38:40) StringRightPiece |}'| -//@[40:41) NewLine |\n| +//@[8:16) StringComplete |'hello2'| +//@[16:17) NewLine |\n| params: { //@[2:8) Identifier |params| //@[8:9) Colon |:| //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| objParam: {} //@[4:12) Identifier |objParam| //@[12:13) Colon |:| //@[14:15) LeftBrace |{| //@[15:16) RightBrace |}| //@[16:17) NewLine |\n| - stringParamA: 'test' -//@[4:16) Identifier |stringParamA| -//@[16:17) Colon |:| -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - stringParamB: 'test' + stringParamB: '' //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - arrayParam: [for x in emptyArray: x] -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:22) Identifier |x| -//@[23:25) Identifier |in| -//@[26:36) Identifier |emptyArray| -//@[36:37) Colon |:| -//@[38:39) Identifier |x| -//@[39:40) RightSquare |]| -//@[40:41) NewLine |\n| +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| } //@[2:3) RightBrace |}| //@[3:4) NewLine |\n| -}] +} //@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:4) NewLine |\n\n| +//@[1:3) NewLine |\n\n| -var someDuplicate = true -//@[0:3) Identifier |var| -//@[4:17) Identifier |someDuplicate| -//@[18:19) Assignment |=| -//@[20:24) TrueKeyword |true| -//@[24:25) NewLine |\n| -var otherDuplicate = false -//@[0:3) Identifier |var| -//@[4:18) Identifier |otherDuplicate| -//@[19:20) Assignment |=| -//@[21:26) FalseKeyword |false| -//@[26:27) NewLine |\n| -module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { -//@[0:6) Identifier |module| -//@[7:27) Identifier |duplicatesEverywhere| -//@[28:43) StringComplete |'modulea.bicep'| -//@[44:45) Assignment |=| -//@[46:47) LeftSquare |[| -//@[47:50) Identifier |for| -//@[51:64) Identifier |someDuplicate| -//@[65:67) Identifier |in| -//@[68:69) LeftSquare |[| -//@[69:70) RightSquare |]| -//@[70:71) Colon |:| -//@[72:73) LeftBrace |{| -//@[73:74) NewLine |\n| - name: 'hello-${someDuplicate}' +module directRefToCollectionViaLoopBody 'modulea.bicep' = [for test in []: { +//@[0:6) Identifier |module| +//@[7:39) Identifier |directRefToCollectionViaLoopBody| +//@[40:55) StringComplete |'modulea.bicep'| +//@[56:57) Assignment |=| +//@[58:59) LeftSquare |[| +//@[59:62) Identifier |for| +//@[63:67) Identifier |test| +//@[68:70) Identifier |in| +//@[71:72) LeftSquare |[| +//@[72:73) RightSquare |]| +//@[73:74) Colon |:| +//@[75:76) LeftBrace |{| +//@[76:77) NewLine |\n| + name: 'hello3' //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:17) StringLeftPiece |'hello-${| -//@[17:30) Identifier |someDuplicate| -//@[30:32) StringRightPiece |}'| -//@[32:33) NewLine |\n| +//@[8:16) StringComplete |'hello3'| +//@[16:17) NewLine |\n| params: { //@[2:8) Identifier |params| //@[8:9) Colon |:| //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| objParam: {} //@[4:12) Identifier |objParam| //@[12:13) Colon |:| //@[14:15) LeftBrace |{| //@[15:16) RightBrace |}| //@[16:17) NewLine |\n| - stringParamB: 'test' + stringParamB: '' //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:24) StringComplete |'test'| -//@[24:25) NewLine |\n| - arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:35) Identifier |otherDuplicate| -//@[36:38) Identifier |in| -//@[39:49) Identifier |emptyArray| -//@[49:50) Colon |:| -//@[51:54) StringLeftPiece |'${| -//@[54:67) Identifier |someDuplicate| -//@[67:71) StringMiddlePiece |}-${| -//@[71:85) Identifier |otherDuplicate| -//@[85:87) StringRightPiece |}'| -//@[87:88) RightSquare |]| -//@[88:89) NewLine |\n| +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| } //@[2:3) RightBrace |}| //@[3:4) NewLine |\n| @@ -1712,124 +1617,112 @@ module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { //@[1:2) RightSquare |]| //@[2:4) NewLine |\n\n| -// simple module loop -//@[21:22) NewLine |\n| -module storageResources 'modulea.bicep' = [for module in myModules: { +module directRefToCollectionViaLoopBodyWithExtraDependsOn 'modulea.bicep' = [for test in []: { //@[0:6) Identifier |module| -//@[7:23) Identifier |storageResources| -//@[24:39) StringComplete |'modulea.bicep'| -//@[40:41) Assignment |=| -//@[42:43) LeftSquare |[| -//@[43:46) Identifier |for| -//@[47:53) Identifier |module| -//@[54:56) Identifier |in| -//@[57:66) Identifier |myModules| -//@[66:67) Colon |:| -//@[68:69) LeftBrace |{| -//@[69:70) NewLine |\n| - name: module.name +//@[7:57) Identifier |directRefToCollectionViaLoopBodyWithExtraDependsOn| +//@[58:73) StringComplete |'modulea.bicep'| +//@[74:75) Assignment |=| +//@[76:77) LeftSquare |[| +//@[77:80) Identifier |for| +//@[81:85) Identifier |test| +//@[86:88) Identifier |in| +//@[89:90) LeftSquare |[| +//@[90:91) RightSquare |]| +//@[91:92) Colon |:| +//@[93:94) LeftBrace |{| +//@[94:95) NewLine |\n| + name: 'hello4' //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:14) Identifier |module| -//@[14:15) Dot |.| -//@[15:19) Identifier |name| -//@[19:20) NewLine |\n| +//@[8:16) StringComplete |'hello4'| +//@[16:17) NewLine |\n| params: { //@[2:8) Identifier |params| //@[8:9) Colon |:| //@[10:11) LeftBrace |{| //@[11:12) NewLine |\n| - arrayParam: [] + arrayParam: concat(wrongModuleParameterInLoop, nonexistentArrays) //@[4:14) Identifier |arrayParam| //@[14:15) Colon |:| -//@[16:17) LeftSquare |[| -//@[17:18) RightSquare |]| -//@[18:19) NewLine |\n| - objParam: module +//@[16:22) Identifier |concat| +//@[22:23) LeftParen |(| +//@[23:49) Identifier |wrongModuleParameterInLoop| +//@[49:50) Comma |,| +//@[51:68) Identifier |nonexistentArrays| +//@[68:69) RightParen |)| +//@[69:70) NewLine |\n| + objParam: {} //@[4:12) Identifier |objParam| //@[12:13) Colon |:| -//@[14:20) Identifier |module| -//@[20:21) NewLine |\n| - stringParamB: module.location +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:17) NewLine |\n| + stringParamB: '' //@[4:16) Identifier |stringParamB| //@[16:17) Colon |:| -//@[18:24) Identifier |module| -//@[24:25) Dot |.| -//@[25:33) Identifier |location| -//@[33:34) NewLine |\n| +//@[18:20) StringComplete |''| +//@[20:21) NewLine |\n| + dependsOn: [ +//@[4:13) Identifier |dependsOn| +//@[13:14) Colon |:| +//@[15:16) LeftSquare |[| +//@[16:17) NewLine |\n| + nonexistentArrays +//@[6:23) Identifier |nonexistentArrays| +//@[23:24) NewLine |\n| + ] +//@[4:5) RightSquare |]| +//@[5:6) NewLine |\n| } //@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + +//@[4:5) NewLine |\n| + ] +//@[2:3) RightSquare |]| //@[3:4) NewLine |\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\n\n| +//@[2:5) NewLine |\n\n\n| -// nested module loop -//@[21:22) NewLine |\n| -module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { + +// module body that isn't an object +//@[35:36) NewLine |\n| +module nonObjectModuleBody 'modulea.bicep' = [for thing in []: 'hello'] //@[0:6) Identifier |module| -//@[7:23) Identifier |nestedModuleLoop| -//@[24:39) StringComplete |'modulea.bicep'| -//@[40:41) Assignment |=| -//@[42:43) LeftSquare |[| -//@[43:46) Identifier |for| -//@[47:53) Identifier |module| -//@[54:56) Identifier |in| -//@[57:66) Identifier |myModules| -//@[66:67) Colon |:| -//@[68:69) LeftBrace |{| -//@[69:70) NewLine |\n| - name: module.name -//@[2:6) Identifier |name| -//@[6:7) Colon |:| -//@[8:14) Identifier |module| -//@[14:15) Dot |.| -//@[15:19) Identifier |name| -//@[19:20) NewLine |\n| - params: { -//@[2:8) Identifier |params| -//@[8:9) Colon |:| -//@[10:11) LeftBrace |{| -//@[11:12) NewLine |\n| - arrayParam: [for i in range(0,3): concat('test', i)] -//@[4:14) Identifier |arrayParam| -//@[14:15) Colon |:| -//@[16:17) LeftSquare |[| -//@[17:20) Identifier |for| -//@[21:22) Identifier |i| -//@[23:25) Identifier |in| -//@[26:31) Identifier |range| -//@[31:32) LeftParen |(| -//@[32:33) Integer |0| -//@[33:34) Comma |,| -//@[34:35) Integer |3| -//@[35:36) RightParen |)| -//@[36:37) Colon |:| -//@[38:44) Identifier |concat| -//@[44:45) LeftParen |(| -//@[45:51) StringComplete |'test'| -//@[51:52) Comma |,| -//@[53:54) Identifier |i| -//@[54:55) RightParen |)| -//@[55:56) RightSquare |]| -//@[56:57) NewLine |\n| - objParam: module -//@[4:12) Identifier |objParam| -//@[12:13) Colon |:| -//@[14:20) Identifier |module| -//@[20:21) NewLine |\n| - stringParamB: module.location -//@[4:16) Identifier |stringParamB| -//@[16:17) Colon |:| -//@[18:24) Identifier |module| -//@[24:25) Dot |.| -//@[25:33) Identifier |location| -//@[33:34) NewLine |\n| - } -//@[2:3) RightBrace |}| -//@[3:4) NewLine |\n| -}] -//@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:2) EndOfFile || +//@[7:26) Identifier |nonObjectModuleBody| +//@[27:42) StringComplete |'modulea.bicep'| +//@[43:44) Assignment |=| +//@[45:46) LeftSquare |[| +//@[46:49) Identifier |for| +//@[50:55) Identifier |thing| +//@[56:58) Identifier |in| +//@[59:60) LeftSquare |[| +//@[60:61) RightSquare |]| +//@[61:62) Colon |:| +//@[63:70) StringComplete |'hello'| +//@[70:71) RightSquare |]| +//@[71:72) NewLine |\n| +module nonObjectModuleBody2 'modulea.bicep' = [for thing in []: concat()] +//@[0:6) Identifier |module| +//@[7:27) Identifier |nonObjectModuleBody2| +//@[28:43) StringComplete |'modulea.bicep'| +//@[44:45) Assignment |=| +//@[46:47) LeftSquare |[| +//@[47:50) Identifier |for| +//@[51:56) Identifier |thing| +//@[57:59) Identifier |in| +//@[60:61) LeftSquare |[| +//@[61:62) RightSquare |]| +//@[62:63) Colon |:| +//@[64:70) Identifier |concat| +//@[70:71) LeftParen |(| +//@[71:72) RightParen |)| +//@[72:73) RightSquare |]| +//@[73:73) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.bicep index a73646e41bd..4d5756df798 100644 --- a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.bicep @@ -100,6 +100,16 @@ output deeper bool = true ? -true : (14 && 's') + 10 @minValue(10) output notAttachableDecorators int = 32 +// loops in outputs not allowed +output noLoops array = [for thing in things: 4] + +// no nested loops either +output noNestedLoops array = [for thing in things: { + something: [ + [for thing in things: true] + ] +}] + // #completionTest(1) -> decoratorsPlusNamespace @ // #completionTest(5) -> decorators diff --git a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.diagnostics.bicep index b8505a700ff..b54664d818b 100644 --- a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.diagnostics.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.diagnostics.bicep @@ -182,6 +182,22 @@ output deeper bool = true ? -true : (14 && 's') + 10 //@[1:9) [BCP129 (Error)] Function "minValue" cannot be used as an output decorator. |minValue| output notAttachableDecorators int = 32 +// loops in outputs not allowed +output noLoops array = [for thing in things: 4] +//@[24:27) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[37:43) [BCP057 (Error)] The name "things" does not exist in the current context. |things| + +// no nested loops either +output noNestedLoops array = [for thing in things: { +//@[30:33) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[43:49) [BCP057 (Error)] The name "things" does not exist in the current context. |things| + something: [ + [for thing in things: true] +//@[5:8) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[18:24) [BCP057 (Error)] The name "things" does not exist in the current context. |things| + ] +}] + // #completionTest(1) -> decoratorsPlusNamespace @ //@[1:1) [BCP123 (Error)] Expected a namespace or decorator name at this location. || diff --git a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.formatted.bicep index 42cb987f411..47b596f0503 100644 --- a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.formatted.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.formatted.bicep @@ -92,6 +92,16 @@ output deeper bool = true ? -true : (14 && 's') + 10 @minValue(10) output notAttachableDecorators int = 32 +// loops in outputs not allowed +output noLoops array = [for thing in things: 4] + +// no nested loops either +output noNestedLoops array = [for thing in things: { + something: [ + [for thing in things: true] + ] +}] + // #completionTest(1) -> decoratorsPlusNamespace @ // #completionTest(5) -> decorators diff --git a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.symbols.bicep index 83dfb85d5fc..f5966467577 100644 --- a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.symbols.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.symbols.bicep @@ -145,6 +145,21 @@ output deeper bool = true ? -true : (14 && 's') + 10 output notAttachableDecorators int = 32 //@[7:30) Output notAttachableDecorators. Type: int. Declaration start char: 0, length: 73 +// loops in outputs not allowed +output noLoops array = [for thing in things: 4] +//@[28:33) Local thing. Type: any. Declaration start char: 28, length: 5 +//@[7:14) Output noLoops. Type: array. Declaration start char: 0, length: 47 + +// no nested loops either +output noNestedLoops array = [for thing in things: { +//@[34:39) Local thing. Type: any. Declaration start char: 34, length: 5 +//@[7:20) Output noNestedLoops. Type: array. Declaration start char: 0, length: 110 + something: [ + [for thing in things: true] +//@[9:14) Local thing. Type: any. Declaration start char: 9, length: 5 + ] +}] + // #completionTest(1) -> decoratorsPlusNamespace @ // #completionTest(5) -> decorators diff --git a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.syntax.bicep index 761613f462b..abf8211b4c6 100644 --- a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.syntax.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.syntax.bicep @@ -640,6 +640,89 @@ output notAttachableDecorators int = 32 //@[37:39) Integer |32| //@[39:43) NewLine |\r\n\r\n| +// loops in outputs not allowed +//@[31:33) NewLine |\r\n| +output noLoops array = [for thing in things: 4] +//@[0:47) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:14) IdentifierSyntax +//@[7:14) Identifier |noLoops| +//@[15:20) TypeSyntax +//@[15:20) Identifier |array| +//@[21:22) Assignment |=| +//@[23:47) ForSyntax +//@[23:24) LeftSquare |[| +//@[24:27) Identifier |for| +//@[28:33) LocalVariableSyntax +//@[28:33) IdentifierSyntax +//@[28:33) Identifier |thing| +//@[34:36) Identifier |in| +//@[37:43) VariableAccessSyntax +//@[37:43) IdentifierSyntax +//@[37:43) Identifier |things| +//@[43:44) Colon |:| +//@[45:46) IntegerLiteralSyntax +//@[45:46) Integer |4| +//@[46:47) RightSquare |]| +//@[47:51) NewLine |\r\n\r\n| + +// no nested loops either +//@[25:27) NewLine |\r\n| +output noNestedLoops array = [for thing in things: { +//@[0:110) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:20) IdentifierSyntax +//@[7:20) Identifier |noNestedLoops| +//@[21:26) TypeSyntax +//@[21:26) Identifier |array| +//@[27:28) Assignment |=| +//@[29:110) ForSyntax +//@[29:30) LeftSquare |[| +//@[30:33) Identifier |for| +//@[34:39) LocalVariableSyntax +//@[34:39) IdentifierSyntax +//@[34:39) Identifier |thing| +//@[40:42) Identifier |in| +//@[43:49) VariableAccessSyntax +//@[43:49) IdentifierSyntax +//@[43:49) Identifier |things| +//@[49:50) Colon |:| +//@[51:109) ObjectSyntax +//@[51:52) LeftBrace |{| +//@[52:54) NewLine |\r\n| + something: [ +//@[2:52) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |something| +//@[11:12) Colon |:| +//@[13:52) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + [for thing in things: true] +//@[4:31) ArrayItemSyntax +//@[4:31) ForSyntax +//@[4:5) LeftSquare |[| +//@[5:8) Identifier |for| +//@[9:14) LocalVariableSyntax +//@[9:14) IdentifierSyntax +//@[9:14) Identifier |thing| +//@[15:17) Identifier |in| +//@[18:24) VariableAccessSyntax +//@[18:24) IdentifierSyntax +//@[18:24) Identifier |things| +//@[24:25) Colon |:| +//@[26:30) BooleanLiteralSyntax +//@[26:30) TrueKeyword |true| +//@[30:31) RightSquare |]| +//@[31:33) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + // #completionTest(1) -> decoratorsPlusNamespace //@[48:50) NewLine |\r\n| @ diff --git a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.tokens.bicep index 9b78dacf1d3..db566bf889f 100644 --- a/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.tokens.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidOutputs_CRLF/main.tokens.bicep @@ -417,6 +417,61 @@ output notAttachableDecorators int = 32 //@[37:39) Integer |32| //@[39:43) NewLine |\r\n\r\n| +// loops in outputs not allowed +//@[31:33) NewLine |\r\n| +output noLoops array = [for thing in things: 4] +//@[0:6) Identifier |output| +//@[7:14) Identifier |noLoops| +//@[15:20) Identifier |array| +//@[21:22) Assignment |=| +//@[23:24) LeftSquare |[| +//@[24:27) Identifier |for| +//@[28:33) Identifier |thing| +//@[34:36) Identifier |in| +//@[37:43) Identifier |things| +//@[43:44) Colon |:| +//@[45:46) Integer |4| +//@[46:47) RightSquare |]| +//@[47:51) NewLine |\r\n\r\n| + +// no nested loops either +//@[25:27) NewLine |\r\n| +output noNestedLoops array = [for thing in things: { +//@[0:6) Identifier |output| +//@[7:20) Identifier |noNestedLoops| +//@[21:26) Identifier |array| +//@[27:28) Assignment |=| +//@[29:30) LeftSquare |[| +//@[30:33) Identifier |for| +//@[34:39) Identifier |thing| +//@[40:42) Identifier |in| +//@[43:49) Identifier |things| +//@[49:50) Colon |:| +//@[51:52) LeftBrace |{| +//@[52:54) NewLine |\r\n| + something: [ +//@[2:11) Identifier |something| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + [for thing in things: true] +//@[4:5) LeftSquare |[| +//@[5:8) Identifier |for| +//@[9:14) Identifier |thing| +//@[15:17) Identifier |in| +//@[18:24) Identifier |things| +//@[24:25) Colon |:| +//@[26:30) TrueKeyword |true| +//@[30:31) RightSquare |]| +//@[31:33) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + // #completionTest(1) -> decoratorsPlusNamespace //@[48:50) NewLine |\r\n| @ diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/arrayPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/arrayPlusSymbols.json index 4903e3a0198..ff194d81133 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/arrayPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/arrayPlusSymbols.json @@ -255,20 +255,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -427,6 +413,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1015,62 +1071,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1245,6 +1245,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2256,6 +2284,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2346,6 +2402,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3060,48 +3144,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3409,20 +3479,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cleanupPreferencesPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cleanupPreferencesPlusSymbols.json index af1c54a3b55..dbc64b5c4e6 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cleanupPreferencesPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cleanupPreferencesPlusSymbols.json @@ -283,20 +283,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -455,6 +441,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1043,62 +1099,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1273,6 +1273,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2284,6 +2312,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2374,6 +2430,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3088,48 +3172,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3437,20 +3507,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols.json index e97bf67eab2..38c16e99874 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols.json @@ -511,20 +511,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -683,6 +669,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1257,62 +1313,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1487,6 +1487,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2512,6 +2540,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2602,6 +2658,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3316,48 +3400,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3665,20 +3735,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_for.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_for.json index 30a4f2178ec..598e094cd03 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_for.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_for.json @@ -511,20 +511,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -683,6 +669,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1257,62 +1313,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1487,6 +1487,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2512,6 +2540,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2602,6 +2658,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3316,48 +3400,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3665,20 +3735,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_if.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_if.json index 03693c67e29..68cd671b8a4 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_if.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/cliPropertyAccessIndexesPlusSymbols_if.json @@ -511,20 +511,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -683,6 +669,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1257,62 +1313,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1487,6 +1487,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2512,6 +2540,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2602,6 +2658,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3316,48 +3400,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3665,20 +3735,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols.json index 95ff1f70544..2de361fd722 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols.json @@ -259,20 +259,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -431,6 +417,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1019,62 +1075,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1249,6 +1249,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2260,6 +2288,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2350,6 +2406,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3064,48 +3148,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3413,20 +3483,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_for.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_for.json index cb3f77d17d2..c1202a95978 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_for.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_for.json @@ -259,20 +259,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -431,6 +417,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1019,62 +1075,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1249,6 +1249,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2260,6 +2288,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2350,6 +2406,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3064,48 +3148,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3413,20 +3483,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_if.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_if.json index f754d70d727..5a7a767866e 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_if.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/createModeIndexPlusSymbols_if.json @@ -259,20 +259,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -431,6 +417,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1019,62 +1075,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1249,6 +1249,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2260,6 +2288,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2350,6 +2406,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3064,48 +3148,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3413,20 +3483,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes.json index 9194d055dd4..3445bf9cb3f 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes.json @@ -745,20 +745,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -917,6 +903,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1505,62 +1561,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1735,6 +1735,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2746,6 +2774,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2836,6 +2892,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3550,48 +3634,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3899,20 +3969,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_for.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_for.json index b050d446c96..4d645007332 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_for.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_for.json @@ -745,20 +745,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -917,6 +903,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1505,62 +1561,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1735,6 +1735,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2746,6 +2774,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2836,6 +2892,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3550,48 +3634,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3899,20 +3969,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_if.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_if.json index 88b57f3bb64..1e767b942a6 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_if.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/defaultCreateModeIndexes_if.json @@ -745,20 +745,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -917,6 +903,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1505,62 +1561,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1735,6 +1735,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2746,6 +2774,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2836,6 +2892,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3550,48 +3634,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3899,20 +3969,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols.json index 1169423002e..34f55c9235b 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols.json @@ -269,20 +269,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -441,6 +427,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1015,62 +1071,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1245,6 +1245,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2270,6 +2298,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2360,6 +2416,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3074,48 +3158,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3423,20 +3493,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_for.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_for.json index a728ae4c4d8..4c1d263b126 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_for.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_for.json @@ -269,20 +269,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -441,6 +427,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1015,62 +1071,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1245,6 +1245,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2270,6 +2298,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2360,6 +2416,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3074,48 +3158,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3231,6 +3301,20 @@ "command": "editor.action.triggerParameterHints" } }, + { + "label": "thing", + "kind": "variable", + "detail": "thing", + "deprecated": false, + "preselect": false, + "sortText": "2_thing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "thing" + } + }, { "label": "toLower", "kind": "function", @@ -3423,20 +3507,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_if.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_if.json index 2f27ac4e182..cd6e9aa6f84 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_if.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptKindsPlusSymbols_if.json @@ -269,20 +269,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -441,6 +427,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1015,62 +1071,6 @@ "newText": "discriminatorKeyValueMissing_for" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1245,6 +1245,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2270,6 +2298,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2360,6 +2416,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3074,48 +3158,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3423,20 +3493,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptTopLevel.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptTopLevel.json index cf2d0c303e5..3339a0f7e8c 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptTopLevel.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/deploymentScriptTopLevel.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols.json index 2510bf3faba..315ffbc89e3 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols.json @@ -259,20 +259,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -431,6 +417,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1005,62 +1061,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1235,6 +1235,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2260,6 +2288,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2350,6 +2406,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3064,48 +3148,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3413,20 +3483,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_for.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_for.json index 0dd5cbe71a7..7850a6d4bf3 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_for.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_for.json @@ -259,20 +259,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -431,6 +417,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1005,62 +1061,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1235,6 +1235,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2260,6 +2288,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2350,6 +2406,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3064,48 +3148,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3413,20 +3483,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_if.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_if.json index 3649fa1713e..c488120b4a8 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_if.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/missingDiscriminatorPropertyIndexPlusSymbols_if.json @@ -259,20 +259,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -431,6 +417,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1005,62 +1061,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1235,6 +1235,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2260,6 +2288,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2350,6 +2406,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3064,48 +3148,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3413,20 +3483,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/objectPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/objectPlusSymbols.json index e9d17b0c11f..a2a13d89803 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/objectPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/objectPlusSymbols.json @@ -241,20 +241,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -413,6 +399,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1001,62 +1057,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1231,6 +1231,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2242,6 +2270,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2332,6 +2388,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3046,48 +3130,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3395,20 +3465,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/storageSkuNamePlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/storageSkuNamePlusSymbols.json index 232cb4c3fdc..743e14ea7ab 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/storageSkuNamePlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/storageSkuNamePlusSymbols.json @@ -111,6 +111,20 @@ "newText": "'Standard_ZRS'" } }, + { + "label": "account", + "kind": "variable", + "detail": "account", + "deprecated": false, + "preselect": false, + "sortText": "2_account", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "account" + } + }, { "label": "any", "kind": "function", @@ -353,20 +367,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -525,6 +525,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1113,62 +1183,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1343,6 +1357,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2368,6 +2410,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2444,6 +2514,34 @@ "command": "editor.action.triggerParameterHints" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3158,48 +3256,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3507,20 +3591,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbols.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbols.json index 63a82e1a1ce..d378dfe7c5f 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbols.json @@ -241,20 +241,6 @@ "command": "editor.action.triggerParameterHints" } }, - { - "label": "canHaveDuplicatesAcrossScopes", - "kind": "variable", - "detail": "canHaveDuplicatesAcrossScopes", - "deprecated": false, - "preselect": false, - "sortText": "2_canHaveDuplicatesAcrossScopes", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "canHaveDuplicatesAcrossScopes" - } - }, { "label": "coalesce", "kind": "function", @@ -413,6 +399,76 @@ "newText": "deployment()$0" } }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, { "label": "discriminatorKeyMissing", "kind": "interface", @@ -1001,62 +1057,6 @@ "newText": "discriminatorKeyValueMissing_if" } }, - { - "label": "duplicateIdentifiersWithinLoop", - "kind": "interface", - "detail": "duplicateIdentifiersWithinLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateIdentifiersWithinLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateIdentifiersWithinLoop" - } - }, - { - "label": "duplicateInGlobalAndOneLoop", - "kind": "interface", - "detail": "duplicateInGlobalAndOneLoop", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndOneLoop", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndOneLoop" - } - }, - { - "label": "duplicateInGlobalAndTwoLoops", - "kind": "interface", - "detail": "duplicateInGlobalAndTwoLoops", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicateInGlobalAndTwoLoops", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicateInGlobalAndTwoLoops" - } - }, - { - "label": "duplicatesEverywhere", - "kind": "variable", - "detail": "duplicatesEverywhere", - "deprecated": false, - "preselect": false, - "sortText": "2_duplicatesEverywhere", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "duplicatesEverywhere" - } - }, { "label": "empty", "kind": "function", @@ -1231,6 +1231,34 @@ "newText": "expectedLoopVar" } }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, { "label": "extensionResourceId", "kind": "function", @@ -2256,6 +2284,34 @@ "newText": "nestedPropertyAccessOnConditional" } }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, { "label": "nonexistentArrays", "kind": "interface", @@ -2346,6 +2402,34 @@ "newText": "premiumStorages" } }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, { "label": "providers", "kind": "function", @@ -3060,48 +3144,34 @@ } }, { - "label": "storageAccounts", - "kind": "variable", - "detail": "storageAccounts", + "label": "string", + "kind": "function", + "detail": "string()", "deprecated": false, "preselect": false, - "sortText": "2_storageAccounts", - "insertTextFormat": "plainText", + "sortText": "3_string", + "insertTextFormat": "snippet", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageAccounts" + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" } }, { - "label": "storageResources", + "label": "stuffs", "kind": "interface", - "detail": "storageResources", + "detail": "stuffs", "deprecated": false, "preselect": false, - "sortText": "2_storageResources", + "sortText": "2_stuffs", "insertTextFormat": "plainText", "insertTextMode": "asIs", "textEdit": { "range": {}, - "newText": "storageResources" - } - }, - { - "label": "string", - "kind": "function", - "detail": "string()", - "deprecated": false, - "preselect": false, - "sortText": "3_string", - "insertTextFormat": "snippet", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "string($0)" - }, - "command": { - "command": "editor.action.triggerParameterHints" + "newText": "stuffs" } }, { @@ -3409,20 +3479,6 @@ "newText": "validResourceForInvalidExtensionResourceDuplicateName" } }, - { - "label": "vnet", - "kind": "interface", - "detail": "vnet", - "deprecated": false, - "preselect": false, - "sortText": "2_vnet", - "insertTextFormat": "plainText", - "insertTextMode": "asIs", - "textEdit": { - "range": {}, - "newText": "vnet" - } - }, { "label": "wrongArrayType", "kind": "interface", diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccount.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccount.json new file mode 100644 index 00000000000..a56e73ea60e --- /dev/null +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccount.json @@ -0,0 +1,3524 @@ +[ + { + "label": "account", + "kind": "variable", + "detail": "account", + "deprecated": false, + "preselect": false, + "sortText": "2_account", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "account" + } + }, + { + "label": "any", + "kind": "function", + "detail": "any()", + "deprecated": false, + "preselect": false, + "sortText": "3_any", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "any($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "array", + "kind": "function", + "detail": "array()", + "deprecated": false, + "preselect": false, + "sortText": "3_array", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "array($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "arrayExpressionErrors", + "kind": "interface", + "detail": "arrayExpressionErrors", + "deprecated": false, + "preselect": false, + "sortText": "2_arrayExpressionErrors", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "arrayExpressionErrors" + } + }, + { + "label": "az", + "kind": "folder", + "detail": "az", + "deprecated": false, + "preselect": false, + "sortText": "3_az", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "az" + } + }, + { + "label": "badDepends", + "kind": "interface", + "detail": "badDepends", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends" + } + }, + { + "label": "badDepends2", + "kind": "interface", + "detail": "badDepends2", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends2" + } + }, + { + "label": "badDepends3", + "kind": "interface", + "detail": "badDepends3", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends3" + } + }, + { + "label": "badDepends4", + "kind": "interface", + "detail": "badDepends4", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends4" + } + }, + { + "label": "badDepends5", + "kind": "interface", + "detail": "badDepends5", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends5" + } + }, + { + "label": "badInterp", + "kind": "interface", + "detail": "badInterp", + "deprecated": false, + "preselect": false, + "sortText": "2_badInterp", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badInterp" + } + }, + { + "label": "bar", + "kind": "interface", + "detail": "bar", + "deprecated": false, + "preselect": false, + "sortText": "2_bar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bar" + } + }, + { + "label": "base64", + "kind": "function", + "detail": "base64()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToJson", + "kind": "function", + "detail": "base64ToJson()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToJson", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToJson($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToString", + "kind": "function", + "detail": "base64ToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "baz", + "kind": "interface", + "detail": "baz", + "deprecated": false, + "preselect": false, + "sortText": "2_baz", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "baz" + } + }, + { + "label": "bool", + "kind": "function", + "detail": "bool()", + "deprecated": false, + "preselect": false, + "sortText": "3_bool", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bool($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "coalesce", + "kind": "function", + "detail": "coalesce()", + "deprecated": false, + "preselect": false, + "sortText": "3_coalesce", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "coalesce($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "concat", + "kind": "function", + "detail": "concat()", + "deprecated": false, + "preselect": false, + "sortText": "3_concat", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "concat($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "contains", + "kind": "function", + "detail": "contains()", + "deprecated": false, + "preselect": false, + "sortText": "3_contains", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "contains($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "cyclicExistingRes", + "kind": "interface", + "detail": "cyclicExistingRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicExistingRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicExistingRes" + } + }, + { + "label": "cyclicRes", + "kind": "interface", + "detail": "cyclicRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicRes" + } + }, + { + "label": "dashesInPropertyNames", + "kind": "interface", + "detail": "dashesInPropertyNames", + "deprecated": false, + "preselect": false, + "sortText": "2_dashesInPropertyNames", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dashesInPropertyNames" + } + }, + { + "label": "dataUri", + "kind": "function", + "detail": "dataUri()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dataUriToString", + "kind": "function", + "detail": "dataUriToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUriToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUriToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dateTimeAdd", + "kind": "function", + "detail": "dateTimeAdd()", + "deprecated": false, + "preselect": false, + "sortText": "3_dateTimeAdd", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dateTimeAdd($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "deployment", + "kind": "function", + "detail": "deployment()", + "deprecated": false, + "preselect": false, + "sortText": "3_deployment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "deployment()$0" + } + }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, + { + "label": "discriminatorKeyMissing", + "kind": "interface", + "detail": "discriminatorKeyMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing" + } + }, + { + "label": "discriminatorKeyMissing_for", + "kind": "interface", + "detail": "discriminatorKeyMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_for" + } + }, + { + "label": "discriminatorKeyMissing_if", + "kind": "interface", + "detail": "discriminatorKeyMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_if" + } + }, + { + "label": "discriminatorKeySetOne", + "kind": "interface", + "detail": "discriminatorKeySetOne", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne" + } + }, + { + "label": "discriminatorKeySetOneCompletions", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions" + } + }, + { + "label": "discriminatorKeySetOneCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions3", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_if" + } + }, + { + "label": "discriminatorKeySetOne_for", + "kind": "interface", + "detail": "discriminatorKeySetOne_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_for" + } + }, + { + "label": "discriminatorKeySetOne_if", + "kind": "interface", + "detail": "discriminatorKeySetOne_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_if" + } + }, + { + "label": "discriminatorKeySetTwo", + "kind": "interface", + "detail": "discriminatorKeySetTwo", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo" + } + }, + { + "label": "discriminatorKeySetTwoCompletions", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_if" + } + }, + { + "label": "discriminatorKeySetTwo_for", + "kind": "interface", + "detail": "discriminatorKeySetTwo_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_for" + } + }, + { + "label": "discriminatorKeySetTwo_if", + "kind": "interface", + "detail": "discriminatorKeySetTwo_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_if" + } + }, + { + "label": "discriminatorKeyValueMissing", + "kind": "interface", + "detail": "discriminatorKeyValueMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_if" + } + }, + { + "label": "discriminatorKeyValueMissing_for", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_for" + } + }, + { + "label": "discriminatorKeyValueMissing_if", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_if" + } + }, + { + "label": "empty", + "kind": "function", + "detail": "empty()", + "deprecated": false, + "preselect": false, + "sortText": "3_empty", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "empty($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "emptyArray", + "kind": "variable", + "detail": "emptyArray", + "deprecated": false, + "preselect": false, + "sortText": "2_emptyArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "emptyArray" + } + }, + { + "label": "endsWith", + "kind": "function", + "detail": "endsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_endsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "endsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "environment", + "kind": "function", + "detail": "environment()", + "deprecated": false, + "preselect": false, + "sortText": "3_environment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "environment()$0" + } + }, + { + "label": "expectedArrayExpression", + "kind": "interface", + "detail": "expectedArrayExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedArrayExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedArrayExpression" + } + }, + { + "label": "expectedColon", + "kind": "interface", + "detail": "expectedColon", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedColon", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedColon" + } + }, + { + "label": "expectedForKeyword", + "kind": "interface", + "detail": "expectedForKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword" + } + }, + { + "label": "expectedForKeyword2", + "kind": "interface", + "detail": "expectedForKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword2" + } + }, + { + "label": "expectedInKeyword", + "kind": "interface", + "detail": "expectedInKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword" + } + }, + { + "label": "expectedInKeyword2", + "kind": "interface", + "detail": "expectedInKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword2" + } + }, + { + "label": "expectedLoopBody", + "kind": "interface", + "detail": "expectedLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopBody" + } + }, + { + "label": "expectedLoopVar", + "kind": "interface", + "detail": "expectedLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopVar" + } + }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, + { + "label": "extensionResourceId", + "kind": "function", + "detail": "extensionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_extensionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "extensionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "first", + "kind": "function", + "detail": "first()", + "deprecated": false, + "preselect": false, + "sortText": "3_first", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "first($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "fo", + "kind": "interface", + "detail": "fo", + "deprecated": false, + "preselect": false, + "sortText": "2_fo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "fo" + } + }, + { + "label": "foo", + "kind": "interface", + "detail": "foo", + "deprecated": false, + "preselect": false, + "sortText": "2_foo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "foo" + } + }, + { + "label": "format", + "kind": "function", + "detail": "format()", + "deprecated": false, + "preselect": false, + "sortText": "3_format", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "format($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "guid", + "kind": "function", + "detail": "guid()", + "deprecated": false, + "preselect": false, + "sortText": "3_guid", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "guid($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "incorrectPropertiesKey", + "kind": "interface", + "detail": "incorrectPropertiesKey", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey" + } + }, + { + "label": "incorrectPropertiesKey2", + "kind": "interface", + "detail": "incorrectPropertiesKey2", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey2" + } + }, + { + "label": "indexOf", + "kind": "function", + "detail": "indexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_indexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "indexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "int", + "kind": "function", + "detail": "int()", + "deprecated": false, + "preselect": false, + "sortText": "3_int", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "int($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "interpVal", + "kind": "variable", + "detail": "interpVal", + "deprecated": false, + "preselect": false, + "sortText": "2_interpVal", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "interpVal" + } + }, + { + "label": "intersection", + "kind": "function", + "detail": "intersection()", + "deprecated": false, + "preselect": false, + "sortText": "3_intersection", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "intersection($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "invalidDecorator", + "kind": "interface", + "detail": "invalidDecorator", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDecorator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDecorator" + } + }, + { + "label": "invalidDuplicateName1", + "kind": "interface", + "detail": "invalidDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName1" + } + }, + { + "label": "invalidDuplicateName2", + "kind": "interface", + "detail": "invalidDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName2" + } + }, + { + "label": "invalidDuplicateName3", + "kind": "interface", + "detail": "invalidDuplicateName3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName3" + } + }, + { + "label": "invalidExtensionResourceDuplicateName1", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName1" + } + }, + { + "label": "invalidExtensionResourceDuplicateName2", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName2" + } + }, + { + "label": "invalidScope", + "kind": "interface", + "detail": "invalidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope" + } + }, + { + "label": "invalidScope2", + "kind": "interface", + "detail": "invalidScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope2" + } + }, + { + "label": "invalidScope3", + "kind": "interface", + "detail": "invalidScope3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope3" + } + }, + { + "label": "json", + "kind": "function", + "detail": "json()", + "deprecated": false, + "preselect": false, + "sortText": "3_json", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "json($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "last", + "kind": "function", + "detail": "last()", + "deprecated": false, + "preselect": false, + "sortText": "3_last", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "last($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "lastIndexOf", + "kind": "function", + "detail": "lastIndexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_lastIndexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "lastIndexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "length", + "kind": "function", + "detail": "length()", + "deprecated": false, + "preselect": false, + "sortText": "3_length", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "length($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "letsAccessTheDashes", + "kind": "variable", + "detail": "letsAccessTheDashes", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes" + } + }, + { + "label": "letsAccessTheDashes2", + "kind": "variable", + "detail": "letsAccessTheDashes2", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes2" + } + }, + { + "label": "listKeys", + "kind": "function", + "detail": "listKeys()", + "deprecated": false, + "preselect": false, + "sortText": "3_listKeys", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "listKeys($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "magicString1", + "kind": "variable", + "detail": "magicString1", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString1" + } + }, + { + "label": "magicString2", + "kind": "variable", + "detail": "magicString2", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString2" + } + }, + { + "label": "managementGroup", + "kind": "function", + "detail": "managementGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_managementGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "managementGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "max", + "kind": "function", + "detail": "max()", + "deprecated": false, + "preselect": false, + "sortText": "3_max", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "max($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "min", + "kind": "function", + "detail": "min()", + "deprecated": false, + "preselect": false, + "sortText": "3_min", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "min($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "missingFewerRequiredProperties", + "kind": "interface", + "detail": "missingFewerRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingFewerRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingFewerRequiredProperties" + } + }, + { + "label": "missingRequiredProperties", + "kind": "interface", + "detail": "missingRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingRequiredProperties" + } + }, + { + "label": "missingTopLevelProperties", + "kind": "interface", + "detail": "missingTopLevelProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelProperties" + } + }, + { + "label": "missingTopLevelPropertiesExceptName", + "kind": "interface", + "detail": "missingTopLevelPropertiesExceptName", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelPropertiesExceptName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelPropertiesExceptName" + } + }, + { + "label": "missingType", + "kind": "interface", + "detail": "missingType", + "deprecated": false, + "preselect": false, + "sortText": "2_missingType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingType" + } + }, + { + "label": "mock", + "kind": "variable", + "detail": "mock", + "deprecated": false, + "preselect": false, + "sortText": "2_mock", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "mock" + } + }, + { + "label": "nestedDiscriminator", + "kind": "interface", + "detail": "nestedDiscriminator", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions" + } + }, + { + "label": "nestedDiscriminatorCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2" + } + }, + { + "label": "nestedDiscriminatorCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorCompletions3", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3" + } + }, + { + "label": "nestedDiscriminatorCompletions3_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_for" + } + }, + { + "label": "nestedDiscriminatorCompletions3_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_if" + } + }, + { + "label": "nestedDiscriminatorCompletions4", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4" + } + }, + { + "label": "nestedDiscriminatorCompletions4_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_for" + } + }, + { + "label": "nestedDiscriminatorCompletions4_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_if" + } + }, + { + "label": "nestedDiscriminatorCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_for" + } + }, + { + "label": "nestedDiscriminatorCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey_for", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_for" + } + }, + { + "label": "nestedDiscriminatorMissingKey_if", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_if" + } + }, + { + "label": "nestedDiscriminator_for", + "kind": "interface", + "detail": "nestedDiscriminator_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_for" + } + }, + { + "label": "nestedDiscriminator_if", + "kind": "interface", + "detail": "nestedDiscriminator_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_if" + } + }, + { + "label": "nestedPropertyAccessOnConditional", + "kind": "interface", + "detail": "nestedPropertyAccessOnConditional", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedPropertyAccessOnConditional", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedPropertyAccessOnConditional" + } + }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, + { + "label": "nonexistentArrays", + "kind": "interface", + "detail": "nonexistentArrays", + "deprecated": false, + "preselect": false, + "sortText": "2_nonexistentArrays", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonexistentArrays" + } + }, + { + "label": "notAResource", + "kind": "variable", + "detail": "notAResource", + "deprecated": false, + "preselect": false, + "sortText": "2_notAResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAResource" + } + }, + { + "label": "notAnArray", + "kind": "variable", + "detail": "notAnArray", + "deprecated": false, + "preselect": false, + "sortText": "2_notAnArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAnArray" + } + }, + { + "label": "padLeft", + "kind": "function", + "detail": "padLeft()", + "deprecated": false, + "preselect": false, + "sortText": "3_padLeft", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "padLeft($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "pickZones", + "kind": "function", + "detail": "pickZones()", + "deprecated": false, + "preselect": false, + "sortText": "3_pickZones", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "pickZones($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "premiumStorages", + "kind": "interface", + "detail": "premiumStorages", + "deprecated": false, + "preselect": false, + "sortText": "2_premiumStorages", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "premiumStorages" + } + }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "providers", + "kind": "function", + "detail": "providers()", + "deprecated": false, + "preselect": false, + "sortText": "3_providers", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "providers($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "range", + "kind": "function", + "detail": "range()", + "deprecated": false, + "preselect": false, + "sortText": "3_range", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "range($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "reference", + "kind": "function", + "detail": "reference()", + "deprecated": false, + "preselect": false, + "sortText": "3_reference", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "reference($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "replace", + "kind": "function", + "detail": "replace()", + "deprecated": false, + "preselect": false, + "sortText": "3_replace", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "replace($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceGroup", + "kind": "function", + "detail": "resourceGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceId", + "kind": "function", + "detail": "resourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceListIsNotSingleResource", + "kind": "variable", + "detail": "resourceListIsNotSingleResource", + "deprecated": false, + "preselect": false, + "sortText": "2_resourceListIsNotSingleResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceListIsNotSingleResource" + } + }, + { + "label": "resrefpar", + "kind": "field", + "detail": "resrefpar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefpar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefpar" + } + }, + { + "label": "resrefvar", + "kind": "variable", + "detail": "resrefvar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefvar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefvar" + } + }, + { + "label": "runtimeInvalid", + "kind": "variable", + "detail": "runtimeInvalid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalid" + } + }, + { + "label": "runtimeInvalidRes1", + "kind": "interface", + "detail": "runtimeInvalidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes1" + } + }, + { + "label": "runtimeInvalidRes10", + "kind": "interface", + "detail": "runtimeInvalidRes10", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes10", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes10" + } + }, + { + "label": "runtimeInvalidRes11", + "kind": "interface", + "detail": "runtimeInvalidRes11", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes11", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes11" + } + }, + { + "label": "runtimeInvalidRes12", + "kind": "interface", + "detail": "runtimeInvalidRes12", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes12", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes12" + } + }, + { + "label": "runtimeInvalidRes13", + "kind": "interface", + "detail": "runtimeInvalidRes13", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes13", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes13" + } + }, + { + "label": "runtimeInvalidRes14", + "kind": "interface", + "detail": "runtimeInvalidRes14", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes14", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes14" + } + }, + { + "label": "runtimeInvalidRes15", + "kind": "interface", + "detail": "runtimeInvalidRes15", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes15", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes15" + } + }, + { + "label": "runtimeInvalidRes16", + "kind": "interface", + "detail": "runtimeInvalidRes16", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes16", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes16" + } + }, + { + "label": "runtimeInvalidRes17", + "kind": "interface", + "detail": "runtimeInvalidRes17", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes17", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes17" + } + }, + { + "label": "runtimeInvalidRes18", + "kind": "interface", + "detail": "runtimeInvalidRes18", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes18", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes18" + } + }, + { + "label": "runtimeInvalidRes2", + "kind": "interface", + "detail": "runtimeInvalidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes2" + } + }, + { + "label": "runtimeInvalidRes3", + "kind": "interface", + "detail": "runtimeInvalidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes3" + } + }, + { + "label": "runtimeInvalidRes4", + "kind": "interface", + "detail": "runtimeInvalidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes4" + } + }, + { + "label": "runtimeInvalidRes5", + "kind": "interface", + "detail": "runtimeInvalidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes5" + } + }, + { + "label": "runtimeInvalidRes6", + "kind": "interface", + "detail": "runtimeInvalidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes6" + } + }, + { + "label": "runtimeInvalidRes7", + "kind": "interface", + "detail": "runtimeInvalidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes7" + } + }, + { + "label": "runtimeInvalidRes8", + "kind": "interface", + "detail": "runtimeInvalidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes8" + } + }, + { + "label": "runtimeInvalidRes9", + "kind": "interface", + "detail": "runtimeInvalidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes9" + } + }, + { + "label": "runtimeValid", + "kind": "variable", + "detail": "runtimeValid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValid" + } + }, + { + "label": "runtimeValidRes1", + "kind": "interface", + "detail": "runtimeValidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes1" + } + }, + { + "label": "runtimeValidRes2", + "kind": "interface", + "detail": "runtimeValidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes2" + } + }, + { + "label": "runtimeValidRes3", + "kind": "interface", + "detail": "runtimeValidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes3" + } + }, + { + "label": "runtimeValidRes4", + "kind": "interface", + "detail": "runtimeValidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes4" + } + }, + { + "label": "runtimeValidRes5", + "kind": "interface", + "detail": "runtimeValidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes5" + } + }, + { + "label": "runtimeValidRes6", + "kind": "interface", + "detail": "runtimeValidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes6" + } + }, + { + "label": "runtimeValidRes7", + "kind": "interface", + "detail": "runtimeValidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes7" + } + }, + { + "label": "runtimeValidRes8", + "kind": "interface", + "detail": "runtimeValidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes8" + } + }, + { + "label": "runtimeValidRes9", + "kind": "interface", + "detail": "runtimeValidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes9" + } + }, + { + "label": "runtimefoo1", + "kind": "variable", + "detail": "runtimefoo1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo1" + } + }, + { + "label": "runtimefoo2", + "kind": "variable", + "detail": "runtimefoo2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo2" + } + }, + { + "label": "runtimefoo3", + "kind": "variable", + "detail": "runtimefoo3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo3" + } + }, + { + "label": "runtimefoo4", + "kind": "variable", + "detail": "runtimefoo4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo4" + } + }, + { + "label": "selfScope", + "kind": "interface", + "detail": "selfScope", + "deprecated": false, + "preselect": false, + "sortText": "2_selfScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "selfScope" + } + }, + { + "label": "sigh", + "kind": "variable", + "detail": "sigh", + "deprecated": false, + "preselect": false, + "sortText": "2_sigh", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sigh" + } + }, + { + "label": "skip", + "kind": "function", + "detail": "skip()", + "deprecated": false, + "preselect": false, + "sortText": "3_skip", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "skip($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "split", + "kind": "function", + "detail": "split()", + "deprecated": false, + "preselect": false, + "sortText": "3_split", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "split($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "startedTypingTypeWithQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithQuotes" + } + }, + { + "label": "startedTypingTypeWithoutQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithoutQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithoutQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithoutQuotes" + } + }, + { + "label": "startsWith", + "kind": "function", + "detail": "startsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_startsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "string", + "kind": "function", + "detail": "string()", + "deprecated": false, + "preselect": false, + "sortText": "3_string", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "stuffs", + "kind": "interface", + "detail": "stuffs", + "deprecated": false, + "preselect": false, + "sortText": "2_stuffs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "stuffs" + } + }, + { + "label": "subscription", + "kind": "function", + "detail": "subscription()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscription", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscription($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscriptionResourceId", + "kind": "function", + "detail": "subscriptionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscriptionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscriptionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "substring", + "kind": "function", + "detail": "substring()", + "deprecated": false, + "preselect": false, + "sortText": "3_substring", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "substring($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "sys", + "kind": "folder", + "detail": "sys", + "deprecated": false, + "preselect": false, + "sortText": "3_sys", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sys" + } + }, + { + "label": "take", + "kind": "function", + "detail": "take()", + "deprecated": false, + "preselect": false, + "sortText": "3_take", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "take($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "tenant", + "kind": "function", + "detail": "tenant()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenant", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenant()$0" + } + }, + { + "label": "tenantResourceId", + "kind": "function", + "detail": "tenantResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenantResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenantResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toLower", + "kind": "function", + "detail": "toLower()", + "deprecated": false, + "preselect": false, + "sortText": "3_toLower", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toLower($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toUpper", + "kind": "function", + "detail": "toUpper()", + "deprecated": false, + "preselect": false, + "sortText": "3_toUpper", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toUpper($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "trailingSpace", + "kind": "interface", + "detail": "trailingSpace", + "deprecated": false, + "preselect": false, + "sortText": "2_trailingSpace", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trailingSpace" + } + }, + { + "label": "trim", + "kind": "function", + "detail": "trim()", + "deprecated": false, + "preselect": false, + "sortText": "3_trim", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trim($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "unfinishedVnet", + "kind": "interface", + "detail": "unfinishedVnet", + "deprecated": false, + "preselect": false, + "sortText": "2_unfinishedVnet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "unfinishedVnet" + } + }, + { + "label": "union", + "kind": "function", + "detail": "union()", + "deprecated": false, + "preselect": false, + "sortText": "3_union", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "union($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uniqueString", + "kind": "function", + "detail": "uniqueString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uniqueString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uniqueString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uri", + "kind": "function", + "detail": "uri()", + "deprecated": false, + "preselect": false, + "sortText": "3_uri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponent", + "kind": "function", + "detail": "uriComponent()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponent", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponent($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponentToString", + "kind": "function", + "detail": "uriComponentToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponentToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponentToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "validModule", + "kind": "module", + "detail": "validModule", + "deprecated": false, + "preselect": false, + "sortText": "2_validModule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validModule" + } + }, + { + "label": "validResourceForInvalidExtensionResourceDuplicateName", + "kind": "interface", + "detail": "validResourceForInvalidExtensionResourceDuplicateName", + "deprecated": false, + "preselect": false, + "sortText": "2_validResourceForInvalidExtensionResourceDuplicateName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validResourceForInvalidExtensionResourceDuplicateName" + } + }, + { + "label": "wrongArrayType", + "kind": "interface", + "detail": "wrongArrayType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongArrayType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongArrayType" + } + }, + { + "label": "wrongLoopBodyType", + "kind": "interface", + "detail": "wrongLoopBodyType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongLoopBodyType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongLoopBodyType" + } + }, + { + "label": "wrongPropertyInNestedLoop", + "kind": "interface", + "detail": "wrongPropertyInNestedLoop", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongPropertyInNestedLoop", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongPropertyInNestedLoop" + } + } +] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccount2.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccount2.json new file mode 100644 index 00000000000..45d2fd662d5 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccount2.json @@ -0,0 +1,3524 @@ +[ + { + "label": "account", + "kind": "variable", + "detail": "account", + "deprecated": false, + "preselect": false, + "sortText": "2_account", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "account" + } + }, + { + "label": "any", + "kind": "function", + "detail": "any()", + "deprecated": false, + "preselect": false, + "sortText": "3_any", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "any($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "array", + "kind": "function", + "detail": "array()", + "deprecated": false, + "preselect": false, + "sortText": "3_array", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "array($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "arrayExpressionErrors", + "kind": "interface", + "detail": "arrayExpressionErrors", + "deprecated": false, + "preselect": false, + "sortText": "2_arrayExpressionErrors", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "arrayExpressionErrors" + } + }, + { + "label": "az", + "kind": "folder", + "detail": "az", + "deprecated": false, + "preselect": false, + "sortText": "3_az", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "az" + } + }, + { + "label": "badDepends", + "kind": "interface", + "detail": "badDepends", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends" + } + }, + { + "label": "badDepends2", + "kind": "interface", + "detail": "badDepends2", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends2" + } + }, + { + "label": "badDepends3", + "kind": "interface", + "detail": "badDepends3", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends3" + } + }, + { + "label": "badDepends4", + "kind": "interface", + "detail": "badDepends4", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends4" + } + }, + { + "label": "badDepends5", + "kind": "interface", + "detail": "badDepends5", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends5" + } + }, + { + "label": "badInterp", + "kind": "interface", + "detail": "badInterp", + "deprecated": false, + "preselect": false, + "sortText": "2_badInterp", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badInterp" + } + }, + { + "label": "bar", + "kind": "interface", + "detail": "bar", + "deprecated": false, + "preselect": false, + "sortText": "2_bar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bar" + } + }, + { + "label": "base64", + "kind": "function", + "detail": "base64()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToJson", + "kind": "function", + "detail": "base64ToJson()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToJson", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToJson($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToString", + "kind": "function", + "detail": "base64ToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "baz", + "kind": "interface", + "detail": "baz", + "deprecated": false, + "preselect": false, + "sortText": "2_baz", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "baz" + } + }, + { + "label": "bool", + "kind": "function", + "detail": "bool()", + "deprecated": false, + "preselect": false, + "sortText": "3_bool", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bool($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "coalesce", + "kind": "function", + "detail": "coalesce()", + "deprecated": false, + "preselect": false, + "sortText": "3_coalesce", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "coalesce($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "concat", + "kind": "function", + "detail": "concat()", + "deprecated": false, + "preselect": false, + "sortText": "3_concat", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "concat($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "contains", + "kind": "function", + "detail": "contains()", + "deprecated": false, + "preselect": false, + "sortText": "3_contains", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "contains($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "cyclicExistingRes", + "kind": "interface", + "detail": "cyclicExistingRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicExistingRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicExistingRes" + } + }, + { + "label": "cyclicRes", + "kind": "interface", + "detail": "cyclicRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicRes" + } + }, + { + "label": "dashesInPropertyNames", + "kind": "interface", + "detail": "dashesInPropertyNames", + "deprecated": false, + "preselect": false, + "sortText": "2_dashesInPropertyNames", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dashesInPropertyNames" + } + }, + { + "label": "dataUri", + "kind": "function", + "detail": "dataUri()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dataUriToString", + "kind": "function", + "detail": "dataUriToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUriToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUriToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dateTimeAdd", + "kind": "function", + "detail": "dateTimeAdd()", + "deprecated": false, + "preselect": false, + "sortText": "3_dateTimeAdd", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dateTimeAdd($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "deployment", + "kind": "function", + "detail": "deployment()", + "deprecated": false, + "preselect": false, + "sortText": "3_deployment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "deployment()$0" + } + }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, + { + "label": "discriminatorKeyMissing", + "kind": "interface", + "detail": "discriminatorKeyMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing" + } + }, + { + "label": "discriminatorKeyMissing_for", + "kind": "interface", + "detail": "discriminatorKeyMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_for" + } + }, + { + "label": "discriminatorKeyMissing_if", + "kind": "interface", + "detail": "discriminatorKeyMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_if" + } + }, + { + "label": "discriminatorKeySetOne", + "kind": "interface", + "detail": "discriminatorKeySetOne", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne" + } + }, + { + "label": "discriminatorKeySetOneCompletions", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions" + } + }, + { + "label": "discriminatorKeySetOneCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions3", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_if" + } + }, + { + "label": "discriminatorKeySetOne_for", + "kind": "interface", + "detail": "discriminatorKeySetOne_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_for" + } + }, + { + "label": "discriminatorKeySetOne_if", + "kind": "interface", + "detail": "discriminatorKeySetOne_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_if" + } + }, + { + "label": "discriminatorKeySetTwo", + "kind": "interface", + "detail": "discriminatorKeySetTwo", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo" + } + }, + { + "label": "discriminatorKeySetTwoCompletions", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_if" + } + }, + { + "label": "discriminatorKeySetTwo_for", + "kind": "interface", + "detail": "discriminatorKeySetTwo_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_for" + } + }, + { + "label": "discriminatorKeySetTwo_if", + "kind": "interface", + "detail": "discriminatorKeySetTwo_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_if" + } + }, + { + "label": "discriminatorKeyValueMissing", + "kind": "interface", + "detail": "discriminatorKeyValueMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_if" + } + }, + { + "label": "discriminatorKeyValueMissing_for", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_for" + } + }, + { + "label": "discriminatorKeyValueMissing_if", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_if" + } + }, + { + "label": "empty", + "kind": "function", + "detail": "empty()", + "deprecated": false, + "preselect": false, + "sortText": "3_empty", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "empty($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "emptyArray", + "kind": "variable", + "detail": "emptyArray", + "deprecated": false, + "preselect": false, + "sortText": "2_emptyArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "emptyArray" + } + }, + { + "label": "endsWith", + "kind": "function", + "detail": "endsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_endsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "endsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "environment", + "kind": "function", + "detail": "environment()", + "deprecated": false, + "preselect": false, + "sortText": "3_environment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "environment()$0" + } + }, + { + "label": "expectedArrayExpression", + "kind": "interface", + "detail": "expectedArrayExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedArrayExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedArrayExpression" + } + }, + { + "label": "expectedColon", + "kind": "interface", + "detail": "expectedColon", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedColon", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedColon" + } + }, + { + "label": "expectedForKeyword", + "kind": "interface", + "detail": "expectedForKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword" + } + }, + { + "label": "expectedForKeyword2", + "kind": "interface", + "detail": "expectedForKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword2" + } + }, + { + "label": "expectedInKeyword", + "kind": "interface", + "detail": "expectedInKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword" + } + }, + { + "label": "expectedInKeyword2", + "kind": "interface", + "detail": "expectedInKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword2" + } + }, + { + "label": "expectedLoopBody", + "kind": "interface", + "detail": "expectedLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopBody" + } + }, + { + "label": "expectedLoopVar", + "kind": "interface", + "detail": "expectedLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopVar" + } + }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, + { + "label": "extensionResourceId", + "kind": "function", + "detail": "extensionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_extensionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "extensionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "first", + "kind": "function", + "detail": "first()", + "deprecated": false, + "preselect": false, + "sortText": "3_first", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "first($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "fo", + "kind": "interface", + "detail": "fo", + "deprecated": false, + "preselect": false, + "sortText": "2_fo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "fo" + } + }, + { + "label": "foo", + "kind": "interface", + "detail": "foo", + "deprecated": false, + "preselect": false, + "sortText": "2_foo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "foo" + } + }, + { + "label": "format", + "kind": "function", + "detail": "format()", + "deprecated": false, + "preselect": false, + "sortText": "3_format", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "format($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "guid", + "kind": "function", + "detail": "guid()", + "deprecated": false, + "preselect": false, + "sortText": "3_guid", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "guid($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "incorrectPropertiesKey", + "kind": "interface", + "detail": "incorrectPropertiesKey", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey" + } + }, + { + "label": "incorrectPropertiesKey2", + "kind": "interface", + "detail": "incorrectPropertiesKey2", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey2" + } + }, + { + "label": "indexOf", + "kind": "function", + "detail": "indexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_indexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "indexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "int", + "kind": "function", + "detail": "int()", + "deprecated": false, + "preselect": false, + "sortText": "3_int", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "int($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "interpVal", + "kind": "variable", + "detail": "interpVal", + "deprecated": false, + "preselect": false, + "sortText": "2_interpVal", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "interpVal" + } + }, + { + "label": "intersection", + "kind": "function", + "detail": "intersection()", + "deprecated": false, + "preselect": false, + "sortText": "3_intersection", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "intersection($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "invalidDecorator", + "kind": "interface", + "detail": "invalidDecorator", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDecorator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDecorator" + } + }, + { + "label": "invalidDuplicateName1", + "kind": "interface", + "detail": "invalidDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName1" + } + }, + { + "label": "invalidDuplicateName2", + "kind": "interface", + "detail": "invalidDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName2" + } + }, + { + "label": "invalidDuplicateName3", + "kind": "interface", + "detail": "invalidDuplicateName3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName3" + } + }, + { + "label": "invalidExtensionResourceDuplicateName1", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName1" + } + }, + { + "label": "invalidExtensionResourceDuplicateName2", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName2" + } + }, + { + "label": "invalidScope", + "kind": "interface", + "detail": "invalidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope" + } + }, + { + "label": "invalidScope2", + "kind": "interface", + "detail": "invalidScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope2" + } + }, + { + "label": "invalidScope3", + "kind": "interface", + "detail": "invalidScope3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope3" + } + }, + { + "label": "json", + "kind": "function", + "detail": "json()", + "deprecated": false, + "preselect": false, + "sortText": "3_json", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "json($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "last", + "kind": "function", + "detail": "last()", + "deprecated": false, + "preselect": false, + "sortText": "3_last", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "last($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "lastIndexOf", + "kind": "function", + "detail": "lastIndexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_lastIndexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "lastIndexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "length", + "kind": "function", + "detail": "length()", + "deprecated": false, + "preselect": false, + "sortText": "3_length", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "length($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "letsAccessTheDashes", + "kind": "variable", + "detail": "letsAccessTheDashes", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes" + } + }, + { + "label": "letsAccessTheDashes2", + "kind": "variable", + "detail": "letsAccessTheDashes2", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes2" + } + }, + { + "label": "listKeys", + "kind": "function", + "detail": "listKeys()", + "deprecated": false, + "preselect": false, + "sortText": "3_listKeys", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "listKeys($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "magicString1", + "kind": "variable", + "detail": "magicString1", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString1" + } + }, + { + "label": "magicString2", + "kind": "variable", + "detail": "magicString2", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString2" + } + }, + { + "label": "managementGroup", + "kind": "function", + "detail": "managementGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_managementGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "managementGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "max", + "kind": "function", + "detail": "max()", + "deprecated": false, + "preselect": false, + "sortText": "3_max", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "max($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "min", + "kind": "function", + "detail": "min()", + "deprecated": false, + "preselect": false, + "sortText": "3_min", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "min($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "missingFewerRequiredProperties", + "kind": "interface", + "detail": "missingFewerRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingFewerRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingFewerRequiredProperties" + } + }, + { + "label": "missingRequiredProperties", + "kind": "interface", + "detail": "missingRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingRequiredProperties" + } + }, + { + "label": "missingTopLevelProperties", + "kind": "interface", + "detail": "missingTopLevelProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelProperties" + } + }, + { + "label": "missingTopLevelPropertiesExceptName", + "kind": "interface", + "detail": "missingTopLevelPropertiesExceptName", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelPropertiesExceptName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelPropertiesExceptName" + } + }, + { + "label": "missingType", + "kind": "interface", + "detail": "missingType", + "deprecated": false, + "preselect": false, + "sortText": "2_missingType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingType" + } + }, + { + "label": "mock", + "kind": "variable", + "detail": "mock", + "deprecated": false, + "preselect": false, + "sortText": "2_mock", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "mock" + } + }, + { + "label": "nestedDiscriminator", + "kind": "interface", + "detail": "nestedDiscriminator", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions" + } + }, + { + "label": "nestedDiscriminatorCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2" + } + }, + { + "label": "nestedDiscriminatorCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorCompletions3", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3" + } + }, + { + "label": "nestedDiscriminatorCompletions3_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_for" + } + }, + { + "label": "nestedDiscriminatorCompletions3_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_if" + } + }, + { + "label": "nestedDiscriminatorCompletions4", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4" + } + }, + { + "label": "nestedDiscriminatorCompletions4_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_for" + } + }, + { + "label": "nestedDiscriminatorCompletions4_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_if" + } + }, + { + "label": "nestedDiscriminatorCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_for" + } + }, + { + "label": "nestedDiscriminatorCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey_for", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_for" + } + }, + { + "label": "nestedDiscriminatorMissingKey_if", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_if" + } + }, + { + "label": "nestedDiscriminator_for", + "kind": "interface", + "detail": "nestedDiscriminator_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_for" + } + }, + { + "label": "nestedDiscriminator_if", + "kind": "interface", + "detail": "nestedDiscriminator_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_if" + } + }, + { + "label": "nestedPropertyAccessOnConditional", + "kind": "interface", + "detail": "nestedPropertyAccessOnConditional", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedPropertyAccessOnConditional", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedPropertyAccessOnConditional" + } + }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, + { + "label": "nonexistentArrays", + "kind": "interface", + "detail": "nonexistentArrays", + "deprecated": false, + "preselect": false, + "sortText": "2_nonexistentArrays", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonexistentArrays" + } + }, + { + "label": "notAResource", + "kind": "variable", + "detail": "notAResource", + "deprecated": false, + "preselect": false, + "sortText": "2_notAResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAResource" + } + }, + { + "label": "notAnArray", + "kind": "variable", + "detail": "notAnArray", + "deprecated": false, + "preselect": false, + "sortText": "2_notAnArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAnArray" + } + }, + { + "label": "padLeft", + "kind": "function", + "detail": "padLeft()", + "deprecated": false, + "preselect": false, + "sortText": "3_padLeft", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "padLeft($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "pickZones", + "kind": "function", + "detail": "pickZones()", + "deprecated": false, + "preselect": false, + "sortText": "3_pickZones", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "pickZones($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "propertyLoopsCannotNest2", + "kind": "interface", + "detail": "propertyLoopsCannotNest2", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest2" + } + }, + { + "label": "providers", + "kind": "function", + "detail": "providers()", + "deprecated": false, + "preselect": false, + "sortText": "3_providers", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "providers($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "range", + "kind": "function", + "detail": "range()", + "deprecated": false, + "preselect": false, + "sortText": "3_range", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "range($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "reference", + "kind": "function", + "detail": "reference()", + "deprecated": false, + "preselect": false, + "sortText": "3_reference", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "reference($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "replace", + "kind": "function", + "detail": "replace()", + "deprecated": false, + "preselect": false, + "sortText": "3_replace", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "replace($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceGroup", + "kind": "function", + "detail": "resourceGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceId", + "kind": "function", + "detail": "resourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceListIsNotSingleResource", + "kind": "variable", + "detail": "resourceListIsNotSingleResource", + "deprecated": false, + "preselect": false, + "sortText": "2_resourceListIsNotSingleResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceListIsNotSingleResource" + } + }, + { + "label": "resrefpar", + "kind": "field", + "detail": "resrefpar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefpar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefpar" + } + }, + { + "label": "resrefvar", + "kind": "variable", + "detail": "resrefvar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefvar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefvar" + } + }, + { + "label": "runtimeInvalid", + "kind": "variable", + "detail": "runtimeInvalid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalid" + } + }, + { + "label": "runtimeInvalidRes1", + "kind": "interface", + "detail": "runtimeInvalidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes1" + } + }, + { + "label": "runtimeInvalidRes10", + "kind": "interface", + "detail": "runtimeInvalidRes10", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes10", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes10" + } + }, + { + "label": "runtimeInvalidRes11", + "kind": "interface", + "detail": "runtimeInvalidRes11", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes11", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes11" + } + }, + { + "label": "runtimeInvalidRes12", + "kind": "interface", + "detail": "runtimeInvalidRes12", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes12", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes12" + } + }, + { + "label": "runtimeInvalidRes13", + "kind": "interface", + "detail": "runtimeInvalidRes13", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes13", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes13" + } + }, + { + "label": "runtimeInvalidRes14", + "kind": "interface", + "detail": "runtimeInvalidRes14", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes14", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes14" + } + }, + { + "label": "runtimeInvalidRes15", + "kind": "interface", + "detail": "runtimeInvalidRes15", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes15", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes15" + } + }, + { + "label": "runtimeInvalidRes16", + "kind": "interface", + "detail": "runtimeInvalidRes16", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes16", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes16" + } + }, + { + "label": "runtimeInvalidRes17", + "kind": "interface", + "detail": "runtimeInvalidRes17", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes17", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes17" + } + }, + { + "label": "runtimeInvalidRes18", + "kind": "interface", + "detail": "runtimeInvalidRes18", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes18", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes18" + } + }, + { + "label": "runtimeInvalidRes2", + "kind": "interface", + "detail": "runtimeInvalidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes2" + } + }, + { + "label": "runtimeInvalidRes3", + "kind": "interface", + "detail": "runtimeInvalidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes3" + } + }, + { + "label": "runtimeInvalidRes4", + "kind": "interface", + "detail": "runtimeInvalidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes4" + } + }, + { + "label": "runtimeInvalidRes5", + "kind": "interface", + "detail": "runtimeInvalidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes5" + } + }, + { + "label": "runtimeInvalidRes6", + "kind": "interface", + "detail": "runtimeInvalidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes6" + } + }, + { + "label": "runtimeInvalidRes7", + "kind": "interface", + "detail": "runtimeInvalidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes7" + } + }, + { + "label": "runtimeInvalidRes8", + "kind": "interface", + "detail": "runtimeInvalidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes8" + } + }, + { + "label": "runtimeInvalidRes9", + "kind": "interface", + "detail": "runtimeInvalidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes9" + } + }, + { + "label": "runtimeValid", + "kind": "variable", + "detail": "runtimeValid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValid" + } + }, + { + "label": "runtimeValidRes1", + "kind": "interface", + "detail": "runtimeValidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes1" + } + }, + { + "label": "runtimeValidRes2", + "kind": "interface", + "detail": "runtimeValidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes2" + } + }, + { + "label": "runtimeValidRes3", + "kind": "interface", + "detail": "runtimeValidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes3" + } + }, + { + "label": "runtimeValidRes4", + "kind": "interface", + "detail": "runtimeValidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes4" + } + }, + { + "label": "runtimeValidRes5", + "kind": "interface", + "detail": "runtimeValidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes5" + } + }, + { + "label": "runtimeValidRes6", + "kind": "interface", + "detail": "runtimeValidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes6" + } + }, + { + "label": "runtimeValidRes7", + "kind": "interface", + "detail": "runtimeValidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes7" + } + }, + { + "label": "runtimeValidRes8", + "kind": "interface", + "detail": "runtimeValidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes8" + } + }, + { + "label": "runtimeValidRes9", + "kind": "interface", + "detail": "runtimeValidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes9" + } + }, + { + "label": "runtimefoo1", + "kind": "variable", + "detail": "runtimefoo1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo1" + } + }, + { + "label": "runtimefoo2", + "kind": "variable", + "detail": "runtimefoo2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo2" + } + }, + { + "label": "runtimefoo3", + "kind": "variable", + "detail": "runtimefoo3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo3" + } + }, + { + "label": "runtimefoo4", + "kind": "variable", + "detail": "runtimefoo4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo4" + } + }, + { + "label": "selfScope", + "kind": "interface", + "detail": "selfScope", + "deprecated": false, + "preselect": false, + "sortText": "2_selfScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "selfScope" + } + }, + { + "label": "sigh", + "kind": "variable", + "detail": "sigh", + "deprecated": false, + "preselect": false, + "sortText": "2_sigh", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sigh" + } + }, + { + "label": "skip", + "kind": "function", + "detail": "skip()", + "deprecated": false, + "preselect": false, + "sortText": "3_skip", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "skip($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "split", + "kind": "function", + "detail": "split()", + "deprecated": false, + "preselect": false, + "sortText": "3_split", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "split($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "startedTypingTypeWithQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithQuotes" + } + }, + { + "label": "startedTypingTypeWithoutQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithoutQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithoutQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithoutQuotes" + } + }, + { + "label": "startsWith", + "kind": "function", + "detail": "startsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_startsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "string", + "kind": "function", + "detail": "string()", + "deprecated": false, + "preselect": false, + "sortText": "3_string", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "stuffs", + "kind": "interface", + "detail": "stuffs", + "deprecated": false, + "preselect": false, + "sortText": "2_stuffs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "stuffs" + } + }, + { + "label": "subscription", + "kind": "function", + "detail": "subscription()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscription", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscription($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscriptionResourceId", + "kind": "function", + "detail": "subscriptionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscriptionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscriptionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "substring", + "kind": "function", + "detail": "substring()", + "deprecated": false, + "preselect": false, + "sortText": "3_substring", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "substring($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "sys", + "kind": "folder", + "detail": "sys", + "deprecated": false, + "preselect": false, + "sortText": "3_sys", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sys" + } + }, + { + "label": "take", + "kind": "function", + "detail": "take()", + "deprecated": false, + "preselect": false, + "sortText": "3_take", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "take($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "tenant", + "kind": "function", + "detail": "tenant()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenant", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenant()$0" + } + }, + { + "label": "tenantResourceId", + "kind": "function", + "detail": "tenantResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenantResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenantResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toLower", + "kind": "function", + "detail": "toLower()", + "deprecated": false, + "preselect": false, + "sortText": "3_toLower", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toLower($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toUpper", + "kind": "function", + "detail": "toUpper()", + "deprecated": false, + "preselect": false, + "sortText": "3_toUpper", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toUpper($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "trailingSpace", + "kind": "interface", + "detail": "trailingSpace", + "deprecated": false, + "preselect": false, + "sortText": "2_trailingSpace", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trailingSpace" + } + }, + { + "label": "trim", + "kind": "function", + "detail": "trim()", + "deprecated": false, + "preselect": false, + "sortText": "3_trim", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trim($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "unfinishedVnet", + "kind": "interface", + "detail": "unfinishedVnet", + "deprecated": false, + "preselect": false, + "sortText": "2_unfinishedVnet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "unfinishedVnet" + } + }, + { + "label": "union", + "kind": "function", + "detail": "union()", + "deprecated": false, + "preselect": false, + "sortText": "3_union", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "union($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uniqueString", + "kind": "function", + "detail": "uniqueString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uniqueString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uniqueString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uri", + "kind": "function", + "detail": "uri()", + "deprecated": false, + "preselect": false, + "sortText": "3_uri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponent", + "kind": "function", + "detail": "uriComponent()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponent", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponent($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponentToString", + "kind": "function", + "detail": "uriComponentToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponentToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponentToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "validModule", + "kind": "module", + "detail": "validModule", + "deprecated": false, + "preselect": false, + "sortText": "2_validModule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validModule" + } + }, + { + "label": "validResourceForInvalidExtensionResourceDuplicateName", + "kind": "interface", + "detail": "validResourceForInvalidExtensionResourceDuplicateName", + "deprecated": false, + "preselect": false, + "sortText": "2_validResourceForInvalidExtensionResourceDuplicateName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validResourceForInvalidExtensionResourceDuplicateName" + } + }, + { + "label": "wrongArrayType", + "kind": "interface", + "detail": "wrongArrayType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongArrayType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongArrayType" + } + }, + { + "label": "wrongLoopBodyType", + "kind": "interface", + "detail": "wrongLoopBodyType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongLoopBodyType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongLoopBodyType" + } + }, + { + "label": "wrongPropertyInNestedLoop", + "kind": "interface", + "detail": "wrongPropertyInNestedLoop", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongPropertyInNestedLoop", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongPropertyInNestedLoop" + } + } +] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccountRuleState.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccountRuleState.json new file mode 100644 index 00000000000..8961d7ed83a --- /dev/null +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccountRuleState.json @@ -0,0 +1,3552 @@ +[ + { + "label": "account", + "kind": "variable", + "detail": "account", + "deprecated": false, + "preselect": false, + "sortText": "2_account", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "account" + } + }, + { + "label": "any", + "kind": "function", + "detail": "any()", + "deprecated": false, + "preselect": false, + "sortText": "3_any", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "any($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "array", + "kind": "function", + "detail": "array()", + "deprecated": false, + "preselect": false, + "sortText": "3_array", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "array($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "arrayExpressionErrors", + "kind": "interface", + "detail": "arrayExpressionErrors", + "deprecated": false, + "preselect": false, + "sortText": "2_arrayExpressionErrors", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "arrayExpressionErrors" + } + }, + { + "label": "az", + "kind": "folder", + "detail": "az", + "deprecated": false, + "preselect": false, + "sortText": "3_az", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "az" + } + }, + { + "label": "badDepends", + "kind": "interface", + "detail": "badDepends", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends" + } + }, + { + "label": "badDepends2", + "kind": "interface", + "detail": "badDepends2", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends2" + } + }, + { + "label": "badDepends3", + "kind": "interface", + "detail": "badDepends3", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends3" + } + }, + { + "label": "badDepends4", + "kind": "interface", + "detail": "badDepends4", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends4" + } + }, + { + "label": "badDepends5", + "kind": "interface", + "detail": "badDepends5", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends5" + } + }, + { + "label": "badInterp", + "kind": "interface", + "detail": "badInterp", + "deprecated": false, + "preselect": false, + "sortText": "2_badInterp", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badInterp" + } + }, + { + "label": "bar", + "kind": "interface", + "detail": "bar", + "deprecated": false, + "preselect": false, + "sortText": "2_bar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bar" + } + }, + { + "label": "base64", + "kind": "function", + "detail": "base64()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToJson", + "kind": "function", + "detail": "base64ToJson()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToJson", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToJson($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToString", + "kind": "function", + "detail": "base64ToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "baz", + "kind": "interface", + "detail": "baz", + "deprecated": false, + "preselect": false, + "sortText": "2_baz", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "baz" + } + }, + { + "label": "bool", + "kind": "function", + "detail": "bool()", + "deprecated": false, + "preselect": false, + "sortText": "3_bool", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bool($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "coalesce", + "kind": "function", + "detail": "coalesce()", + "deprecated": false, + "preselect": false, + "sortText": "3_coalesce", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "coalesce($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "concat", + "kind": "function", + "detail": "concat()", + "deprecated": false, + "preselect": false, + "sortText": "3_concat", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "concat($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "contains", + "kind": "function", + "detail": "contains()", + "deprecated": false, + "preselect": false, + "sortText": "3_contains", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "contains($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "cyclicExistingRes", + "kind": "interface", + "detail": "cyclicExistingRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicExistingRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicExistingRes" + } + }, + { + "label": "cyclicRes", + "kind": "interface", + "detail": "cyclicRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicRes" + } + }, + { + "label": "dashesInPropertyNames", + "kind": "interface", + "detail": "dashesInPropertyNames", + "deprecated": false, + "preselect": false, + "sortText": "2_dashesInPropertyNames", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dashesInPropertyNames" + } + }, + { + "label": "dataUri", + "kind": "function", + "detail": "dataUri()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dataUriToString", + "kind": "function", + "detail": "dataUriToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUriToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUriToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dateTimeAdd", + "kind": "function", + "detail": "dateTimeAdd()", + "deprecated": false, + "preselect": false, + "sortText": "3_dateTimeAdd", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dateTimeAdd($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "deployment", + "kind": "function", + "detail": "deployment()", + "deprecated": false, + "preselect": false, + "sortText": "3_deployment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "deployment()$0" + } + }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, + { + "label": "discriminatorKeyMissing", + "kind": "interface", + "detail": "discriminatorKeyMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing" + } + }, + { + "label": "discriminatorKeyMissing_for", + "kind": "interface", + "detail": "discriminatorKeyMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_for" + } + }, + { + "label": "discriminatorKeyMissing_if", + "kind": "interface", + "detail": "discriminatorKeyMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_if" + } + }, + { + "label": "discriminatorKeySetOne", + "kind": "interface", + "detail": "discriminatorKeySetOne", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne" + } + }, + { + "label": "discriminatorKeySetOneCompletions", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions" + } + }, + { + "label": "discriminatorKeySetOneCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions3", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_if" + } + }, + { + "label": "discriminatorKeySetOne_for", + "kind": "interface", + "detail": "discriminatorKeySetOne_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_for" + } + }, + { + "label": "discriminatorKeySetOne_if", + "kind": "interface", + "detail": "discriminatorKeySetOne_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_if" + } + }, + { + "label": "discriminatorKeySetTwo", + "kind": "interface", + "detail": "discriminatorKeySetTwo", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo" + } + }, + { + "label": "discriminatorKeySetTwoCompletions", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_if" + } + }, + { + "label": "discriminatorKeySetTwo_for", + "kind": "interface", + "detail": "discriminatorKeySetTwo_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_for" + } + }, + { + "label": "discriminatorKeySetTwo_if", + "kind": "interface", + "detail": "discriminatorKeySetTwo_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_if" + } + }, + { + "label": "discriminatorKeyValueMissing", + "kind": "interface", + "detail": "discriminatorKeyValueMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_if" + } + }, + { + "label": "discriminatorKeyValueMissing_for", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_for" + } + }, + { + "label": "discriminatorKeyValueMissing_if", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_if" + } + }, + { + "label": "empty", + "kind": "function", + "detail": "empty()", + "deprecated": false, + "preselect": false, + "sortText": "3_empty", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "empty($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "emptyArray", + "kind": "variable", + "detail": "emptyArray", + "deprecated": false, + "preselect": false, + "sortText": "2_emptyArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "emptyArray" + } + }, + { + "label": "endsWith", + "kind": "function", + "detail": "endsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_endsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "endsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "environment", + "kind": "function", + "detail": "environment()", + "deprecated": false, + "preselect": false, + "sortText": "3_environment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "environment()$0" + } + }, + { + "label": "expectedArrayExpression", + "kind": "interface", + "detail": "expectedArrayExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedArrayExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedArrayExpression" + } + }, + { + "label": "expectedColon", + "kind": "interface", + "detail": "expectedColon", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedColon", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedColon" + } + }, + { + "label": "expectedForKeyword", + "kind": "interface", + "detail": "expectedForKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword" + } + }, + { + "label": "expectedForKeyword2", + "kind": "interface", + "detail": "expectedForKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword2" + } + }, + { + "label": "expectedInKeyword", + "kind": "interface", + "detail": "expectedInKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword" + } + }, + { + "label": "expectedInKeyword2", + "kind": "interface", + "detail": "expectedInKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword2" + } + }, + { + "label": "expectedLoopBody", + "kind": "interface", + "detail": "expectedLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopBody" + } + }, + { + "label": "expectedLoopVar", + "kind": "interface", + "detail": "expectedLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopVar" + } + }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, + { + "label": "extensionResourceId", + "kind": "function", + "detail": "extensionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_extensionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "extensionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "first", + "kind": "function", + "detail": "first()", + "deprecated": false, + "preselect": false, + "sortText": "3_first", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "first($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "fo", + "kind": "interface", + "detail": "fo", + "deprecated": false, + "preselect": false, + "sortText": "2_fo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "fo" + } + }, + { + "label": "foo", + "kind": "interface", + "detail": "foo", + "deprecated": false, + "preselect": false, + "sortText": "2_foo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "foo" + } + }, + { + "label": "format", + "kind": "function", + "detail": "format()", + "deprecated": false, + "preselect": false, + "sortText": "3_format", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "format($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "guid", + "kind": "function", + "detail": "guid()", + "deprecated": false, + "preselect": false, + "sortText": "3_guid", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "guid($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "incorrectPropertiesKey", + "kind": "interface", + "detail": "incorrectPropertiesKey", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey" + } + }, + { + "label": "incorrectPropertiesKey2", + "kind": "interface", + "detail": "incorrectPropertiesKey2", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey2" + } + }, + { + "label": "indexOf", + "kind": "function", + "detail": "indexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_indexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "indexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "int", + "kind": "function", + "detail": "int()", + "deprecated": false, + "preselect": false, + "sortText": "3_int", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "int($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "interpVal", + "kind": "variable", + "detail": "interpVal", + "deprecated": false, + "preselect": false, + "sortText": "2_interpVal", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "interpVal" + } + }, + { + "label": "intersection", + "kind": "function", + "detail": "intersection()", + "deprecated": false, + "preselect": false, + "sortText": "3_intersection", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "intersection($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "invalidDecorator", + "kind": "interface", + "detail": "invalidDecorator", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDecorator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDecorator" + } + }, + { + "label": "invalidDuplicateName1", + "kind": "interface", + "detail": "invalidDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName1" + } + }, + { + "label": "invalidDuplicateName2", + "kind": "interface", + "detail": "invalidDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName2" + } + }, + { + "label": "invalidDuplicateName3", + "kind": "interface", + "detail": "invalidDuplicateName3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName3" + } + }, + { + "label": "invalidExtensionResourceDuplicateName1", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName1" + } + }, + { + "label": "invalidExtensionResourceDuplicateName2", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName2" + } + }, + { + "label": "invalidScope", + "kind": "interface", + "detail": "invalidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope" + } + }, + { + "label": "invalidScope2", + "kind": "interface", + "detail": "invalidScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope2" + } + }, + { + "label": "invalidScope3", + "kind": "interface", + "detail": "invalidScope3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope3" + } + }, + { + "label": "json", + "kind": "function", + "detail": "json()", + "deprecated": false, + "preselect": false, + "sortText": "3_json", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "json($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "last", + "kind": "function", + "detail": "last()", + "deprecated": false, + "preselect": false, + "sortText": "3_last", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "last($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "lastIndexOf", + "kind": "function", + "detail": "lastIndexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_lastIndexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "lastIndexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "length", + "kind": "function", + "detail": "length()", + "deprecated": false, + "preselect": false, + "sortText": "3_length", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "length($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "letsAccessTheDashes", + "kind": "variable", + "detail": "letsAccessTheDashes", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes" + } + }, + { + "label": "letsAccessTheDashes2", + "kind": "variable", + "detail": "letsAccessTheDashes2", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes2" + } + }, + { + "label": "listKeys", + "kind": "function", + "detail": "listKeys()", + "deprecated": false, + "preselect": false, + "sortText": "3_listKeys", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "listKeys($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "magicString1", + "kind": "variable", + "detail": "magicString1", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString1" + } + }, + { + "label": "magicString2", + "kind": "variable", + "detail": "magicString2", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString2" + } + }, + { + "label": "managementGroup", + "kind": "function", + "detail": "managementGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_managementGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "managementGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "max", + "kind": "function", + "detail": "max()", + "deprecated": false, + "preselect": false, + "sortText": "3_max", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "max($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "min", + "kind": "function", + "detail": "min()", + "deprecated": false, + "preselect": false, + "sortText": "3_min", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "min($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "missingFewerRequiredProperties", + "kind": "interface", + "detail": "missingFewerRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingFewerRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingFewerRequiredProperties" + } + }, + { + "label": "missingRequiredProperties", + "kind": "interface", + "detail": "missingRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingRequiredProperties" + } + }, + { + "label": "missingTopLevelProperties", + "kind": "interface", + "detail": "missingTopLevelProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelProperties" + } + }, + { + "label": "missingTopLevelPropertiesExceptName", + "kind": "interface", + "detail": "missingTopLevelPropertiesExceptName", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelPropertiesExceptName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelPropertiesExceptName" + } + }, + { + "label": "missingType", + "kind": "interface", + "detail": "missingType", + "deprecated": false, + "preselect": false, + "sortText": "2_missingType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingType" + } + }, + { + "label": "mock", + "kind": "variable", + "detail": "mock", + "deprecated": false, + "preselect": false, + "sortText": "2_mock", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "mock" + } + }, + { + "label": "nestedDiscriminator", + "kind": "interface", + "detail": "nestedDiscriminator", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions" + } + }, + { + "label": "nestedDiscriminatorCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2" + } + }, + { + "label": "nestedDiscriminatorCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorCompletions3", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3" + } + }, + { + "label": "nestedDiscriminatorCompletions3_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_for" + } + }, + { + "label": "nestedDiscriminatorCompletions3_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_if" + } + }, + { + "label": "nestedDiscriminatorCompletions4", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4" + } + }, + { + "label": "nestedDiscriminatorCompletions4_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_for" + } + }, + { + "label": "nestedDiscriminatorCompletions4_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_if" + } + }, + { + "label": "nestedDiscriminatorCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_for" + } + }, + { + "label": "nestedDiscriminatorCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey_for", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_for" + } + }, + { + "label": "nestedDiscriminatorMissingKey_if", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_if" + } + }, + { + "label": "nestedDiscriminator_for", + "kind": "interface", + "detail": "nestedDiscriminator_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_for" + } + }, + { + "label": "nestedDiscriminator_if", + "kind": "interface", + "detail": "nestedDiscriminator_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_if" + } + }, + { + "label": "nestedPropertyAccessOnConditional", + "kind": "interface", + "detail": "nestedPropertyAccessOnConditional", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedPropertyAccessOnConditional", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedPropertyAccessOnConditional" + } + }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, + { + "label": "nonexistentArrays", + "kind": "interface", + "detail": "nonexistentArrays", + "deprecated": false, + "preselect": false, + "sortText": "2_nonexistentArrays", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonexistentArrays" + } + }, + { + "label": "notAResource", + "kind": "variable", + "detail": "notAResource", + "deprecated": false, + "preselect": false, + "sortText": "2_notAResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAResource" + } + }, + { + "label": "notAnArray", + "kind": "variable", + "detail": "notAnArray", + "deprecated": false, + "preselect": false, + "sortText": "2_notAnArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAnArray" + } + }, + { + "label": "padLeft", + "kind": "function", + "detail": "padLeft()", + "deprecated": false, + "preselect": false, + "sortText": "3_padLeft", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "padLeft($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "pickZones", + "kind": "function", + "detail": "pickZones()", + "deprecated": false, + "preselect": false, + "sortText": "3_pickZones", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "pickZones($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "premiumStorages", + "kind": "interface", + "detail": "premiumStorages", + "deprecated": false, + "preselect": false, + "sortText": "2_premiumStorages", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "premiumStorages" + } + }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "providers", + "kind": "function", + "detail": "providers()", + "deprecated": false, + "preselect": false, + "sortText": "3_providers", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "providers($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "range", + "kind": "function", + "detail": "range()", + "deprecated": false, + "preselect": false, + "sortText": "3_range", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "range($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "reference", + "kind": "function", + "detail": "reference()", + "deprecated": false, + "preselect": false, + "sortText": "3_reference", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "reference($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "replace", + "kind": "function", + "detail": "replace()", + "deprecated": false, + "preselect": false, + "sortText": "3_replace", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "replace($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceGroup", + "kind": "function", + "detail": "resourceGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceId", + "kind": "function", + "detail": "resourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceListIsNotSingleResource", + "kind": "variable", + "detail": "resourceListIsNotSingleResource", + "deprecated": false, + "preselect": false, + "sortText": "2_resourceListIsNotSingleResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceListIsNotSingleResource" + } + }, + { + "label": "resrefpar", + "kind": "field", + "detail": "resrefpar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefpar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefpar" + } + }, + { + "label": "resrefvar", + "kind": "variable", + "detail": "resrefvar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefvar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefvar" + } + }, + { + "label": "rule", + "kind": "variable", + "detail": "rule", + "deprecated": false, + "preselect": false, + "sortText": "2_rule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "rule" + } + }, + { + "label": "runtimeInvalid", + "kind": "variable", + "detail": "runtimeInvalid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalid" + } + }, + { + "label": "runtimeInvalidRes1", + "kind": "interface", + "detail": "runtimeInvalidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes1" + } + }, + { + "label": "runtimeInvalidRes10", + "kind": "interface", + "detail": "runtimeInvalidRes10", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes10", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes10" + } + }, + { + "label": "runtimeInvalidRes11", + "kind": "interface", + "detail": "runtimeInvalidRes11", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes11", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes11" + } + }, + { + "label": "runtimeInvalidRes12", + "kind": "interface", + "detail": "runtimeInvalidRes12", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes12", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes12" + } + }, + { + "label": "runtimeInvalidRes13", + "kind": "interface", + "detail": "runtimeInvalidRes13", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes13", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes13" + } + }, + { + "label": "runtimeInvalidRes14", + "kind": "interface", + "detail": "runtimeInvalidRes14", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes14", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes14" + } + }, + { + "label": "runtimeInvalidRes15", + "kind": "interface", + "detail": "runtimeInvalidRes15", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes15", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes15" + } + }, + { + "label": "runtimeInvalidRes16", + "kind": "interface", + "detail": "runtimeInvalidRes16", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes16", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes16" + } + }, + { + "label": "runtimeInvalidRes17", + "kind": "interface", + "detail": "runtimeInvalidRes17", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes17", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes17" + } + }, + { + "label": "runtimeInvalidRes18", + "kind": "interface", + "detail": "runtimeInvalidRes18", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes18", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes18" + } + }, + { + "label": "runtimeInvalidRes2", + "kind": "interface", + "detail": "runtimeInvalidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes2" + } + }, + { + "label": "runtimeInvalidRes3", + "kind": "interface", + "detail": "runtimeInvalidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes3" + } + }, + { + "label": "runtimeInvalidRes4", + "kind": "interface", + "detail": "runtimeInvalidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes4" + } + }, + { + "label": "runtimeInvalidRes5", + "kind": "interface", + "detail": "runtimeInvalidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes5" + } + }, + { + "label": "runtimeInvalidRes6", + "kind": "interface", + "detail": "runtimeInvalidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes6" + } + }, + { + "label": "runtimeInvalidRes7", + "kind": "interface", + "detail": "runtimeInvalidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes7" + } + }, + { + "label": "runtimeInvalidRes8", + "kind": "interface", + "detail": "runtimeInvalidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes8" + } + }, + { + "label": "runtimeInvalidRes9", + "kind": "interface", + "detail": "runtimeInvalidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes9" + } + }, + { + "label": "runtimeValid", + "kind": "variable", + "detail": "runtimeValid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValid" + } + }, + { + "label": "runtimeValidRes1", + "kind": "interface", + "detail": "runtimeValidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes1" + } + }, + { + "label": "runtimeValidRes2", + "kind": "interface", + "detail": "runtimeValidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes2" + } + }, + { + "label": "runtimeValidRes3", + "kind": "interface", + "detail": "runtimeValidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes3" + } + }, + { + "label": "runtimeValidRes4", + "kind": "interface", + "detail": "runtimeValidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes4" + } + }, + { + "label": "runtimeValidRes5", + "kind": "interface", + "detail": "runtimeValidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes5" + } + }, + { + "label": "runtimeValidRes6", + "kind": "interface", + "detail": "runtimeValidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes6" + } + }, + { + "label": "runtimeValidRes7", + "kind": "interface", + "detail": "runtimeValidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes7" + } + }, + { + "label": "runtimeValidRes8", + "kind": "interface", + "detail": "runtimeValidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes8" + } + }, + { + "label": "runtimeValidRes9", + "kind": "interface", + "detail": "runtimeValidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes9" + } + }, + { + "label": "runtimefoo1", + "kind": "variable", + "detail": "runtimefoo1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo1" + } + }, + { + "label": "runtimefoo2", + "kind": "variable", + "detail": "runtimefoo2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo2" + } + }, + { + "label": "runtimefoo3", + "kind": "variable", + "detail": "runtimefoo3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo3" + } + }, + { + "label": "runtimefoo4", + "kind": "variable", + "detail": "runtimefoo4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo4" + } + }, + { + "label": "selfScope", + "kind": "interface", + "detail": "selfScope", + "deprecated": false, + "preselect": false, + "sortText": "2_selfScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "selfScope" + } + }, + { + "label": "sigh", + "kind": "variable", + "detail": "sigh", + "deprecated": false, + "preselect": false, + "sortText": "2_sigh", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sigh" + } + }, + { + "label": "skip", + "kind": "function", + "detail": "skip()", + "deprecated": false, + "preselect": false, + "sortText": "3_skip", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "skip($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "split", + "kind": "function", + "detail": "split()", + "deprecated": false, + "preselect": false, + "sortText": "3_split", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "split($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "startedTypingTypeWithQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithQuotes" + } + }, + { + "label": "startedTypingTypeWithoutQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithoutQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithoutQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithoutQuotes" + } + }, + { + "label": "startsWith", + "kind": "function", + "detail": "startsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_startsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "state", + "kind": "variable", + "detail": "state", + "deprecated": false, + "preselect": false, + "sortText": "2_state", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "state" + } + }, + { + "label": "string", + "kind": "function", + "detail": "string()", + "deprecated": false, + "preselect": false, + "sortText": "3_string", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "stuffs", + "kind": "interface", + "detail": "stuffs", + "deprecated": false, + "preselect": false, + "sortText": "2_stuffs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "stuffs" + } + }, + { + "label": "subscription", + "kind": "function", + "detail": "subscription()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscription", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscription($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscriptionResourceId", + "kind": "function", + "detail": "subscriptionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscriptionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscriptionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "substring", + "kind": "function", + "detail": "substring()", + "deprecated": false, + "preselect": false, + "sortText": "3_substring", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "substring($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "sys", + "kind": "folder", + "detail": "sys", + "deprecated": false, + "preselect": false, + "sortText": "3_sys", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sys" + } + }, + { + "label": "take", + "kind": "function", + "detail": "take()", + "deprecated": false, + "preselect": false, + "sortText": "3_take", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "take($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "tenant", + "kind": "function", + "detail": "tenant()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenant", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenant()$0" + } + }, + { + "label": "tenantResourceId", + "kind": "function", + "detail": "tenantResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenantResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenantResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toLower", + "kind": "function", + "detail": "toLower()", + "deprecated": false, + "preselect": false, + "sortText": "3_toLower", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toLower($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toUpper", + "kind": "function", + "detail": "toUpper()", + "deprecated": false, + "preselect": false, + "sortText": "3_toUpper", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toUpper($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "trailingSpace", + "kind": "interface", + "detail": "trailingSpace", + "deprecated": false, + "preselect": false, + "sortText": "2_trailingSpace", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trailingSpace" + } + }, + { + "label": "trim", + "kind": "function", + "detail": "trim()", + "deprecated": false, + "preselect": false, + "sortText": "3_trim", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trim($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "unfinishedVnet", + "kind": "interface", + "detail": "unfinishedVnet", + "deprecated": false, + "preselect": false, + "sortText": "2_unfinishedVnet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "unfinishedVnet" + } + }, + { + "label": "union", + "kind": "function", + "detail": "union()", + "deprecated": false, + "preselect": false, + "sortText": "3_union", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "union($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uniqueString", + "kind": "function", + "detail": "uniqueString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uniqueString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uniqueString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uri", + "kind": "function", + "detail": "uri()", + "deprecated": false, + "preselect": false, + "sortText": "3_uri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponent", + "kind": "function", + "detail": "uriComponent()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponent", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponent($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponentToString", + "kind": "function", + "detail": "uriComponentToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponentToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponentToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "validModule", + "kind": "module", + "detail": "validModule", + "deprecated": false, + "preselect": false, + "sortText": "2_validModule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validModule" + } + }, + { + "label": "validResourceForInvalidExtensionResourceDuplicateName", + "kind": "interface", + "detail": "validResourceForInvalidExtensionResourceDuplicateName", + "deprecated": false, + "preselect": false, + "sortText": "2_validResourceForInvalidExtensionResourceDuplicateName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validResourceForInvalidExtensionResourceDuplicateName" + } + }, + { + "label": "wrongArrayType", + "kind": "interface", + "detail": "wrongArrayType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongArrayType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongArrayType" + } + }, + { + "label": "wrongLoopBodyType", + "kind": "interface", + "detail": "wrongLoopBodyType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongLoopBodyType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongLoopBodyType" + } + }, + { + "label": "wrongPropertyInNestedLoop", + "kind": "interface", + "detail": "wrongPropertyInNestedLoop", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongPropertyInNestedLoop", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongPropertyInNestedLoop" + } + } +] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccountRuleStateSomething.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccountRuleStateSomething.json new file mode 100644 index 00000000000..cbfad6a8459 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusAccountRuleStateSomething.json @@ -0,0 +1,3566 @@ +[ + { + "label": "account", + "kind": "variable", + "detail": "account", + "deprecated": false, + "preselect": false, + "sortText": "2_account", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "account" + } + }, + { + "label": "any", + "kind": "function", + "detail": "any()", + "deprecated": false, + "preselect": false, + "sortText": "3_any", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "any($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "array", + "kind": "function", + "detail": "array()", + "deprecated": false, + "preselect": false, + "sortText": "3_array", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "array($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "arrayExpressionErrors", + "kind": "interface", + "detail": "arrayExpressionErrors", + "deprecated": false, + "preselect": false, + "sortText": "2_arrayExpressionErrors", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "arrayExpressionErrors" + } + }, + { + "label": "az", + "kind": "folder", + "detail": "az", + "deprecated": false, + "preselect": false, + "sortText": "3_az", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "az" + } + }, + { + "label": "badDepends", + "kind": "interface", + "detail": "badDepends", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends" + } + }, + { + "label": "badDepends2", + "kind": "interface", + "detail": "badDepends2", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends2" + } + }, + { + "label": "badDepends3", + "kind": "interface", + "detail": "badDepends3", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends3" + } + }, + { + "label": "badDepends4", + "kind": "interface", + "detail": "badDepends4", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends4" + } + }, + { + "label": "badDepends5", + "kind": "interface", + "detail": "badDepends5", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends5" + } + }, + { + "label": "badInterp", + "kind": "interface", + "detail": "badInterp", + "deprecated": false, + "preselect": false, + "sortText": "2_badInterp", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badInterp" + } + }, + { + "label": "bar", + "kind": "interface", + "detail": "bar", + "deprecated": false, + "preselect": false, + "sortText": "2_bar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bar" + } + }, + { + "label": "base64", + "kind": "function", + "detail": "base64()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToJson", + "kind": "function", + "detail": "base64ToJson()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToJson", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToJson($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToString", + "kind": "function", + "detail": "base64ToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "baz", + "kind": "interface", + "detail": "baz", + "deprecated": false, + "preselect": false, + "sortText": "2_baz", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "baz" + } + }, + { + "label": "bool", + "kind": "function", + "detail": "bool()", + "deprecated": false, + "preselect": false, + "sortText": "3_bool", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bool($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "coalesce", + "kind": "function", + "detail": "coalesce()", + "deprecated": false, + "preselect": false, + "sortText": "3_coalesce", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "coalesce($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "concat", + "kind": "function", + "detail": "concat()", + "deprecated": false, + "preselect": false, + "sortText": "3_concat", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "concat($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "contains", + "kind": "function", + "detail": "contains()", + "deprecated": false, + "preselect": false, + "sortText": "3_contains", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "contains($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "cyclicExistingRes", + "kind": "interface", + "detail": "cyclicExistingRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicExistingRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicExistingRes" + } + }, + { + "label": "cyclicRes", + "kind": "interface", + "detail": "cyclicRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicRes" + } + }, + { + "label": "dashesInPropertyNames", + "kind": "interface", + "detail": "dashesInPropertyNames", + "deprecated": false, + "preselect": false, + "sortText": "2_dashesInPropertyNames", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dashesInPropertyNames" + } + }, + { + "label": "dataUri", + "kind": "function", + "detail": "dataUri()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dataUriToString", + "kind": "function", + "detail": "dataUriToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUriToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUriToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dateTimeAdd", + "kind": "function", + "detail": "dateTimeAdd()", + "deprecated": false, + "preselect": false, + "sortText": "3_dateTimeAdd", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dateTimeAdd($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "deployment", + "kind": "function", + "detail": "deployment()", + "deprecated": false, + "preselect": false, + "sortText": "3_deployment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "deployment()$0" + } + }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, + { + "label": "discriminatorKeyMissing", + "kind": "interface", + "detail": "discriminatorKeyMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing" + } + }, + { + "label": "discriminatorKeyMissing_for", + "kind": "interface", + "detail": "discriminatorKeyMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_for" + } + }, + { + "label": "discriminatorKeyMissing_if", + "kind": "interface", + "detail": "discriminatorKeyMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_if" + } + }, + { + "label": "discriminatorKeySetOne", + "kind": "interface", + "detail": "discriminatorKeySetOne", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne" + } + }, + { + "label": "discriminatorKeySetOneCompletions", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions" + } + }, + { + "label": "discriminatorKeySetOneCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions3", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_if" + } + }, + { + "label": "discriminatorKeySetOne_for", + "kind": "interface", + "detail": "discriminatorKeySetOne_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_for" + } + }, + { + "label": "discriminatorKeySetOne_if", + "kind": "interface", + "detail": "discriminatorKeySetOne_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_if" + } + }, + { + "label": "discriminatorKeySetTwo", + "kind": "interface", + "detail": "discriminatorKeySetTwo", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo" + } + }, + { + "label": "discriminatorKeySetTwoCompletions", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_if" + } + }, + { + "label": "discriminatorKeySetTwo_for", + "kind": "interface", + "detail": "discriminatorKeySetTwo_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_for" + } + }, + { + "label": "discriminatorKeySetTwo_if", + "kind": "interface", + "detail": "discriminatorKeySetTwo_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_if" + } + }, + { + "label": "discriminatorKeyValueMissing", + "kind": "interface", + "detail": "discriminatorKeyValueMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_if" + } + }, + { + "label": "discriminatorKeyValueMissing_for", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_for" + } + }, + { + "label": "discriminatorKeyValueMissing_if", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_if" + } + }, + { + "label": "empty", + "kind": "function", + "detail": "empty()", + "deprecated": false, + "preselect": false, + "sortText": "3_empty", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "empty($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "emptyArray", + "kind": "variable", + "detail": "emptyArray", + "deprecated": false, + "preselect": false, + "sortText": "2_emptyArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "emptyArray" + } + }, + { + "label": "endsWith", + "kind": "function", + "detail": "endsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_endsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "endsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "environment", + "kind": "function", + "detail": "environment()", + "deprecated": false, + "preselect": false, + "sortText": "3_environment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "environment()$0" + } + }, + { + "label": "expectedArrayExpression", + "kind": "interface", + "detail": "expectedArrayExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedArrayExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedArrayExpression" + } + }, + { + "label": "expectedColon", + "kind": "interface", + "detail": "expectedColon", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedColon", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedColon" + } + }, + { + "label": "expectedForKeyword", + "kind": "interface", + "detail": "expectedForKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword" + } + }, + { + "label": "expectedForKeyword2", + "kind": "interface", + "detail": "expectedForKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword2" + } + }, + { + "label": "expectedInKeyword", + "kind": "interface", + "detail": "expectedInKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword" + } + }, + { + "label": "expectedInKeyword2", + "kind": "interface", + "detail": "expectedInKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword2" + } + }, + { + "label": "expectedLoopBody", + "kind": "interface", + "detail": "expectedLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopBody" + } + }, + { + "label": "expectedLoopVar", + "kind": "interface", + "detail": "expectedLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopVar" + } + }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, + { + "label": "extensionResourceId", + "kind": "function", + "detail": "extensionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_extensionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "extensionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "first", + "kind": "function", + "detail": "first()", + "deprecated": false, + "preselect": false, + "sortText": "3_first", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "first($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "fo", + "kind": "interface", + "detail": "fo", + "deprecated": false, + "preselect": false, + "sortText": "2_fo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "fo" + } + }, + { + "label": "foo", + "kind": "interface", + "detail": "foo", + "deprecated": false, + "preselect": false, + "sortText": "2_foo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "foo" + } + }, + { + "label": "format", + "kind": "function", + "detail": "format()", + "deprecated": false, + "preselect": false, + "sortText": "3_format", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "format($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "guid", + "kind": "function", + "detail": "guid()", + "deprecated": false, + "preselect": false, + "sortText": "3_guid", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "guid($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "incorrectPropertiesKey", + "kind": "interface", + "detail": "incorrectPropertiesKey", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey" + } + }, + { + "label": "incorrectPropertiesKey2", + "kind": "interface", + "detail": "incorrectPropertiesKey2", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey2" + } + }, + { + "label": "indexOf", + "kind": "function", + "detail": "indexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_indexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "indexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "int", + "kind": "function", + "detail": "int()", + "deprecated": false, + "preselect": false, + "sortText": "3_int", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "int($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "interpVal", + "kind": "variable", + "detail": "interpVal", + "deprecated": false, + "preselect": false, + "sortText": "2_interpVal", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "interpVal" + } + }, + { + "label": "intersection", + "kind": "function", + "detail": "intersection()", + "deprecated": false, + "preselect": false, + "sortText": "3_intersection", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "intersection($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "invalidDecorator", + "kind": "interface", + "detail": "invalidDecorator", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDecorator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDecorator" + } + }, + { + "label": "invalidDuplicateName1", + "kind": "interface", + "detail": "invalidDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName1" + } + }, + { + "label": "invalidDuplicateName2", + "kind": "interface", + "detail": "invalidDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName2" + } + }, + { + "label": "invalidDuplicateName3", + "kind": "interface", + "detail": "invalidDuplicateName3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName3" + } + }, + { + "label": "invalidExtensionResourceDuplicateName1", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName1" + } + }, + { + "label": "invalidExtensionResourceDuplicateName2", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName2" + } + }, + { + "label": "invalidScope", + "kind": "interface", + "detail": "invalidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope" + } + }, + { + "label": "invalidScope2", + "kind": "interface", + "detail": "invalidScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope2" + } + }, + { + "label": "invalidScope3", + "kind": "interface", + "detail": "invalidScope3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope3" + } + }, + { + "label": "json", + "kind": "function", + "detail": "json()", + "deprecated": false, + "preselect": false, + "sortText": "3_json", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "json($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "last", + "kind": "function", + "detail": "last()", + "deprecated": false, + "preselect": false, + "sortText": "3_last", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "last($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "lastIndexOf", + "kind": "function", + "detail": "lastIndexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_lastIndexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "lastIndexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "length", + "kind": "function", + "detail": "length()", + "deprecated": false, + "preselect": false, + "sortText": "3_length", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "length($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "letsAccessTheDashes", + "kind": "variable", + "detail": "letsAccessTheDashes", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes" + } + }, + { + "label": "letsAccessTheDashes2", + "kind": "variable", + "detail": "letsAccessTheDashes2", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes2" + } + }, + { + "label": "listKeys", + "kind": "function", + "detail": "listKeys()", + "deprecated": false, + "preselect": false, + "sortText": "3_listKeys", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "listKeys($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "magicString1", + "kind": "variable", + "detail": "magicString1", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString1" + } + }, + { + "label": "magicString2", + "kind": "variable", + "detail": "magicString2", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString2" + } + }, + { + "label": "managementGroup", + "kind": "function", + "detail": "managementGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_managementGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "managementGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "max", + "kind": "function", + "detail": "max()", + "deprecated": false, + "preselect": false, + "sortText": "3_max", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "max($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "min", + "kind": "function", + "detail": "min()", + "deprecated": false, + "preselect": false, + "sortText": "3_min", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "min($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "missingFewerRequiredProperties", + "kind": "interface", + "detail": "missingFewerRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingFewerRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingFewerRequiredProperties" + } + }, + { + "label": "missingRequiredProperties", + "kind": "interface", + "detail": "missingRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingRequiredProperties" + } + }, + { + "label": "missingTopLevelProperties", + "kind": "interface", + "detail": "missingTopLevelProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelProperties" + } + }, + { + "label": "missingTopLevelPropertiesExceptName", + "kind": "interface", + "detail": "missingTopLevelPropertiesExceptName", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelPropertiesExceptName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelPropertiesExceptName" + } + }, + { + "label": "missingType", + "kind": "interface", + "detail": "missingType", + "deprecated": false, + "preselect": false, + "sortText": "2_missingType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingType" + } + }, + { + "label": "mock", + "kind": "variable", + "detail": "mock", + "deprecated": false, + "preselect": false, + "sortText": "2_mock", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "mock" + } + }, + { + "label": "nestedDiscriminator", + "kind": "interface", + "detail": "nestedDiscriminator", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions" + } + }, + { + "label": "nestedDiscriminatorCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2" + } + }, + { + "label": "nestedDiscriminatorCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorCompletions3", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3" + } + }, + { + "label": "nestedDiscriminatorCompletions3_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_for" + } + }, + { + "label": "nestedDiscriminatorCompletions3_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_if" + } + }, + { + "label": "nestedDiscriminatorCompletions4", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4" + } + }, + { + "label": "nestedDiscriminatorCompletions4_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_for" + } + }, + { + "label": "nestedDiscriminatorCompletions4_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_if" + } + }, + { + "label": "nestedDiscriminatorCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_for" + } + }, + { + "label": "nestedDiscriminatorCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey_for", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_for" + } + }, + { + "label": "nestedDiscriminatorMissingKey_if", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_if" + } + }, + { + "label": "nestedDiscriminator_for", + "kind": "interface", + "detail": "nestedDiscriminator_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_for" + } + }, + { + "label": "nestedDiscriminator_if", + "kind": "interface", + "detail": "nestedDiscriminator_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_if" + } + }, + { + "label": "nestedPropertyAccessOnConditional", + "kind": "interface", + "detail": "nestedPropertyAccessOnConditional", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedPropertyAccessOnConditional", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedPropertyAccessOnConditional" + } + }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, + { + "label": "nonexistentArrays", + "kind": "interface", + "detail": "nonexistentArrays", + "deprecated": false, + "preselect": false, + "sortText": "2_nonexistentArrays", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonexistentArrays" + } + }, + { + "label": "notAResource", + "kind": "variable", + "detail": "notAResource", + "deprecated": false, + "preselect": false, + "sortText": "2_notAResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAResource" + } + }, + { + "label": "notAnArray", + "kind": "variable", + "detail": "notAnArray", + "deprecated": false, + "preselect": false, + "sortText": "2_notAnArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAnArray" + } + }, + { + "label": "padLeft", + "kind": "function", + "detail": "padLeft()", + "deprecated": false, + "preselect": false, + "sortText": "3_padLeft", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "padLeft($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "pickZones", + "kind": "function", + "detail": "pickZones()", + "deprecated": false, + "preselect": false, + "sortText": "3_pickZones", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "pickZones($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "premiumStorages", + "kind": "interface", + "detail": "premiumStorages", + "deprecated": false, + "preselect": false, + "sortText": "2_premiumStorages", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "premiumStorages" + } + }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "providers", + "kind": "function", + "detail": "providers()", + "deprecated": false, + "preselect": false, + "sortText": "3_providers", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "providers($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "range", + "kind": "function", + "detail": "range()", + "deprecated": false, + "preselect": false, + "sortText": "3_range", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "range($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "reference", + "kind": "function", + "detail": "reference()", + "deprecated": false, + "preselect": false, + "sortText": "3_reference", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "reference($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "replace", + "kind": "function", + "detail": "replace()", + "deprecated": false, + "preselect": false, + "sortText": "3_replace", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "replace($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceGroup", + "kind": "function", + "detail": "resourceGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceId", + "kind": "function", + "detail": "resourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceListIsNotSingleResource", + "kind": "variable", + "detail": "resourceListIsNotSingleResource", + "deprecated": false, + "preselect": false, + "sortText": "2_resourceListIsNotSingleResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceListIsNotSingleResource" + } + }, + { + "label": "resrefpar", + "kind": "field", + "detail": "resrefpar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefpar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefpar" + } + }, + { + "label": "resrefvar", + "kind": "variable", + "detail": "resrefvar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefvar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefvar" + } + }, + { + "label": "rule", + "kind": "variable", + "detail": "rule", + "deprecated": false, + "preselect": false, + "sortText": "2_rule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "rule" + } + }, + { + "label": "runtimeInvalid", + "kind": "variable", + "detail": "runtimeInvalid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalid" + } + }, + { + "label": "runtimeInvalidRes1", + "kind": "interface", + "detail": "runtimeInvalidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes1" + } + }, + { + "label": "runtimeInvalidRes10", + "kind": "interface", + "detail": "runtimeInvalidRes10", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes10", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes10" + } + }, + { + "label": "runtimeInvalidRes11", + "kind": "interface", + "detail": "runtimeInvalidRes11", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes11", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes11" + } + }, + { + "label": "runtimeInvalidRes12", + "kind": "interface", + "detail": "runtimeInvalidRes12", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes12", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes12" + } + }, + { + "label": "runtimeInvalidRes13", + "kind": "interface", + "detail": "runtimeInvalidRes13", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes13", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes13" + } + }, + { + "label": "runtimeInvalidRes14", + "kind": "interface", + "detail": "runtimeInvalidRes14", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes14", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes14" + } + }, + { + "label": "runtimeInvalidRes15", + "kind": "interface", + "detail": "runtimeInvalidRes15", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes15", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes15" + } + }, + { + "label": "runtimeInvalidRes16", + "kind": "interface", + "detail": "runtimeInvalidRes16", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes16", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes16" + } + }, + { + "label": "runtimeInvalidRes17", + "kind": "interface", + "detail": "runtimeInvalidRes17", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes17", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes17" + } + }, + { + "label": "runtimeInvalidRes18", + "kind": "interface", + "detail": "runtimeInvalidRes18", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes18", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes18" + } + }, + { + "label": "runtimeInvalidRes2", + "kind": "interface", + "detail": "runtimeInvalidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes2" + } + }, + { + "label": "runtimeInvalidRes3", + "kind": "interface", + "detail": "runtimeInvalidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes3" + } + }, + { + "label": "runtimeInvalidRes4", + "kind": "interface", + "detail": "runtimeInvalidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes4" + } + }, + { + "label": "runtimeInvalidRes5", + "kind": "interface", + "detail": "runtimeInvalidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes5" + } + }, + { + "label": "runtimeInvalidRes6", + "kind": "interface", + "detail": "runtimeInvalidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes6" + } + }, + { + "label": "runtimeInvalidRes7", + "kind": "interface", + "detail": "runtimeInvalidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes7" + } + }, + { + "label": "runtimeInvalidRes8", + "kind": "interface", + "detail": "runtimeInvalidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes8" + } + }, + { + "label": "runtimeInvalidRes9", + "kind": "interface", + "detail": "runtimeInvalidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes9" + } + }, + { + "label": "runtimeValid", + "kind": "variable", + "detail": "runtimeValid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValid" + } + }, + { + "label": "runtimeValidRes1", + "kind": "interface", + "detail": "runtimeValidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes1" + } + }, + { + "label": "runtimeValidRes2", + "kind": "interface", + "detail": "runtimeValidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes2" + } + }, + { + "label": "runtimeValidRes3", + "kind": "interface", + "detail": "runtimeValidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes3" + } + }, + { + "label": "runtimeValidRes4", + "kind": "interface", + "detail": "runtimeValidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes4" + } + }, + { + "label": "runtimeValidRes5", + "kind": "interface", + "detail": "runtimeValidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes5" + } + }, + { + "label": "runtimeValidRes6", + "kind": "interface", + "detail": "runtimeValidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes6" + } + }, + { + "label": "runtimeValidRes7", + "kind": "interface", + "detail": "runtimeValidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes7" + } + }, + { + "label": "runtimeValidRes8", + "kind": "interface", + "detail": "runtimeValidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes8" + } + }, + { + "label": "runtimeValidRes9", + "kind": "interface", + "detail": "runtimeValidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes9" + } + }, + { + "label": "runtimefoo1", + "kind": "variable", + "detail": "runtimefoo1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo1" + } + }, + { + "label": "runtimefoo2", + "kind": "variable", + "detail": "runtimefoo2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo2" + } + }, + { + "label": "runtimefoo3", + "kind": "variable", + "detail": "runtimefoo3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo3" + } + }, + { + "label": "runtimefoo4", + "kind": "variable", + "detail": "runtimefoo4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo4" + } + }, + { + "label": "selfScope", + "kind": "interface", + "detail": "selfScope", + "deprecated": false, + "preselect": false, + "sortText": "2_selfScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "selfScope" + } + }, + { + "label": "sigh", + "kind": "variable", + "detail": "sigh", + "deprecated": false, + "preselect": false, + "sortText": "2_sigh", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sigh" + } + }, + { + "label": "skip", + "kind": "function", + "detail": "skip()", + "deprecated": false, + "preselect": false, + "sortText": "3_skip", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "skip($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "something", + "kind": "variable", + "detail": "something", + "deprecated": false, + "preselect": false, + "sortText": "2_something", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "something" + } + }, + { + "label": "split", + "kind": "function", + "detail": "split()", + "deprecated": false, + "preselect": false, + "sortText": "3_split", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "split($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "startedTypingTypeWithQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithQuotes" + } + }, + { + "label": "startedTypingTypeWithoutQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithoutQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithoutQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithoutQuotes" + } + }, + { + "label": "startsWith", + "kind": "function", + "detail": "startsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_startsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "state", + "kind": "variable", + "detail": "state", + "deprecated": false, + "preselect": false, + "sortText": "2_state", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "state" + } + }, + { + "label": "string", + "kind": "function", + "detail": "string()", + "deprecated": false, + "preselect": false, + "sortText": "3_string", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "stuffs", + "kind": "interface", + "detail": "stuffs", + "deprecated": false, + "preselect": false, + "sortText": "2_stuffs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "stuffs" + } + }, + { + "label": "subscription", + "kind": "function", + "detail": "subscription()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscription", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscription($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscriptionResourceId", + "kind": "function", + "detail": "subscriptionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscriptionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscriptionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "substring", + "kind": "function", + "detail": "substring()", + "deprecated": false, + "preselect": false, + "sortText": "3_substring", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "substring($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "sys", + "kind": "folder", + "detail": "sys", + "deprecated": false, + "preselect": false, + "sortText": "3_sys", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sys" + } + }, + { + "label": "take", + "kind": "function", + "detail": "take()", + "deprecated": false, + "preselect": false, + "sortText": "3_take", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "take($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "tenant", + "kind": "function", + "detail": "tenant()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenant", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenant()$0" + } + }, + { + "label": "tenantResourceId", + "kind": "function", + "detail": "tenantResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenantResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenantResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toLower", + "kind": "function", + "detail": "toLower()", + "deprecated": false, + "preselect": false, + "sortText": "3_toLower", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toLower($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toUpper", + "kind": "function", + "detail": "toUpper()", + "deprecated": false, + "preselect": false, + "sortText": "3_toUpper", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toUpper($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "trailingSpace", + "kind": "interface", + "detail": "trailingSpace", + "deprecated": false, + "preselect": false, + "sortText": "2_trailingSpace", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trailingSpace" + } + }, + { + "label": "trim", + "kind": "function", + "detail": "trim()", + "deprecated": false, + "preselect": false, + "sortText": "3_trim", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trim($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "unfinishedVnet", + "kind": "interface", + "detail": "unfinishedVnet", + "deprecated": false, + "preselect": false, + "sortText": "2_unfinishedVnet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "unfinishedVnet" + } + }, + { + "label": "union", + "kind": "function", + "detail": "union()", + "deprecated": false, + "preselect": false, + "sortText": "3_union", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "union($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uniqueString", + "kind": "function", + "detail": "uniqueString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uniqueString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uniqueString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uri", + "kind": "function", + "detail": "uri()", + "deprecated": false, + "preselect": false, + "sortText": "3_uri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponent", + "kind": "function", + "detail": "uriComponent()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponent", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponent($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponentToString", + "kind": "function", + "detail": "uriComponentToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponentToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponentToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "validModule", + "kind": "module", + "detail": "validModule", + "deprecated": false, + "preselect": false, + "sortText": "2_validModule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validModule" + } + }, + { + "label": "validResourceForInvalidExtensionResourceDuplicateName", + "kind": "interface", + "detail": "validResourceForInvalidExtensionResourceDuplicateName", + "deprecated": false, + "preselect": false, + "sortText": "2_validResourceForInvalidExtensionResourceDuplicateName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validResourceForInvalidExtensionResourceDuplicateName" + } + }, + { + "label": "wrongArrayType", + "kind": "interface", + "detail": "wrongArrayType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongArrayType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongArrayType" + } + }, + { + "label": "wrongLoopBodyType", + "kind": "interface", + "detail": "wrongLoopBodyType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongLoopBodyType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongLoopBodyType" + } + }, + { + "label": "wrongPropertyInNestedLoop", + "kind": "interface", + "detail": "wrongPropertyInNestedLoop", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongPropertyInNestedLoop", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongPropertyInNestedLoop" + } + } +] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusRule.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusRule.json new file mode 100644 index 00000000000..4eb10714044 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/symbolsPlusRule.json @@ -0,0 +1,3538 @@ +[ + { + "label": "account", + "kind": "variable", + "detail": "account", + "deprecated": false, + "preselect": false, + "sortText": "2_account", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "account" + } + }, + { + "label": "any", + "kind": "function", + "detail": "any()", + "deprecated": false, + "preselect": false, + "sortText": "3_any", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "any($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "array", + "kind": "function", + "detail": "array()", + "deprecated": false, + "preselect": false, + "sortText": "3_array", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "array($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "arrayExpressionErrors", + "kind": "interface", + "detail": "arrayExpressionErrors", + "deprecated": false, + "preselect": false, + "sortText": "2_arrayExpressionErrors", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "arrayExpressionErrors" + } + }, + { + "label": "az", + "kind": "folder", + "detail": "az", + "deprecated": false, + "preselect": false, + "sortText": "3_az", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "az" + } + }, + { + "label": "badDepends", + "kind": "interface", + "detail": "badDepends", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends" + } + }, + { + "label": "badDepends2", + "kind": "interface", + "detail": "badDepends2", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends2" + } + }, + { + "label": "badDepends3", + "kind": "interface", + "detail": "badDepends3", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends3" + } + }, + { + "label": "badDepends4", + "kind": "interface", + "detail": "badDepends4", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends4" + } + }, + { + "label": "badDepends5", + "kind": "interface", + "detail": "badDepends5", + "deprecated": false, + "preselect": false, + "sortText": "2_badDepends5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badDepends5" + } + }, + { + "label": "badInterp", + "kind": "interface", + "detail": "badInterp", + "deprecated": false, + "preselect": false, + "sortText": "2_badInterp", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "badInterp" + } + }, + { + "label": "bar", + "kind": "interface", + "detail": "bar", + "deprecated": false, + "preselect": false, + "sortText": "2_bar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bar" + } + }, + { + "label": "base64", + "kind": "function", + "detail": "base64()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToJson", + "kind": "function", + "detail": "base64ToJson()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToJson", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToJson($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "base64ToString", + "kind": "function", + "detail": "base64ToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_base64ToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "base64ToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "baz", + "kind": "interface", + "detail": "baz", + "deprecated": false, + "preselect": false, + "sortText": "2_baz", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "baz" + } + }, + { + "label": "bool", + "kind": "function", + "detail": "bool()", + "deprecated": false, + "preselect": false, + "sortText": "3_bool", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "bool($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "coalesce", + "kind": "function", + "detail": "coalesce()", + "deprecated": false, + "preselect": false, + "sortText": "3_coalesce", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "coalesce($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "concat", + "kind": "function", + "detail": "concat()", + "deprecated": false, + "preselect": false, + "sortText": "3_concat", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "concat($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "contains", + "kind": "function", + "detail": "contains()", + "deprecated": false, + "preselect": false, + "sortText": "3_contains", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "contains($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "cyclicExistingRes", + "kind": "interface", + "detail": "cyclicExistingRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicExistingRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicExistingRes" + } + }, + { + "label": "cyclicRes", + "kind": "interface", + "detail": "cyclicRes", + "deprecated": false, + "preselect": false, + "sortText": "2_cyclicRes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "cyclicRes" + } + }, + { + "label": "dashesInPropertyNames", + "kind": "interface", + "detail": "dashesInPropertyNames", + "deprecated": false, + "preselect": false, + "sortText": "2_dashesInPropertyNames", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dashesInPropertyNames" + } + }, + { + "label": "dataUri", + "kind": "function", + "detail": "dataUri()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dataUriToString", + "kind": "function", + "detail": "dataUriToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_dataUriToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dataUriToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "dateTimeAdd", + "kind": "function", + "detail": "dateTimeAdd()", + "deprecated": false, + "preselect": false, + "sortText": "3_dateTimeAdd", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "dateTimeAdd($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "deployment", + "kind": "function", + "detail": "deployment()", + "deprecated": false, + "preselect": false, + "sortText": "3_deployment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "deployment()$0" + } + }, + { + "label": "directRefViaSingleConditionalResourceBody", + "kind": "interface", + "detail": "directRefViaSingleConditionalResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleConditionalResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleConditionalResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBody", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBody" + } + }, + { + "label": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "kind": "interface", + "detail": "directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleLoopResourceBodyWithExtraDependsOn", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleLoopResourceBodyWithExtraDependsOn" + } + }, + { + "label": "directRefViaSingleResourceBody", + "kind": "interface", + "detail": "directRefViaSingleResourceBody", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaSingleResourceBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaSingleResourceBody" + } + }, + { + "label": "directRefViaVar", + "kind": "variable", + "detail": "directRefViaVar", + "deprecated": false, + "preselect": false, + "sortText": "2_directRefViaVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "directRefViaVar" + } + }, + { + "label": "discriminatorKeyMissing", + "kind": "interface", + "detail": "discriminatorKeyMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing" + } + }, + { + "label": "discriminatorKeyMissing_for", + "kind": "interface", + "detail": "discriminatorKeyMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_for" + } + }, + { + "label": "discriminatorKeyMissing_if", + "kind": "interface", + "detail": "discriminatorKeyMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyMissing_if" + } + }, + { + "label": "discriminatorKeySetOne", + "kind": "interface", + "detail": "discriminatorKeySetOne", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne" + } + }, + { + "label": "discriminatorKeySetOneCompletions", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions" + } + }, + { + "label": "discriminatorKeySetOneCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions2_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions3", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions3_if" + } + }, + { + "label": "discriminatorKeySetOneCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_for" + } + }, + { + "label": "discriminatorKeySetOneCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetOneCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOneCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOneCompletions_if" + } + }, + { + "label": "discriminatorKeySetOne_for", + "kind": "interface", + "detail": "discriminatorKeySetOne_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_for" + } + }, + { + "label": "discriminatorKeySetOne_if", + "kind": "interface", + "detail": "discriminatorKeySetOne_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetOne_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetOne_if" + } + }, + { + "label": "discriminatorKeySetTwo", + "kind": "interface", + "detail": "discriminatorKeySetTwo", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo" + } + }, + { + "label": "discriminatorKeySetTwoCompletions", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer2_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletionsArrayIndexer_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletionsArrayIndexer_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletionsArrayIndexer_if" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_for", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_for" + } + }, + { + "label": "discriminatorKeySetTwoCompletions_if", + "kind": "variable", + "detail": "discriminatorKeySetTwoCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwoCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwoCompletions_if" + } + }, + { + "label": "discriminatorKeySetTwo_for", + "kind": "interface", + "detail": "discriminatorKeySetTwo_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_for" + } + }, + { + "label": "discriminatorKeySetTwo_if", + "kind": "interface", + "detail": "discriminatorKeySetTwo_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeySetTwo_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeySetTwo_if" + } + }, + { + "label": "discriminatorKeyValueMissing", + "kind": "interface", + "detail": "discriminatorKeyValueMissing", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions2_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions2_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions3_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions3_if" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_for", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_for" + } + }, + { + "label": "discriminatorKeyValueMissingCompletions_if", + "kind": "variable", + "detail": "discriminatorKeyValueMissingCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissingCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissingCompletions_if" + } + }, + { + "label": "discriminatorKeyValueMissing_for", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_for", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_for" + } + }, + { + "label": "discriminatorKeyValueMissing_if", + "kind": "interface", + "detail": "discriminatorKeyValueMissing_if", + "deprecated": false, + "preselect": false, + "sortText": "2_discriminatorKeyValueMissing_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "discriminatorKeyValueMissing_if" + } + }, + { + "label": "empty", + "kind": "function", + "detail": "empty()", + "deprecated": false, + "preselect": false, + "sortText": "3_empty", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "empty($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "emptyArray", + "kind": "variable", + "detail": "emptyArray", + "deprecated": false, + "preselect": false, + "sortText": "2_emptyArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "emptyArray" + } + }, + { + "label": "endsWith", + "kind": "function", + "detail": "endsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_endsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "endsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "environment", + "kind": "function", + "detail": "environment()", + "deprecated": false, + "preselect": false, + "sortText": "3_environment", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "environment()$0" + } + }, + { + "label": "expectedArrayExpression", + "kind": "interface", + "detail": "expectedArrayExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedArrayExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedArrayExpression" + } + }, + { + "label": "expectedColon", + "kind": "interface", + "detail": "expectedColon", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedColon", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedColon" + } + }, + { + "label": "expectedForKeyword", + "kind": "interface", + "detail": "expectedForKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword" + } + }, + { + "label": "expectedForKeyword2", + "kind": "interface", + "detail": "expectedForKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedForKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedForKeyword2" + } + }, + { + "label": "expectedInKeyword", + "kind": "interface", + "detail": "expectedInKeyword", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword" + } + }, + { + "label": "expectedInKeyword2", + "kind": "interface", + "detail": "expectedInKeyword2", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedInKeyword2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedInKeyword2" + } + }, + { + "label": "expectedLoopBody", + "kind": "interface", + "detail": "expectedLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopBody" + } + }, + { + "label": "expectedLoopVar", + "kind": "interface", + "detail": "expectedLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expectedLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expectedLoopVar" + } + }, + { + "label": "expressionInPropertyLoopVar", + "kind": "variable", + "detail": "expressionInPropertyLoopVar", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionInPropertyLoopVar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionInPropertyLoopVar" + } + }, + { + "label": "expressionsInPropertyLoopName", + "kind": "interface", + "detail": "expressionsInPropertyLoopName", + "deprecated": false, + "preselect": false, + "sortText": "2_expressionsInPropertyLoopName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "expressionsInPropertyLoopName" + } + }, + { + "label": "extensionResourceId", + "kind": "function", + "detail": "extensionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_extensionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "extensionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "first", + "kind": "function", + "detail": "first()", + "deprecated": false, + "preselect": false, + "sortText": "3_first", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "first($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "fo", + "kind": "interface", + "detail": "fo", + "deprecated": false, + "preselect": false, + "sortText": "2_fo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "fo" + } + }, + { + "label": "foo", + "kind": "interface", + "detail": "foo", + "deprecated": false, + "preselect": false, + "sortText": "2_foo", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "foo" + } + }, + { + "label": "format", + "kind": "function", + "detail": "format()", + "deprecated": false, + "preselect": false, + "sortText": "3_format", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "format($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "guid", + "kind": "function", + "detail": "guid()", + "deprecated": false, + "preselect": false, + "sortText": "3_guid", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "guid($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "incorrectPropertiesKey", + "kind": "interface", + "detail": "incorrectPropertiesKey", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey" + } + }, + { + "label": "incorrectPropertiesKey2", + "kind": "interface", + "detail": "incorrectPropertiesKey2", + "deprecated": false, + "preselect": false, + "sortText": "2_incorrectPropertiesKey2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "incorrectPropertiesKey2" + } + }, + { + "label": "indexOf", + "kind": "function", + "detail": "indexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_indexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "indexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "int", + "kind": "function", + "detail": "int()", + "deprecated": false, + "preselect": false, + "sortText": "3_int", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "int($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "interpVal", + "kind": "variable", + "detail": "interpVal", + "deprecated": false, + "preselect": false, + "sortText": "2_interpVal", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "interpVal" + } + }, + { + "label": "intersection", + "kind": "function", + "detail": "intersection()", + "deprecated": false, + "preselect": false, + "sortText": "3_intersection", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "intersection($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "invalidDecorator", + "kind": "interface", + "detail": "invalidDecorator", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDecorator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDecorator" + } + }, + { + "label": "invalidDuplicateName1", + "kind": "interface", + "detail": "invalidDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName1" + } + }, + { + "label": "invalidDuplicateName2", + "kind": "interface", + "detail": "invalidDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName2" + } + }, + { + "label": "invalidDuplicateName3", + "kind": "interface", + "detail": "invalidDuplicateName3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidDuplicateName3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidDuplicateName3" + } + }, + { + "label": "invalidExtensionResourceDuplicateName1", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName1", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName1" + } + }, + { + "label": "invalidExtensionResourceDuplicateName2", + "kind": "interface", + "detail": "invalidExtensionResourceDuplicateName2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidExtensionResourceDuplicateName2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidExtensionResourceDuplicateName2" + } + }, + { + "label": "invalidScope", + "kind": "interface", + "detail": "invalidScope", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope" + } + }, + { + "label": "invalidScope2", + "kind": "interface", + "detail": "invalidScope2", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope2" + } + }, + { + "label": "invalidScope3", + "kind": "interface", + "detail": "invalidScope3", + "deprecated": false, + "preselect": false, + "sortText": "2_invalidScope3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "invalidScope3" + } + }, + { + "label": "json", + "kind": "function", + "detail": "json()", + "deprecated": false, + "preselect": false, + "sortText": "3_json", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "json($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "last", + "kind": "function", + "detail": "last()", + "deprecated": false, + "preselect": false, + "sortText": "3_last", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "last($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "lastIndexOf", + "kind": "function", + "detail": "lastIndexOf()", + "deprecated": false, + "preselect": false, + "sortText": "3_lastIndexOf", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "lastIndexOf($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "length", + "kind": "function", + "detail": "length()", + "deprecated": false, + "preselect": false, + "sortText": "3_length", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "length($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "letsAccessTheDashes", + "kind": "variable", + "detail": "letsAccessTheDashes", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes" + } + }, + { + "label": "letsAccessTheDashes2", + "kind": "variable", + "detail": "letsAccessTheDashes2", + "deprecated": false, + "preselect": false, + "sortText": "2_letsAccessTheDashes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "letsAccessTheDashes2" + } + }, + { + "label": "listKeys", + "kind": "function", + "detail": "listKeys()", + "deprecated": false, + "preselect": false, + "sortText": "3_listKeys", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "listKeys($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "magicString1", + "kind": "variable", + "detail": "magicString1", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString1" + } + }, + { + "label": "magicString2", + "kind": "variable", + "detail": "magicString2", + "deprecated": false, + "preselect": false, + "sortText": "2_magicString2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "magicString2" + } + }, + { + "label": "managementGroup", + "kind": "function", + "detail": "managementGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_managementGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "managementGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "max", + "kind": "function", + "detail": "max()", + "deprecated": false, + "preselect": false, + "sortText": "3_max", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "max($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "min", + "kind": "function", + "detail": "min()", + "deprecated": false, + "preselect": false, + "sortText": "3_min", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "min($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "missingFewerRequiredProperties", + "kind": "interface", + "detail": "missingFewerRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingFewerRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingFewerRequiredProperties" + } + }, + { + "label": "missingRequiredProperties", + "kind": "interface", + "detail": "missingRequiredProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingRequiredProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingRequiredProperties" + } + }, + { + "label": "missingTopLevelProperties", + "kind": "interface", + "detail": "missingTopLevelProperties", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelProperties", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelProperties" + } + }, + { + "label": "missingTopLevelPropertiesExceptName", + "kind": "interface", + "detail": "missingTopLevelPropertiesExceptName", + "deprecated": false, + "preselect": false, + "sortText": "2_missingTopLevelPropertiesExceptName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingTopLevelPropertiesExceptName" + } + }, + { + "label": "missingType", + "kind": "interface", + "detail": "missingType", + "deprecated": false, + "preselect": false, + "sortText": "2_missingType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "missingType" + } + }, + { + "label": "mock", + "kind": "variable", + "detail": "mock", + "deprecated": false, + "preselect": false, + "sortText": "2_mock", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "mock" + } + }, + { + "label": "nestedDiscriminator", + "kind": "interface", + "detail": "nestedDiscriminator", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorArrayIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorArrayIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorArrayIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorArrayIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions" + } + }, + { + "label": "nestedDiscriminatorCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2" + } + }, + { + "label": "nestedDiscriminatorCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorCompletions3", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3" + } + }, + { + "label": "nestedDiscriminatorCompletions3_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_for" + } + }, + { + "label": "nestedDiscriminatorCompletions3_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions3_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions3_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions3_if" + } + }, + { + "label": "nestedDiscriminatorCompletions4", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4" + } + }, + { + "label": "nestedDiscriminatorCompletions4_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_for" + } + }, + { + "label": "nestedDiscriminatorCompletions4_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions4_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions4_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions4_if" + } + }, + { + "label": "nestedDiscriminatorCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_for" + } + }, + { + "label": "nestedDiscriminatorCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions2_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions2_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions2_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions2_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_for" + } + }, + { + "label": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "kind": "variable", + "detail": "nestedDiscriminatorMissingKeyIndexCompletions_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKeyIndexCompletions_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKeyIndexCompletions_if" + } + }, + { + "label": "nestedDiscriminatorMissingKey_for", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_for" + } + }, + { + "label": "nestedDiscriminatorMissingKey_if", + "kind": "interface", + "detail": "nestedDiscriminatorMissingKey_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminatorMissingKey_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminatorMissingKey_if" + } + }, + { + "label": "nestedDiscriminator_for", + "kind": "interface", + "detail": "nestedDiscriminator_for", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_for", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_for" + } + }, + { + "label": "nestedDiscriminator_if", + "kind": "interface", + "detail": "nestedDiscriminator_if", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedDiscriminator_if", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedDiscriminator_if" + } + }, + { + "label": "nestedPropertyAccessOnConditional", + "kind": "interface", + "detail": "nestedPropertyAccessOnConditional", + "deprecated": false, + "preselect": false, + "sortText": "2_nestedPropertyAccessOnConditional", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nestedPropertyAccessOnConditional" + } + }, + { + "label": "nonObjectResourceLoopBody", + "kind": "interface", + "detail": "nonObjectResourceLoopBody", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody" + } + }, + { + "label": "nonObjectResourceLoopBody2", + "kind": "interface", + "detail": "nonObjectResourceLoopBody2", + "deprecated": false, + "preselect": false, + "sortText": "2_nonObjectResourceLoopBody2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonObjectResourceLoopBody2" + } + }, + { + "label": "nonexistentArrays", + "kind": "interface", + "detail": "nonexistentArrays", + "deprecated": false, + "preselect": false, + "sortText": "2_nonexistentArrays", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "nonexistentArrays" + } + }, + { + "label": "notAResource", + "kind": "variable", + "detail": "notAResource", + "deprecated": false, + "preselect": false, + "sortText": "2_notAResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAResource" + } + }, + { + "label": "notAnArray", + "kind": "variable", + "detail": "notAnArray", + "deprecated": false, + "preselect": false, + "sortText": "2_notAnArray", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "notAnArray" + } + }, + { + "label": "padLeft", + "kind": "function", + "detail": "padLeft()", + "deprecated": false, + "preselect": false, + "sortText": "3_padLeft", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "padLeft($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "pickZones", + "kind": "function", + "detail": "pickZones()", + "deprecated": false, + "preselect": false, + "sortText": "3_pickZones", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "pickZones($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "premiumStorages", + "kind": "interface", + "detail": "premiumStorages", + "deprecated": false, + "preselect": false, + "sortText": "2_premiumStorages", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "premiumStorages" + } + }, + { + "label": "propertyLoopsCannotNest", + "kind": "interface", + "detail": "propertyLoopsCannotNest", + "deprecated": false, + "preselect": false, + "sortText": "2_propertyLoopsCannotNest", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "propertyLoopsCannotNest" + } + }, + { + "label": "providers", + "kind": "function", + "detail": "providers()", + "deprecated": false, + "preselect": false, + "sortText": "3_providers", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "providers($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "range", + "kind": "function", + "detail": "range()", + "deprecated": false, + "preselect": false, + "sortText": "3_range", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "range($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "reference", + "kind": "function", + "detail": "reference()", + "deprecated": false, + "preselect": false, + "sortText": "3_reference", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "reference($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "replace", + "kind": "function", + "detail": "replace()", + "deprecated": false, + "preselect": false, + "sortText": "3_replace", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "replace($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceGroup", + "kind": "function", + "detail": "resourceGroup()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceGroup", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceGroup($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceId", + "kind": "function", + "detail": "resourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_resourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "resourceListIsNotSingleResource", + "kind": "variable", + "detail": "resourceListIsNotSingleResource", + "deprecated": false, + "preselect": false, + "sortText": "2_resourceListIsNotSingleResource", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resourceListIsNotSingleResource" + } + }, + { + "label": "resrefpar", + "kind": "field", + "detail": "resrefpar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefpar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefpar" + } + }, + { + "label": "resrefvar", + "kind": "variable", + "detail": "resrefvar", + "deprecated": false, + "preselect": false, + "sortText": "2_resrefvar", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "resrefvar" + } + }, + { + "label": "rule", + "kind": "variable", + "detail": "rule", + "deprecated": false, + "preselect": false, + "sortText": "2_rule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "rule" + } + }, + { + "label": "runtimeInvalid", + "kind": "variable", + "detail": "runtimeInvalid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalid" + } + }, + { + "label": "runtimeInvalidRes1", + "kind": "interface", + "detail": "runtimeInvalidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes1" + } + }, + { + "label": "runtimeInvalidRes10", + "kind": "interface", + "detail": "runtimeInvalidRes10", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes10", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes10" + } + }, + { + "label": "runtimeInvalidRes11", + "kind": "interface", + "detail": "runtimeInvalidRes11", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes11", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes11" + } + }, + { + "label": "runtimeInvalidRes12", + "kind": "interface", + "detail": "runtimeInvalidRes12", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes12", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes12" + } + }, + { + "label": "runtimeInvalidRes13", + "kind": "interface", + "detail": "runtimeInvalidRes13", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes13", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes13" + } + }, + { + "label": "runtimeInvalidRes14", + "kind": "interface", + "detail": "runtimeInvalidRes14", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes14", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes14" + } + }, + { + "label": "runtimeInvalidRes15", + "kind": "interface", + "detail": "runtimeInvalidRes15", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes15", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes15" + } + }, + { + "label": "runtimeInvalidRes16", + "kind": "interface", + "detail": "runtimeInvalidRes16", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes16", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes16" + } + }, + { + "label": "runtimeInvalidRes17", + "kind": "interface", + "detail": "runtimeInvalidRes17", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes17", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes17" + } + }, + { + "label": "runtimeInvalidRes18", + "kind": "interface", + "detail": "runtimeInvalidRes18", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes18", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes18" + } + }, + { + "label": "runtimeInvalidRes2", + "kind": "interface", + "detail": "runtimeInvalidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes2" + } + }, + { + "label": "runtimeInvalidRes3", + "kind": "interface", + "detail": "runtimeInvalidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes3" + } + }, + { + "label": "runtimeInvalidRes4", + "kind": "interface", + "detail": "runtimeInvalidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes4" + } + }, + { + "label": "runtimeInvalidRes5", + "kind": "interface", + "detail": "runtimeInvalidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes5" + } + }, + { + "label": "runtimeInvalidRes6", + "kind": "interface", + "detail": "runtimeInvalidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes6" + } + }, + { + "label": "runtimeInvalidRes7", + "kind": "interface", + "detail": "runtimeInvalidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes7" + } + }, + { + "label": "runtimeInvalidRes8", + "kind": "interface", + "detail": "runtimeInvalidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes8" + } + }, + { + "label": "runtimeInvalidRes9", + "kind": "interface", + "detail": "runtimeInvalidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeInvalidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeInvalidRes9" + } + }, + { + "label": "runtimeValid", + "kind": "variable", + "detail": "runtimeValid", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValid", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValid" + } + }, + { + "label": "runtimeValidRes1", + "kind": "interface", + "detail": "runtimeValidRes1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes1" + } + }, + { + "label": "runtimeValidRes2", + "kind": "interface", + "detail": "runtimeValidRes2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes2" + } + }, + { + "label": "runtimeValidRes3", + "kind": "interface", + "detail": "runtimeValidRes3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes3" + } + }, + { + "label": "runtimeValidRes4", + "kind": "interface", + "detail": "runtimeValidRes4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes4" + } + }, + { + "label": "runtimeValidRes5", + "kind": "interface", + "detail": "runtimeValidRes5", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes5", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes5" + } + }, + { + "label": "runtimeValidRes6", + "kind": "interface", + "detail": "runtimeValidRes6", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes6", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes6" + } + }, + { + "label": "runtimeValidRes7", + "kind": "interface", + "detail": "runtimeValidRes7", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes7", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes7" + } + }, + { + "label": "runtimeValidRes8", + "kind": "interface", + "detail": "runtimeValidRes8", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes8", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes8" + } + }, + { + "label": "runtimeValidRes9", + "kind": "interface", + "detail": "runtimeValidRes9", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimeValidRes9", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimeValidRes9" + } + }, + { + "label": "runtimefoo1", + "kind": "variable", + "detail": "runtimefoo1", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo1", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo1" + } + }, + { + "label": "runtimefoo2", + "kind": "variable", + "detail": "runtimefoo2", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo2", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo2" + } + }, + { + "label": "runtimefoo3", + "kind": "variable", + "detail": "runtimefoo3", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo3", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo3" + } + }, + { + "label": "runtimefoo4", + "kind": "variable", + "detail": "runtimefoo4", + "deprecated": false, + "preselect": false, + "sortText": "2_runtimefoo4", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "runtimefoo4" + } + }, + { + "label": "selfScope", + "kind": "interface", + "detail": "selfScope", + "deprecated": false, + "preselect": false, + "sortText": "2_selfScope", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "selfScope" + } + }, + { + "label": "sigh", + "kind": "variable", + "detail": "sigh", + "deprecated": false, + "preselect": false, + "sortText": "2_sigh", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sigh" + } + }, + { + "label": "skip", + "kind": "function", + "detail": "skip()", + "deprecated": false, + "preselect": false, + "sortText": "3_skip", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "skip($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "split", + "kind": "function", + "detail": "split()", + "deprecated": false, + "preselect": false, + "sortText": "3_split", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "split($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "startedTypingTypeWithQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithQuotes" + } + }, + { + "label": "startedTypingTypeWithoutQuotes", + "kind": "interface", + "detail": "startedTypingTypeWithoutQuotes", + "deprecated": false, + "preselect": false, + "sortText": "2_startedTypingTypeWithoutQuotes", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startedTypingTypeWithoutQuotes" + } + }, + { + "label": "startsWith", + "kind": "function", + "detail": "startsWith()", + "deprecated": false, + "preselect": false, + "sortText": "3_startsWith", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "startsWith($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "string", + "kind": "function", + "detail": "string()", + "deprecated": false, + "preselect": false, + "sortText": "3_string", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "string($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "stuffs", + "kind": "interface", + "detail": "stuffs", + "deprecated": false, + "preselect": false, + "sortText": "2_stuffs", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "stuffs" + } + }, + { + "label": "subscription", + "kind": "function", + "detail": "subscription()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscription", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscription($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "subscriptionResourceId", + "kind": "function", + "detail": "subscriptionResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_subscriptionResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "subscriptionResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "substring", + "kind": "function", + "detail": "substring()", + "deprecated": false, + "preselect": false, + "sortText": "3_substring", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "substring($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "sys", + "kind": "folder", + "detail": "sys", + "deprecated": false, + "preselect": false, + "sortText": "3_sys", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "sys" + } + }, + { + "label": "take", + "kind": "function", + "detail": "take()", + "deprecated": false, + "preselect": false, + "sortText": "3_take", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "take($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "tenant", + "kind": "function", + "detail": "tenant()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenant", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenant()$0" + } + }, + { + "label": "tenantResourceId", + "kind": "function", + "detail": "tenantResourceId()", + "deprecated": false, + "preselect": false, + "sortText": "3_tenantResourceId", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "tenantResourceId($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toLower", + "kind": "function", + "detail": "toLower()", + "deprecated": false, + "preselect": false, + "sortText": "3_toLower", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toLower($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "toUpper", + "kind": "function", + "detail": "toUpper()", + "deprecated": false, + "preselect": false, + "sortText": "3_toUpper", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "toUpper($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "trailingSpace", + "kind": "interface", + "detail": "trailingSpace", + "deprecated": false, + "preselect": false, + "sortText": "2_trailingSpace", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trailingSpace" + } + }, + { + "label": "trim", + "kind": "function", + "detail": "trim()", + "deprecated": false, + "preselect": false, + "sortText": "3_trim", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "trim($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "unfinishedVnet", + "kind": "interface", + "detail": "unfinishedVnet", + "deprecated": false, + "preselect": false, + "sortText": "2_unfinishedVnet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "unfinishedVnet" + } + }, + { + "label": "union", + "kind": "function", + "detail": "union()", + "deprecated": false, + "preselect": false, + "sortText": "3_union", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "union($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uniqueString", + "kind": "function", + "detail": "uniqueString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uniqueString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uniqueString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uri", + "kind": "function", + "detail": "uri()", + "deprecated": false, + "preselect": false, + "sortText": "3_uri", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uri($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponent", + "kind": "function", + "detail": "uriComponent()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponent", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponent($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "uriComponentToString", + "kind": "function", + "detail": "uriComponentToString()", + "deprecated": false, + "preselect": false, + "sortText": "3_uriComponentToString", + "insertTextFormat": "snippet", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "uriComponentToString($0)" + }, + "command": { + "command": "editor.action.triggerParameterHints" + } + }, + { + "label": "validModule", + "kind": "module", + "detail": "validModule", + "deprecated": false, + "preselect": false, + "sortText": "2_validModule", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validModule" + } + }, + { + "label": "validResourceForInvalidExtensionResourceDuplicateName", + "kind": "interface", + "detail": "validResourceForInvalidExtensionResourceDuplicateName", + "deprecated": false, + "preselect": false, + "sortText": "2_validResourceForInvalidExtensionResourceDuplicateName", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "validResourceForInvalidExtensionResourceDuplicateName" + } + }, + { + "label": "wrongArrayType", + "kind": "interface", + "detail": "wrongArrayType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongArrayType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongArrayType" + } + }, + { + "label": "wrongLoopBodyType", + "kind": "interface", + "detail": "wrongLoopBodyType", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongLoopBodyType", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongLoopBodyType" + } + }, + { + "label": "wrongPropertyInNestedLoop", + "kind": "interface", + "detail": "wrongPropertyInNestedLoop", + "deprecated": false, + "preselect": false, + "sortText": "2_wrongPropertyInNestedLoop", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "wrongPropertyInNestedLoop" + } + } +] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelProperties.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelProperties.json index 3b3438222ca..50798b79962 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelProperties.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelProperties.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelPropertiesMinusName.json b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelPropertiesMinusName.json index ae501aca00f..9f8f8c4aac9 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelPropertiesMinusName.json +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/topLevelPropertiesMinusName.json @@ -5,7 +5,7 @@ "detail": "dependsOn", "documentation": { "kind": "markdown", - "value": "Type: `resource | module[]` \nWrite-only property \n" + "value": "Type: `(module[] | (resource | module) | resource[])[]` \nWrite-only property \n" }, "deprecated": false, "preselect": false, diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.bicep index 31a3c6f34ad..0fc55345b67 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.bicep @@ -900,59 +900,68 @@ resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for } }] -/* - valid loop cases - this should be moved to Resources_* test case after codegen works -*/ -var storageAccounts = [ - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' - } -] -// duplicate identifiers within the loop are allowed -resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { - name: 'vnet-${i}' - properties: { - subnets: [for i in range(0, 4): { - name: 'subnet-${i}-${i}' - }] +// property loops cannot be nested +resource propertyLoopsCannotNest 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' } -}] -// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) -var canHaveDuplicatesAcrossScopes = 'hello' -resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { - name: 'vnet-${canHaveDuplicatesAcrossScopes}' + kind: 'StorageV2' properties: { - subnets: [for i in range(0, 4): { - name: 'subnet-${i}-${i}' - }] + + networkAcls: { + virtualNetworkRules: [for rule in []: { + id: '${account.name}-${account.location}' + state: [for lol in []: 4] + }] + } } }] -// duplicate in global and multiple loop scopes are allowed (inner hides the outer) -var duplicatesEverywhere = 'hello' -resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { - name: 'vnet-${duplicatesEverywhere}' + +// property loops cannot be nested (even more nesting) +resource propertyLoopsCannotNest2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' properties: { - subnets: [for duplicatesEverywhere in range(0, 4): { - name: 'subnet-${duplicatesEverywhere}' - }] + // #completionTest(17) -> symbolsPlusAccount + networkAcls: { + virtualNetworkRules: [for rule in []: { + // #completionTest(12,15,31) -> symbolsPlusRule + id: '${account.name}-${account.location}' + state: [for state in []: { + // #completionTest(38) -> symbolsPlusAccountRuleStateSomething #completionTest(16,34) -> symbolsPlusAccountRuleState + fake: [for something in []: true] + }] + }] + } } }] -// just a storage account loop -resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + +// loops cannot be used inside of expressions +resource stuffs 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { name: account.name location: account.location sku: { name: 'Standard_LRS' } kind: 'StorageV2' + properties: { + networkAcls: { + virtualNetworkRules: concat([for lol in []: { + id: '${account.name}-${account.location}' + }]) + } + } }] + // using the same loop variable in a new language scope should be allowed resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + // #completionTest(7,8) -> symbolsPlusAccount2 name: account.name location: account.location sku: { @@ -961,13 +970,55 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a } kind: 'StorageV2' }] -// basic nested loop -resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + +var directRefViaVar = premiumStorages +output directRefViaOutput array = union(premiumStorages, stuffs) + +resource directRefViaSingleResourceBody 'Microsoft.Network/dnszones@2018-05-01' = { + name: 'myZone2' + location: 'global' + properties: { + registrationVirtualNetworks: premiumStorages + } +} + +resource directRefViaSingleConditionalResourceBody 'Microsoft.Network/dnszones@2018-05-01' = if(true) { + name: 'myZone3' + location: 'global' + properties: { + registrationVirtualNetworks: concat(premiumStorages, stuffs) + } +} + +resource directRefViaSingleLoopResourceBody 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: premiumStorages + } +}] + +resource directRefViaSingleLoopResourceBodyWithExtraDependsOn 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { name: 'vnet-${i}' properties: { - subnets: [for j in range(0, 4): { - // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties - name: 'subnet-${i}-${j}' - }] + subnets: premiumStorages + dependsOn: [ + premiumStorages + ] + } + dependsOn: [ + + ] +}] + +var expressionInPropertyLoopVar = true +resource expressionsInPropertyLoopName 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'hello' + location: 'eastus' + properties: { + 'resolutionVirtualNetworks${expressionInPropertyLoopVar}': [for thing in []: {}] } -}] \ No newline at end of file +} + +// resource loop body that isn't an object +resource nonObjectResourceLoopBody 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: 'test'] +resource nonObjectResourceLoopBody2 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: environment()] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.diagnostics.bicep index e7001bb8e16..7f029efb06f 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.diagnostics.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.diagnostics.bicep @@ -260,7 +260,7 @@ resource badDepends 'Microsoft.Foo/foos@2020-02-02-alpha' = { //@[8:14) [BCP121 (Error)] Resources: "baz", "badDepends", "badDepends2", "badDepends3", "badDepends4", "badDepends5", "badInterp" are defined with this same name in a file. Rename them or split into different modules. |'test'| dependsOn: [ baz.id -//@[4:10) [BCP034 (Error)] The enclosing array expected an item of type "resource | module", but the provided item was of type "string". |baz.id| +//@[4:10) [BCP034 (Error)] The enclosing array expected an item of type "module[] | (resource | module) | resource[]", but the provided item was of type "string". |baz.id| ] } @@ -270,9 +270,9 @@ resource badDepends2 'Microsoft.Foo/foos@2020-02-02-alpha' = { //@[8:14) [BCP121 (Error)] Resources: "baz", "badDepends", "badDepends2", "badDepends3", "badDepends4", "badDepends5", "badInterp" are defined with this same name in a file. Rename them or split into different modules. |'test'| dependsOn: [ 'hello' -//@[4:11) [BCP034 (Error)] The enclosing array expected an item of type "resource | module", but the provided item was of type "'hello'". |'hello'| +//@[4:11) [BCP034 (Error)] The enclosing array expected an item of type "module[] | (resource | module) | resource[]", but the provided item was of type "'hello'". |'hello'| true -//@[4:8) [BCP034 (Error)] The enclosing array expected an item of type "resource | module", but the provided item was of type "bool". |true| +//@[4:8) [BCP034 (Error)] The enclosing array expected an item of type "module[] | (resource | module) | resource[]", but the provided item was of type "bool". |true| ] } @@ -554,7 +554,6 @@ resource discriminatorKeyMissing_if 'Microsoft.Resources/deploymentScripts@2020- Discriminator key missing (loop) */ resource discriminatorKeyMissing_for 'Microsoft.Resources/deploymentScripts@2020-10-01' = [for thing in []: { -//@[91:94) [BCP138 (Error)] Loops are not currently supported. |for| //@[108:170) [BCP078 (Error)] The property "kind" requires a value of type "'AzureCLI' | 'AzurePowerShell'", but none was supplied. |{\r\n // #completionTest(0,1,2) -> discriminatorProperty\r\n \r\n}| // #completionTest(0,1,2) -> discriminatorProperty @@ -601,7 +600,6 @@ var discriminatorKeyValueMissingCompletions3_if = discriminatorKeyValueMissing_i Discriminator key value missing with property access (loops) */ resource discriminatorKeyValueMissing_for 'Microsoft.Resources/deploymentScripts@2020-10-01' = [for thing in []: { -//@[96:99) [BCP138 (Error)] Loops are not currently supported. |for| // #completionTest(7,8,9,10) -> deploymentScriptKindsPlusSymbols_for kind: //@[10:10) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. || @@ -609,6 +607,7 @@ resource discriminatorKeyValueMissing_for 'Microsoft.Resources/deploymentScripts // cannot . access properties of a resource loop var resourceListIsNotSingleResource = discriminatorKeyValueMissing_for.kind +//@[38:70) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |discriminatorKeyValueMissing_for| //@[71:75) [BCP055 (Error)] Cannot access properties of type "Microsoft.Resources/deploymentScripts@2020-10-01[]". An "object" type is required. |kind| // #completionTest(87) -> missingDiscriminatorPropertyAccess @@ -676,7 +675,6 @@ Discriminator value set 1 (loop) */ resource discriminatorKeySetOne_for 'Microsoft.Resources/deploymentScripts@2020-10-01' = [ for thing in []: { //@[9:35) [BCP035 (Error)] The specified "resource" declaration is missing the following required properties: "location", "name". |discriminatorKeySetOne_for| -//@[91:94) [BCP138 (Error)] Loops are not currently supported. |for| kind: 'AzureCLI' // #completionTest(0,1,2) -> deploymentScriptTopLevel @@ -758,7 +756,6 @@ Discriminator value set 2 (loops) */ resource discriminatorKeySetTwo_for 'Microsoft.Resources/deploymentScripts@2020-10-01' = [for thing in []: { //@[9:35) [BCP035 (Error)] The specified "resource" declaration is missing the following required properties: "location", "name". |discriminatorKeySetTwo_for| -//@[90:93) [BCP138 (Error)] Loops are not currently supported. |for| kind: 'AzurePowerShell' // #completionTest(0,1,2) -> deploymentScriptTopLevel @@ -903,7 +900,6 @@ var nestedDiscriminatorMissingKeyIndexCompletions_if = nestedDiscriminatorMissin Nested discriminator missing key (loop) */ resource nestedDiscriminatorMissingKey_for 'Microsoft.DocumentDB/databaseAccounts@2020-06-01-preview' = [for thing in []: { -//@[105:108) [BCP138 (Error)] Loops are not currently supported. |for| name: 'test' location: 'l' properties: { @@ -987,7 +983,6 @@ var nestedDiscriminatorArrayIndexCompletions_if = nestedDiscriminator_if.propert Nested discriminator (loop) */ resource nestedDiscriminator_for 'Microsoft.DocumentDB/databaseAccounts@2020-06-01-preview' = [for thing in []: { -//@[95:98) [BCP138 (Error)] Loops are not currently supported. |for| name: 'test' location: 'l' properties: { @@ -1125,61 +1120,50 @@ resource expectedForKeyword2 'Microsoft.Storage/storageAccounts@2019-06-01' = [f //@[79:80) [BCP012 (Error)] Expected the "for" keyword at this location. |f| resource expectedLoopVar 'Microsoft.Storage/storageAccounts@2019-06-01' = [for] -//@[75:78) [BCP138 (Error)] Loops are not currently supported. |for| //@[78:79) [BCP136 (Error)] Expected a loop variable identifier at this location. |]| resource expectedInKeyword 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x] -//@[77:80) [BCP138 (Error)] Loops are not currently supported. |for| //@[82:83) [BCP012 (Error)] Expected the "in" keyword at this location. |]| resource expectedInKeyword2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x b] -//@[78:81) [BCP138 (Error)] Loops are not currently supported. |for| //@[84:85) [BCP012 (Error)] Expected the "in" keyword at this location. |b| //@[85:86) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. |]| resource expectedArrayExpression 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x in] -//@[83:86) [BCP138 (Error)] Loops are not currently supported. |for| //@[91:92) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. |]| resource expectedColon 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x in y] -//@[73:76) [BCP138 (Error)] Loops are not currently supported. |for| //@[82:83) [BCP057 (Error)] The name "y" does not exist in the current context. |y| //@[83:84) [BCP018 (Error)] Expected the ":" character at this location. |]| resource expectedLoopBody 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x in y:] -//@[76:79) [BCP138 (Error)] Loops are not currently supported. |for| //@[85:86) [BCP057 (Error)] The name "y" does not exist in the current context. |y| -//@[87:88) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. |]| +//@[87:88) [BCP018 (Error)] Expected the "{" character at this location. |]| // loop semantic analysis cases var emptyArray = [] resource wrongLoopBodyType 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x in emptyArray:4] -//@[77:80) [BCP138 (Error)] Loops are not currently supported. |for| -//@[97:98) [BCP033 (Error)] Expected a value of type "Microsoft.Storage/storageAccounts" but the provided value is of type "int". |4| +//@[97:98) [BCP018 (Error)] Expected the "{" character at this location. |4| // errors in the array expression resource arrayExpressionErrors 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in union([], 2): { -//@[81:84) [BCP138 (Error)] Loops are not currently supported. |for| //@[106:107) [BCP070 (Error)] Argument of type "int" is not assignable to parameter of type "array". |2| }] // wrong array type var notAnArray = true resource wrongArrayType 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in notAnArray: { -//@[74:77) [BCP138 (Error)] Loops are not currently supported. |for| //@[89:99) [BCP137 (Error)] Loop expected an expression of type "array" but the provided value is of type "bool". |notAnArray| }] // missing required properties resource missingRequiredProperties 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in []: { //@[9:34) [BCP035 (Error)] The specified "resource" declaration is missing the following required properties: "kind", "location", "name", "sku". |missingRequiredProperties| -//@[85:88) [BCP138 (Error)] Loops are not currently supported. |for| }] // fewer missing required properties and a wrong property resource missingFewerRequiredProperties 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in []: { //@[9:39) [BCP035 (Error)] The specified "resource" declaration is missing the following required properties: "kind", "sku". |missingFewerRequiredProperties| -//@[90:93) [BCP138 (Error)] Loops are not currently supported. |for| name: account location: 'eastus42' properties: { @@ -1190,11 +1174,9 @@ resource missingFewerRequiredProperties 'Microsoft.Storage/storageAccounts@2019- // wrong property inside the nested property loop resource wrongPropertyInNestedLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[85:88) [BCP138 (Error)] Loops are not currently supported. |for| name: 'vnet-${i}' properties: { subnets: [for j in range(0, 4): { -//@[14:17) [BCP138 (Error)] Loops are not currently supported. |for| doesNotExist: 'test' //@[6:18) [BCP038 (Warning)] The property "doesNotExist" is not allowed on objects of type "Subnet". Permissible properties include "id", "properties". |doesNotExist| name: 'subnet-${i}-${j}' @@ -1204,13 +1186,11 @@ resource wrongPropertyInNestedLoop 'Microsoft.Network/virtualNetworks@2020-06-01 // nonexistent arrays and loop variables resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in notAThing: { -//@[77:80) [BCP138 (Error)] Loops are not currently supported. |for| //@[86:95) [BCP057 (Error)] The name "notAThing" does not exist in the current context. |notAThing| name: 'vnet-${justPlainWrong}' //@[16:30) [BCP057 (Error)] The name "justPlainWrong" does not exist in the current context. |justPlainWrong| properties: { subnets: [for j in alsoNotAThing: { -//@[14:17) [BCP138 (Error)] Loops are not currently supported. |for| //@[23:36) [BCP057 (Error)] The name "alsoNotAThing" does not exist in the current context. |alsoNotAThing| doesNotExist: 'test' name: 'subnet-${fake}-${totallyFake}' @@ -1220,67 +1200,76 @@ resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for } }] -/* - valid loop cases - this should be moved to Resources_* test case after codegen works -*/ -var storageAccounts = [ - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' +// property loops cannot be nested +resource propertyLoopsCannotNest 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[98:113) [BCP057 (Error)] The name "storageAccounts" does not exist in the current context. |storageAccounts| + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' } -] -// duplicate identifiers within the loop are allowed -resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[90:93) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'vnet-${i}' + kind: 'StorageV2' properties: { - subnets: [for i in range(0, 4): { -//@[14:17) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'subnet-${i}-${i}' - }] + + networkAcls: { + virtualNetworkRules: [for rule in []: { + id: '${account.name}-${account.location}' + state: [for lol in []: 4] +//@[16:19) [BCP142 (Error)] Property value for-expressions cannot be nested. |for| + }] + } } }] -// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) -var canHaveDuplicatesAcrossScopes = 'hello' -resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { -//@[87:90) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'vnet-${canHaveDuplicatesAcrossScopes}' - properties: { - subnets: [for i in range(0, 4): { -//@[14:17) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'subnet-${i}-${i}' - }] + +// property loops cannot be nested (even more nesting) +resource propertyLoopsCannotNest2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[99:114) [BCP057 (Error)] The name "storageAccounts" does not exist in the current context. |storageAccounts| + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' } -}] -// duplicate in global and multiple loop scopes are allowed (inner hides the outer) -var duplicatesEverywhere = 'hello' -resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { -//@[88:91) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'vnet-${duplicatesEverywhere}' + kind: 'StorageV2' properties: { - subnets: [for duplicatesEverywhere in range(0, 4): { -//@[14:17) [BCP138 (Error)] Loops are not currently supported. |for| - name: 'subnet-${duplicatesEverywhere}' - }] + // #completionTest(17) -> symbolsPlusAccount + networkAcls: { + virtualNetworkRules: [for rule in []: { + // #completionTest(12,15,31) -> symbolsPlusRule + id: '${account.name}-${account.location}' + state: [for state in []: { +//@[16:19) [BCP142 (Error)] Property value for-expressions cannot be nested. |for| + // #completionTest(38) -> symbolsPlusAccountRuleStateSomething #completionTest(16,34) -> symbolsPlusAccountRuleState + fake: [for something in []: true] +//@[17:20) [BCP142 (Error)] Property value for-expressions cannot be nested. |for| + }] + }] + } } }] -// just a storage account loop -resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { -//@[76:79) [BCP138 (Error)] Loops are not currently supported. |for| + +// loops cannot be used inside of expressions +resource stuffs 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[81:96) [BCP057 (Error)] The name "storageAccounts" does not exist in the current context. |storageAccounts| name: account.name location: account.location sku: { name: 'Standard_LRS' } kind: 'StorageV2' + properties: { + networkAcls: { + virtualNetworkRules: concat([for lol in []: { +//@[35:38) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| + id: '${account.name}-${account.location}' + }]) + } + } }] + // using the same loop variable in a new language scope should be allowed resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { -//@[75:78) [BCP138 (Error)] Loops are not currently supported. |for| +//@[90:105) [BCP057 (Error)] The name "storageAccounts" does not exist in the current context. |storageAccounts| + // #completionTest(7,8) -> symbolsPlusAccount2 name: account.name location: account.location sku: { @@ -1290,15 +1279,69 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a } kind: 'StorageV2' }] -// basic nested loop -resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[64:67) [BCP138 (Error)] Loops are not currently supported. |for| + +var directRefViaVar = premiumStorages +//@[22:37) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| +output directRefViaOutput array = union(premiumStorages, stuffs) +//@[40:55) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| +//@[57:63) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |stuffs| + +resource directRefViaSingleResourceBody 'Microsoft.Network/dnszones@2018-05-01' = { + name: 'myZone2' + location: 'global' + properties: { + registrationVirtualNetworks: premiumStorages +//@[33:48) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| + } +} + +resource directRefViaSingleConditionalResourceBody 'Microsoft.Network/dnszones@2018-05-01' = if(true) { + name: 'myZone3' + location: 'global' + properties: { + registrationVirtualNetworks: concat(premiumStorages, stuffs) +//@[40:55) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| +//@[57:63) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |stuffs| + } +} + +resource directRefViaSingleLoopResourceBody 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { name: 'vnet-${i}' properties: { - subnets: [for j in range(0, 4): { -//@[14:17) [BCP138 (Error)] Loops are not currently supported. |for| - // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties - name: 'subnet-${i}-${j}' - }] + subnets: premiumStorages +//@[13:28) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| } }] + +resource directRefViaSingleLoopResourceBodyWithExtraDependsOn 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: premiumStorages +//@[13:28) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| + dependsOn: [ +//@[4:13) [BCP038 (Warning)] The property "dependsOn" is not allowed on objects of type "VirtualNetworkPropertiesFormat". Permissible properties include "addressSpace", "bgpCommunities", "ddosProtectionPlan", "dhcpOptions", "enableDdosProtection", "enableVmProtection", "ipAllocations", "virtualNetworkPeerings". |dependsOn| + premiumStorages +//@[6:21) [BCP144 (Error)] Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression. |premiumStorages| + ] + } + dependsOn: [ + + ] +}] + +var expressionInPropertyLoopVar = true +resource expressionsInPropertyLoopName 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'hello' + location: 'eastus' + properties: { + 'resolutionVirtualNetworks${expressionInPropertyLoopVar}': [for thing in []: {}] +//@[4:61) [BCP040 (Warning)] String interpolation is not supported for keys on objects of type "ZoneProperties". Permissible properties include "registrationVirtualNetworks", "resolutionVirtualNetworks", "zoneType". |'resolutionVirtualNetworks${expressionInPropertyLoopVar}'| +//@[4:61) [BCP143 (Error)] For-expressions cannot be used with properties whose names are also expressions. |'resolutionVirtualNetworks${expressionInPropertyLoopVar}'| + } +} + +// resource loop body that isn't an object +resource nonObjectResourceLoopBody 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: 'test'] +//@[95:101) [BCP018 (Error)] Expected the "{" character at this location. |'test'| +resource nonObjectResourceLoopBody2 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: environment()] +//@[96:107) [BCP018 (Error)] Expected the "{" character at this location. |environment| diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.formatted.bicep index f132762ae1a..7f79ac16106 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.formatted.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.formatted.bicep @@ -820,7 +820,7 @@ resource expectedLoopBody 'Microsoft.Storage/storageAccounts@2019-06-01' = [for // loop semantic analysis cases var emptyArray = [] -resource wrongLoopBodyType 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x in emptyArray: 4] +resource wrongLoopBodyType 'Microsoft.Storage/storageAccounts@2019-06-01' = [for x in emptyArray:4] // errors in the array expression resource arrayExpressionErrors 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in union([], 2): {}] @@ -863,59 +863,67 @@ resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for } }] -/* - valid loop cases - this should be moved to Resources_* test case after codegen works -*/ -var storageAccounts = [ - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' - } -] -// duplicate identifiers within the loop are allowed -resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { - name: 'vnet-${i}' - properties: { - subnets: [for i in range(0, 4): { - name: 'subnet-${i}-${i}' - }] +// property loops cannot be nested +resource propertyLoopsCannotNest 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' } -}] -// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) -var canHaveDuplicatesAcrossScopes = 'hello' -resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { - name: 'vnet-${canHaveDuplicatesAcrossScopes}' + kind: 'StorageV2' properties: { - subnets: [for i in range(0, 4): { - name: 'subnet-${i}-${i}' - }] + networkAcls: { + virtualNetworkRules: [for rule in []: { + id: '${account.name}-${account.location}' + state: [for lol in []: 4] + }] + } } }] -// duplicate in global and multiple loop scopes are allowed (inner hides the outer) -var duplicatesEverywhere = 'hello' -resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { - name: 'vnet-${duplicatesEverywhere}' + +// property loops cannot be nested (even more nesting) +resource propertyLoopsCannotNest2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' properties: { - subnets: [for duplicatesEverywhere in range(0, 4): { - name: 'subnet-${duplicatesEverywhere}' - }] + // #completionTest(17) -> symbolsPlusAccount + networkAcls: { + virtualNetworkRules: [for rule in []: { + // #completionTest(12,15,31) -> symbolsPlusRule + id: '${account.name}-${account.location}' + state: [for state in []: { + // #completionTest(38) -> symbolsPlusAccountRuleStateSomething #completionTest(16,34) -> symbolsPlusAccountRuleState + fake: [for something in []: true] + }] + }] + } } }] -// just a storage account loop -resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + +// loops cannot be used inside of expressions +resource stuffs 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { name: account.name location: account.location sku: { name: 'Standard_LRS' } kind: 'StorageV2' + properties: { + networkAcls: { + virtualNetworkRules: concat([for lol in []: { + id: '${account.name}-${account.location}' + }]) + } + } }] + // using the same loop variable in a new language scope should be allowed resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + // #completionTest(7,8) -> symbolsPlusAccount2 name: account.name location: account.location sku: { @@ -924,13 +932,53 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a } kind: 'StorageV2' }] -// basic nested loop -resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + +var directRefViaVar = premiumStorages +output directRefViaOutput array = union(premiumStorages, stuffs) + +resource directRefViaSingleResourceBody 'Microsoft.Network/dnszones@2018-05-01' = { + name: 'myZone2' + location: 'global' + properties: { + registrationVirtualNetworks: premiumStorages + } +} + +resource directRefViaSingleConditionalResourceBody 'Microsoft.Network/dnszones@2018-05-01' = if (true) { + name: 'myZone3' + location: 'global' + properties: { + registrationVirtualNetworks: concat(premiumStorages, stuffs) + } +} + +resource directRefViaSingleLoopResourceBody 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { name: 'vnet-${i}' properties: { - subnets: [for j in range(0, 4): { - // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties - name: 'subnet-${i}-${j}' - }] + subnets: premiumStorages } }] + +resource directRefViaSingleLoopResourceBodyWithExtraDependsOn 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: premiumStorages + dependsOn: [ + premiumStorages + ] + } + dependsOn: [] +}] + +var expressionInPropertyLoopVar = true +resource expressionsInPropertyLoopName 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'hello' + location: 'eastus' + properties: { + 'resolutionVirtualNetworks${expressionInPropertyLoopVar}': [for thing in []: {}] + } +} + +// resource loop body that isn't an object +resource nonObjectResourceLoopBody 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: 'test'] +resource nonObjectResourceLoopBody2 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: environment()] diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.symbols.bicep index 83cbd1348c7..76d8424aa39 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.symbols.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.symbols.bicep @@ -1089,12 +1089,12 @@ resource missingFewerRequiredProperties 'Microsoft.Storage/storageAccounts@2019- // wrong property inside the nested property loop resource wrongPropertyInNestedLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[89:90) Local i. Type: any. Declaration start char: 89, length: 1 +//@[89:90) Local i. Type: int. Declaration start char: 89, length: 1 //@[9:34) Resource wrongPropertyInNestedLoop. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 262 name: 'vnet-${i}' properties: { subnets: [for j in range(0, 4): { -//@[18:19) Local j. Type: any. Declaration start char: 18, length: 1 +//@[18:19) Local j. Type: int. Declaration start char: 18, length: 1 doesNotExist: 'test' name: 'subnet-${i}-${j}' }] @@ -1115,75 +1115,82 @@ resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for } }] -/* - valid loop cases - this should be moved to Resources_* test case after codegen works -*/ -var storageAccounts = [ -//@[4:19) Variable storageAccounts. Type: array. Declaration start char: 0, length: 129 - { - name: 'one' - location: 'eastus2' - } - { - name: 'two' - location: 'westus' +// property loops cannot be nested +resource propertyLoopsCannotNest 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[87:94) Local account. Type: any. Declaration start char: 87, length: 7 +//@[9:32) Resource propertyLoopsCannotNest. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 428 + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' } -] -// duplicate identifiers within the loop are allowed -resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[94:95) Local i. Type: any. Declaration start char: 94, length: 1 -//@[9:39) Resource duplicateIdentifiersWithinLoop. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 239 - name: 'vnet-${i}' + kind: 'StorageV2' properties: { - subnets: [for i in range(0, 4): { -//@[18:19) Local i. Type: any. Declaration start char: 18, length: 1 - name: 'subnet-${i}-${i}' - }] + + networkAcls: { + virtualNetworkRules: [for rule in []: { +//@[32:36) Local rule. Type: any. Declaration start char: 32, length: 4 + id: '${account.name}-${account.location}' + state: [for lol in []: 4] +//@[20:23) Local lol. Type: any. Declaration start char: 20, length: 3 + }] + } } }] -// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) -var canHaveDuplicatesAcrossScopes = 'hello' -//@[4:33) Variable canHaveDuplicatesAcrossScopes. Type: 'hello'. Declaration start char: 0, length: 43 -resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { -//@[91:120) Local canHaveDuplicatesAcrossScopes. Type: any. Declaration start char: 91, length: 29 -//@[9:36) Resource duplicateInGlobalAndOneLoop. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 292 - name: 'vnet-${canHaveDuplicatesAcrossScopes}' - properties: { - subnets: [for i in range(0, 4): { -//@[18:19) Local i. Type: any. Declaration start char: 18, length: 1 - name: 'subnet-${i}-${i}' - }] + +// property loops cannot be nested (even more nesting) +resource propertyLoopsCannotNest2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[88:95) Local account. Type: any. Declaration start char: 88, length: 7 +//@[9:33) Resource propertyLoopsCannotNest2. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 720 + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' } -}] -// duplicate in global and multiple loop scopes are allowed (inner hides the outer) -var duplicatesEverywhere = 'hello' -//@[4:24) Variable duplicatesEverywhere. Type: 'hello'. Declaration start char: 0, length: 34 -resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { -//@[92:112) Local duplicatesEverywhere. Type: any. Declaration start char: 92, length: 20 -//@[9:37) Resource duplicateInGlobalAndTwoLoops. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 308 - name: 'vnet-${duplicatesEverywhere}' + kind: 'StorageV2' properties: { - subnets: [for duplicatesEverywhere in range(0, 4): { -//@[18:38) Local duplicatesEverywhere. Type: any. Declaration start char: 18, length: 20 - name: 'subnet-${duplicatesEverywhere}' - }] + // #completionTest(17) -> symbolsPlusAccount + networkAcls: { + virtualNetworkRules: [for rule in []: { +//@[32:36) Local rule. Type: any. Declaration start char: 32, length: 4 + // #completionTest(12,15,31) -> symbolsPlusRule + id: '${account.name}-${account.location}' + state: [for state in []: { +//@[20:25) Local state. Type: any. Declaration start char: 20, length: 5 + // #completionTest(38) -> symbolsPlusAccountRuleStateSomething #completionTest(16,34) -> symbolsPlusAccountRuleState + fake: [for something in []: true] +//@[21:30) Local something. Type: any. Declaration start char: 21, length: 9 + }] + }] + } } }] -// just a storage account loop -resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { -//@[80:87) Local account. Type: any. Declaration start char: 80, length: 7 -//@[9:25) Resource storageResources. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 227 + +// loops cannot be used inside of expressions +resource stuffs 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[70:77) Local account. Type: any. Declaration start char: 70, length: 7 +//@[9:15) Resource stuffs. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 381 name: account.name location: account.location sku: { name: 'Standard_LRS' } kind: 'StorageV2' + properties: { + networkAcls: { + virtualNetworkRules: concat([for lol in []: { +//@[39:42) Local lol. Type: any. Declaration start char: 39, length: 3 + id: '${account.name}-${account.location}' + }]) + } + } }] + // using the same loop variable in a new language scope should be allowed resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { //@[79:86) Local account. Type: any. Declaration start char: 79, length: 7 -//@[9:24) Resource premiumStorages. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 271 +//@[9:24) Resource premiumStorages. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 321 + // #completionTest(7,8) -> symbolsPlusAccount2 name: account.name location: account.location sku: { @@ -1192,16 +1199,70 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a } kind: 'StorageV2' }] -// basic nested loop -resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[68:69) Local i. Type: any. Declaration start char: 68, length: 1 -//@[9:13) Resource vnet. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 279 + +var directRefViaVar = premiumStorages +//@[4:19) Variable directRefViaVar. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 37 +output directRefViaOutput array = union(premiumStorages, stuffs) +//@[7:25) Output directRefViaOutput. Type: array. Declaration start char: 0, length: 64 + +resource directRefViaSingleResourceBody 'Microsoft.Network/dnszones@2018-05-01' = { +//@[9:39) Resource directRefViaSingleResourceBody. Type: Microsoft.Network/dnsZones@2018-05-01. Declaration start char: 0, length: 199 + name: 'myZone2' + location: 'global' + properties: { + registrationVirtualNetworks: premiumStorages + } +} + +resource directRefViaSingleConditionalResourceBody 'Microsoft.Network/dnszones@2018-05-01' = if(true) { +//@[9:50) Resource directRefViaSingleConditionalResourceBody. Type: Microsoft.Network/dnsZones@2018-05-01. Declaration start char: 0, length: 235 + name: 'myZone3' + location: 'global' + properties: { + registrationVirtualNetworks: concat(premiumStorages, stuffs) + } +} + +resource directRefViaSingleLoopResourceBody 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[98:99) Local i. Type: int. Declaration start char: 98, length: 1 +//@[9:43) Resource directRefViaSingleLoopResourceBody. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 194 name: 'vnet-${i}' properties: { - subnets: [for j in range(0, 4): { -//@[18:19) Local j. Type: any. Declaration start char: 18, length: 1 - // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties - name: 'subnet-${i}-${j}' - }] + subnets: premiumStorages + } +}] + +resource directRefViaSingleLoopResourceBodyWithExtraDependsOn 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[116:117) Local i. Type: int. Declaration start char: 116, length: 1 +//@[9:61) Resource directRefViaSingleLoopResourceBodyWithExtraDependsOn. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 287 + name: 'vnet-${i}' + properties: { + subnets: premiumStorages + dependsOn: [ + premiumStorages + ] } + dependsOn: [ + + ] }] + +var expressionInPropertyLoopVar = true +//@[4:31) Variable expressionInPropertyLoopVar. Type: bool. Declaration start char: 0, length: 38 +resource expressionsInPropertyLoopName 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[9:38) Resource expressionsInPropertyLoopName. Type: Microsoft.Network/dnsZones@2018-05-01. Declaration start char: 0, length: 232 + name: 'hello' + location: 'eastus' + properties: { + 'resolutionVirtualNetworks${expressionInPropertyLoopVar}': [for thing in []: {}] +//@[68:73) Local thing. Type: any. Declaration start char: 68, length: 5 + } +} + +// resource loop body that isn't an object +resource nonObjectResourceLoopBody 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: 'test'] +//@[82:87) Local thing. Type: any. Declaration start char: 82, length: 5 +//@[9:34) Resource nonObjectResourceLoopBody. Type: Microsoft.Network/dnsZones@2018-05-01[]. Declaration start char: 0, length: 102 +resource nonObjectResourceLoopBody2 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: environment()] +//@[83:88) Local thing. Type: any. Declaration start char: 83, length: 5 +//@[9:35) Resource nonObjectResourceLoopBody2. Type: Microsoft.Network/dnsZones@2018-05-01[]. Declaration start char: 0, length: 110 diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.syntax.bicep index c7cd63364fc..c3c0a067fbd 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.syntax.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.syntax.bicep @@ -5759,7 +5759,7 @@ resource wrongLoopBodyType 'Microsoft.Storage/storageAccounts@2019-06-01' = [for //@[86:96) IdentifierSyntax //@[86:96) Identifier |emptyArray| //@[96:97) Colon |:| -//@[97:98) IntegerLiteralSyntax +//@[97:98) SkippedTriviaSyntax //@[97:98) Integer |4| //@[98:99) RightSquare |]| //@[99:103) NewLine |\r\n\r\n| @@ -6151,432 +6151,402 @@ resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for //@[1:2) RightSquare |]| //@[2:6) NewLine |\r\n\r\n| -/* - valid loop cases - this should be moved to Resources_* test case after codegen works -*/ -//@[3:5) NewLine |\r\n| -var storageAccounts = [ -//@[0:129) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:19) IdentifierSyntax -//@[4:19) Identifier |storageAccounts| -//@[20:21) Assignment |=| -//@[22:129) ArraySyntax -//@[22:23) LeftSquare |[| -//@[23:25) NewLine |\r\n| - { -//@[2:50) ArrayItemSyntax -//@[2:50) ObjectSyntax -//@[2:3) LeftBrace |{| -//@[3:5) NewLine |\r\n| - name: 'one' -//@[4:15) ObjectPropertySyntax -//@[4:8) IdentifierSyntax -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringSyntax -//@[10:15) StringComplete |'one'| -//@[15:17) NewLine |\r\n| - location: 'eastus2' -//@[4:23) ObjectPropertySyntax -//@[4:12) IdentifierSyntax -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:23) StringSyntax -//@[14:23) StringComplete |'eastus2'| -//@[23:25) NewLine |\r\n| - } -//@[2:3) RightBrace |}| -//@[3:5) NewLine |\r\n| - { -//@[2:49) ArrayItemSyntax -//@[2:49) ObjectSyntax -//@[2:3) LeftBrace |{| -//@[3:5) NewLine |\r\n| - name: 'two' -//@[4:15) ObjectPropertySyntax -//@[4:8) IdentifierSyntax -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringSyntax -//@[10:15) StringComplete |'two'| -//@[15:17) NewLine |\r\n| - location: 'westus' -//@[4:22) ObjectPropertySyntax -//@[4:12) IdentifierSyntax -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:22) StringSyntax -//@[14:22) StringComplete |'westus'| -//@[22:24) NewLine |\r\n| - } -//@[2:3) RightBrace |}| -//@[3:5) NewLine |\r\n| -] -//@[0:1) RightSquare |]| -//@[1:3) NewLine |\r\n| -// duplicate identifiers within the loop are allowed -//@[52:54) NewLine |\r\n| -resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[0:239) ResourceDeclarationSyntax +// property loops cannot be nested +//@[34:36) NewLine |\r\n| +resource propertyLoopsCannotNest 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[0:428) ResourceDeclarationSyntax //@[0:8) Identifier |resource| -//@[9:39) IdentifierSyntax -//@[9:39) Identifier |duplicateIdentifiersWithinLoop| -//@[40:86) StringSyntax -//@[40:86) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[87:88) Assignment |=| -//@[89:239) ForSyntax -//@[89:90) LeftSquare |[| -//@[90:93) Identifier |for| -//@[94:95) LocalVariableSyntax -//@[94:95) IdentifierSyntax -//@[94:95) Identifier |i| -//@[96:98) Identifier |in| -//@[99:110) FunctionCallSyntax -//@[99:104) IdentifierSyntax -//@[99:104) Identifier |range| -//@[104:105) LeftParen |(| -//@[105:107) FunctionArgumentSyntax -//@[105:106) IntegerLiteralSyntax -//@[105:106) Integer |0| -//@[106:107) Comma |,| -//@[108:109) FunctionArgumentSyntax -//@[108:109) IntegerLiteralSyntax -//@[108:109) Integer |3| -//@[109:110) RightParen |)| -//@[110:111) Colon |:| -//@[112:238) ObjectSyntax -//@[112:113) LeftBrace |{| -//@[113:115) NewLine |\r\n| - name: 'vnet-${i}' -//@[2:19) ObjectPropertySyntax +//@[9:32) IdentifierSyntax +//@[9:32) Identifier |propertyLoopsCannotNest| +//@[33:79) StringSyntax +//@[33:79) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[80:81) Assignment |=| +//@[82:428) ForSyntax +//@[82:83) LeftSquare |[| +//@[83:86) Identifier |for| +//@[87:94) LocalVariableSyntax +//@[87:94) IdentifierSyntax +//@[87:94) Identifier |account| +//@[95:97) Identifier |in| +//@[98:113) VariableAccessSyntax +//@[98:113) IdentifierSyntax +//@[98:113) Identifier |storageAccounts| +//@[113:114) Colon |:| +//@[115:427) ObjectSyntax +//@[115:116) LeftBrace |{| +//@[116:118) NewLine |\r\n| + name: account.name +//@[2:20) ObjectPropertySyntax //@[2:6) IdentifierSyntax //@[2:6) Identifier |name| //@[6:7) Colon |:| +//@[8:20) PropertyAccessSyntax +//@[8:15) VariableAccessSyntax +//@[8:15) IdentifierSyntax +//@[8:15) Identifier |account| +//@[15:16) Dot |.| +//@[16:20) IdentifierSyntax +//@[16:20) Identifier |name| +//@[20:22) NewLine |\r\n| + location: account.location +//@[2:28) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:28) PropertyAccessSyntax +//@[12:19) VariableAccessSyntax +//@[12:19) IdentifierSyntax +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) IdentifierSyntax +//@[20:28) Identifier |location| +//@[28:30) NewLine |\r\n| + sku: { +//@[2:39) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:39) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:10) NewLine |\r\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:26) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| //@[8:19) StringSyntax -//@[8:16) StringLeftPiece |'vnet-${| -//@[16:17) VariableAccessSyntax -//@[16:17) IdentifierSyntax -//@[16:17) Identifier |i| -//@[17:19) StringRightPiece |}'| +//@[8:19) StringComplete |'StorageV2'| //@[19:21) NewLine |\r\n| properties: { -//@[2:99) ObjectPropertySyntax +//@[2:192) ObjectPropertySyntax //@[2:12) IdentifierSyntax //@[2:12) Identifier |properties| //@[12:13) Colon |:| -//@[14:99) ObjectSyntax +//@[14:192) ObjectSyntax //@[14:15) LeftBrace |{| -//@[15:17) NewLine |\r\n| - subnets: [for i in range(0, 4): { -//@[4:77) ObjectPropertySyntax -//@[4:11) IdentifierSyntax -//@[4:11) Identifier |subnets| -//@[11:12) Colon |:| -//@[13:77) ForSyntax -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:19) LocalVariableSyntax -//@[18:19) IdentifierSyntax -//@[18:19) Identifier |i| -//@[20:22) Identifier |in| -//@[23:34) FunctionCallSyntax -//@[23:28) IdentifierSyntax -//@[23:28) Identifier |range| -//@[28:29) LeftParen |(| -//@[29:31) FunctionArgumentSyntax -//@[29:30) IntegerLiteralSyntax -//@[29:30) Integer |0| -//@[30:31) Comma |,| -//@[32:33) FunctionArgumentSyntax -//@[32:33) IntegerLiteralSyntax -//@[32:33) Integer |4| -//@[33:34) RightParen |)| -//@[34:35) Colon |:| -//@[36:76) ObjectSyntax -//@[36:37) LeftBrace |{| -//@[37:39) NewLine |\r\n| - name: 'subnet-${i}-${i}' -//@[6:30) ObjectPropertySyntax -//@[6:10) IdentifierSyntax -//@[6:10) Identifier |name| -//@[10:11) Colon |:| -//@[12:30) StringSyntax -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:23) VariableAccessSyntax -//@[22:23) IdentifierSyntax -//@[22:23) Identifier |i| -//@[23:27) StringMiddlePiece |}-${| -//@[27:28) VariableAccessSyntax -//@[27:28) IdentifierSyntax -//@[27:28) Identifier |i| -//@[28:30) StringRightPiece |}'| -//@[30:32) NewLine |\r\n| - }] -//@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[15:19) NewLine |\r\n\r\n| + + networkAcls: { +//@[4:168) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |networkAcls| +//@[15:16) Colon |:| +//@[17:168) ObjectSyntax +//@[17:18) LeftBrace |{| +//@[18:20) NewLine |\r\n| + virtualNetworkRules: [for rule in []: { +//@[6:141) ObjectPropertySyntax +//@[6:25) IdentifierSyntax +//@[6:25) Identifier |virtualNetworkRules| +//@[25:26) Colon |:| +//@[27:141) ForSyntax +//@[27:28) LeftSquare |[| +//@[28:31) Identifier |for| +//@[32:36) LocalVariableSyntax +//@[32:36) IdentifierSyntax +//@[32:36) Identifier |rule| +//@[37:39) Identifier |in| +//@[40:42) ArraySyntax +//@[40:41) LeftSquare |[| +//@[41:42) RightSquare |]| +//@[42:43) Colon |:| +//@[44:140) ObjectSyntax +//@[44:45) LeftBrace |{| +//@[45:47) NewLine |\r\n| + id: '${account.name}-${account.location}' +//@[8:49) ObjectPropertySyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:49) StringSyntax +//@[12:15) StringLeftPiece |'${| +//@[15:27) PropertyAccessSyntax +//@[15:22) VariableAccessSyntax +//@[15:22) IdentifierSyntax +//@[15:22) Identifier |account| +//@[22:23) Dot |.| +//@[23:27) IdentifierSyntax +//@[23:27) Identifier |name| +//@[27:31) StringMiddlePiece |}-${| +//@[31:47) PropertyAccessSyntax +//@[31:38) VariableAccessSyntax +//@[31:38) IdentifierSyntax +//@[31:38) Identifier |account| +//@[38:39) Dot |.| +//@[39:47) IdentifierSyntax +//@[39:47) Identifier |location| +//@[47:49) StringRightPiece |}'| +//@[49:51) NewLine |\r\n| + state: [for lol in []: 4] +//@[8:33) ObjectPropertySyntax +//@[8:13) IdentifierSyntax +//@[8:13) Identifier |state| +//@[13:14) Colon |:| +//@[15:33) ForSyntax +//@[15:16) LeftSquare |[| +//@[16:19) Identifier |for| +//@[20:23) LocalVariableSyntax +//@[20:23) IdentifierSyntax +//@[20:23) Identifier |lol| +//@[24:26) Identifier |in| +//@[27:29) ArraySyntax +//@[27:28) LeftSquare |[| +//@[28:29) RightSquare |]| +//@[29:30) Colon |:| +//@[31:32) IntegerLiteralSyntax +//@[31:32) Integer |4| +//@[32:33) RightSquare |]| +//@[33:35) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) -//@[100:102) NewLine |\r\n| -var canHaveDuplicatesAcrossScopes = 'hello' -//@[0:43) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:33) IdentifierSyntax -//@[4:33) Identifier |canHaveDuplicatesAcrossScopes| -//@[34:35) Assignment |=| -//@[36:43) StringSyntax -//@[36:43) StringComplete |'hello'| -//@[43:45) NewLine |\r\n| -resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { -//@[0:292) ResourceDeclarationSyntax +//@[2:6) NewLine |\r\n\r\n| + +// property loops cannot be nested (even more nesting) +//@[54:56) NewLine |\r\n| +resource propertyLoopsCannotNest2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[0:720) ResourceDeclarationSyntax //@[0:8) Identifier |resource| -//@[9:36) IdentifierSyntax -//@[9:36) Identifier |duplicateInGlobalAndOneLoop| -//@[37:83) StringSyntax -//@[37:83) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[84:85) Assignment |=| -//@[86:292) ForSyntax -//@[86:87) LeftSquare |[| -//@[87:90) Identifier |for| -//@[91:120) LocalVariableSyntax -//@[91:120) IdentifierSyntax -//@[91:120) Identifier |canHaveDuplicatesAcrossScopes| -//@[121:123) Identifier |in| -//@[124:135) FunctionCallSyntax -//@[124:129) IdentifierSyntax -//@[124:129) Identifier |range| -//@[129:130) LeftParen |(| -//@[130:132) FunctionArgumentSyntax -//@[130:131) IntegerLiteralSyntax -//@[130:131) Integer |0| -//@[131:132) Comma |,| -//@[133:134) FunctionArgumentSyntax -//@[133:134) IntegerLiteralSyntax -//@[133:134) Integer |3| -//@[134:135) RightParen |)| -//@[135:136) Colon |:| -//@[137:291) ObjectSyntax -//@[137:138) LeftBrace |{| -//@[138:140) NewLine |\r\n| - name: 'vnet-${canHaveDuplicatesAcrossScopes}' -//@[2:47) ObjectPropertySyntax +//@[9:33) IdentifierSyntax +//@[9:33) Identifier |propertyLoopsCannotNest2| +//@[34:80) StringSyntax +//@[34:80) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[81:82) Assignment |=| +//@[83:720) ForSyntax +//@[83:84) LeftSquare |[| +//@[84:87) Identifier |for| +//@[88:95) LocalVariableSyntax +//@[88:95) IdentifierSyntax +//@[88:95) Identifier |account| +//@[96:98) Identifier |in| +//@[99:114) VariableAccessSyntax +//@[99:114) IdentifierSyntax +//@[99:114) Identifier |storageAccounts| +//@[114:115) Colon |:| +//@[116:719) ObjectSyntax +//@[116:117) LeftBrace |{| +//@[117:119) NewLine |\r\n| + name: account.name +//@[2:20) ObjectPropertySyntax //@[2:6) IdentifierSyntax //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:47) StringSyntax -//@[8:16) StringLeftPiece |'vnet-${| -//@[16:45) VariableAccessSyntax -//@[16:45) IdentifierSyntax -//@[16:45) Identifier |canHaveDuplicatesAcrossScopes| -//@[45:47) StringRightPiece |}'| -//@[47:49) NewLine |\r\n| - properties: { -//@[2:99) ObjectPropertySyntax -//@[2:12) IdentifierSyntax -//@[2:12) Identifier |properties| -//@[12:13) Colon |:| -//@[14:99) ObjectSyntax -//@[14:15) LeftBrace |{| -//@[15:17) NewLine |\r\n| - subnets: [for i in range(0, 4): { -//@[4:77) ObjectPropertySyntax -//@[4:11) IdentifierSyntax -//@[4:11) Identifier |subnets| -//@[11:12) Colon |:| -//@[13:77) ForSyntax -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:19) LocalVariableSyntax -//@[18:19) IdentifierSyntax -//@[18:19) Identifier |i| -//@[20:22) Identifier |in| -//@[23:34) FunctionCallSyntax -//@[23:28) IdentifierSyntax -//@[23:28) Identifier |range| -//@[28:29) LeftParen |(| -//@[29:31) FunctionArgumentSyntax -//@[29:30) IntegerLiteralSyntax -//@[29:30) Integer |0| -//@[30:31) Comma |,| -//@[32:33) FunctionArgumentSyntax -//@[32:33) IntegerLiteralSyntax -//@[32:33) Integer |4| -//@[33:34) RightParen |)| -//@[34:35) Colon |:| -//@[36:76) ObjectSyntax -//@[36:37) LeftBrace |{| -//@[37:39) NewLine |\r\n| - name: 'subnet-${i}-${i}' -//@[6:30) ObjectPropertySyntax -//@[6:10) IdentifierSyntax -//@[6:10) Identifier |name| -//@[10:11) Colon |:| -//@[12:30) StringSyntax -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:23) VariableAccessSyntax -//@[22:23) IdentifierSyntax -//@[22:23) Identifier |i| -//@[23:27) StringMiddlePiece |}-${| -//@[27:28) VariableAccessSyntax -//@[27:28) IdentifierSyntax -//@[27:28) Identifier |i| -//@[28:30) StringRightPiece |}'| -//@[30:32) NewLine |\r\n| - }] -//@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[8:20) PropertyAccessSyntax +//@[8:15) VariableAccessSyntax +//@[8:15) IdentifierSyntax +//@[8:15) Identifier |account| +//@[15:16) Dot |.| +//@[16:20) IdentifierSyntax +//@[16:20) Identifier |name| +//@[20:22) NewLine |\r\n| + location: account.location +//@[2:28) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:28) PropertyAccessSyntax +//@[12:19) VariableAccessSyntax +//@[12:19) IdentifierSyntax +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) IdentifierSyntax +//@[20:28) Identifier |location| +//@[28:30) NewLine |\r\n| + sku: { +//@[2:39) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:39) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:10) NewLine |\r\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:26) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| -}] -//@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// duplicate in global and multiple loop scopes are allowed (inner hides the outer) -//@[83:85) NewLine |\r\n| -var duplicatesEverywhere = 'hello' -//@[0:34) VariableDeclarationSyntax -//@[0:3) Identifier |var| -//@[4:24) IdentifierSyntax -//@[4:24) Identifier |duplicatesEverywhere| -//@[25:26) Assignment |=| -//@[27:34) StringSyntax -//@[27:34) StringComplete |'hello'| -//@[34:36) NewLine |\r\n| -resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { -//@[0:308) ResourceDeclarationSyntax -//@[0:8) Identifier |resource| -//@[9:37) IdentifierSyntax -//@[9:37) Identifier |duplicateInGlobalAndTwoLoops| -//@[38:84) StringSyntax -//@[38:84) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[85:86) Assignment |=| -//@[87:308) ForSyntax -//@[87:88) LeftSquare |[| -//@[88:91) Identifier |for| -//@[92:112) LocalVariableSyntax -//@[92:112) IdentifierSyntax -//@[92:112) Identifier |duplicatesEverywhere| -//@[113:115) Identifier |in| -//@[116:127) FunctionCallSyntax -//@[116:121) IdentifierSyntax -//@[116:121) Identifier |range| -//@[121:122) LeftParen |(| -//@[122:124) FunctionArgumentSyntax -//@[122:123) IntegerLiteralSyntax -//@[122:123) Integer |0| -//@[123:124) Comma |,| -//@[125:126) FunctionArgumentSyntax -//@[125:126) IntegerLiteralSyntax -//@[125:126) Integer |3| -//@[126:127) RightParen |)| -//@[127:128) Colon |:| -//@[129:307) ObjectSyntax -//@[129:130) LeftBrace |{| -//@[130:132) NewLine |\r\n| - name: 'vnet-${duplicatesEverywhere}' -//@[2:38) ObjectPropertySyntax + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax //@[2:6) IdentifierSyntax -//@[2:6) Identifier |name| +//@[2:6) Identifier |kind| //@[6:7) Colon |:| -//@[8:38) StringSyntax -//@[8:16) StringLeftPiece |'vnet-${| -//@[16:36) VariableAccessSyntax -//@[16:36) IdentifierSyntax -//@[16:36) Identifier |duplicatesEverywhere| -//@[36:38) StringRightPiece |}'| -//@[38:40) NewLine |\r\n| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:21) NewLine |\r\n| properties: { -//@[2:132) ObjectPropertySyntax +//@[2:483) ObjectPropertySyntax //@[2:12) IdentifierSyntax //@[2:12) Identifier |properties| //@[12:13) Colon |:| -//@[14:132) ObjectSyntax +//@[14:483) ObjectSyntax //@[14:15) LeftBrace |{| //@[15:17) NewLine |\r\n| - subnets: [for duplicatesEverywhere in range(0, 4): { -//@[4:110) ObjectPropertySyntax -//@[4:11) IdentifierSyntax -//@[4:11) Identifier |subnets| -//@[11:12) Colon |:| -//@[13:110) ForSyntax -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:38) LocalVariableSyntax -//@[18:38) IdentifierSyntax -//@[18:38) Identifier |duplicatesEverywhere| -//@[39:41) Identifier |in| -//@[42:53) FunctionCallSyntax -//@[42:47) IdentifierSyntax -//@[42:47) Identifier |range| -//@[47:48) LeftParen |(| -//@[48:50) FunctionArgumentSyntax -//@[48:49) IntegerLiteralSyntax -//@[48:49) Integer |0| -//@[49:50) Comma |,| -//@[51:52) FunctionArgumentSyntax -//@[51:52) IntegerLiteralSyntax -//@[51:52) Integer |4| -//@[52:53) RightParen |)| -//@[53:54) Colon |:| -//@[55:109) ObjectSyntax -//@[55:56) LeftBrace |{| -//@[56:58) NewLine |\r\n| - name: 'subnet-${duplicatesEverywhere}' -//@[6:44) ObjectPropertySyntax -//@[6:10) IdentifierSyntax -//@[6:10) Identifier |name| -//@[10:11) Colon |:| -//@[12:44) StringSyntax -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:42) VariableAccessSyntax -//@[22:42) IdentifierSyntax -//@[22:42) Identifier |duplicatesEverywhere| -//@[42:44) StringRightPiece |}'| -//@[44:46) NewLine |\r\n| - }] -//@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| + // #completionTest(17) -> symbolsPlusAccount +//@[48:50) NewLine |\r\n| + networkAcls: { +//@[4:411) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |networkAcls| +//@[15:16) Colon |:| +//@[17:411) ObjectSyntax +//@[17:18) LeftBrace |{| +//@[18:20) NewLine |\r\n| + virtualNetworkRules: [for rule in []: { +//@[6:384) ObjectPropertySyntax +//@[6:25) IdentifierSyntax +//@[6:25) Identifier |virtualNetworkRules| +//@[25:26) Colon |:| +//@[27:384) ForSyntax +//@[27:28) LeftSquare |[| +//@[28:31) Identifier |for| +//@[32:36) LocalVariableSyntax +//@[32:36) IdentifierSyntax +//@[32:36) Identifier |rule| +//@[37:39) Identifier |in| +//@[40:42) ArraySyntax +//@[40:41) LeftSquare |[| +//@[41:42) RightSquare |]| +//@[42:43) Colon |:| +//@[44:383) ObjectSyntax +//@[44:45) LeftBrace |{| +//@[45:47) NewLine |\r\n| + // #completionTest(12,15,31) -> symbolsPlusRule +//@[55:57) NewLine |\r\n| + id: '${account.name}-${account.location}' +//@[8:49) ObjectPropertySyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:49) StringSyntax +//@[12:15) StringLeftPiece |'${| +//@[15:27) PropertyAccessSyntax +//@[15:22) VariableAccessSyntax +//@[15:22) IdentifierSyntax +//@[15:22) Identifier |account| +//@[22:23) Dot |.| +//@[23:27) IdentifierSyntax +//@[23:27) Identifier |name| +//@[27:31) StringMiddlePiece |}-${| +//@[31:47) PropertyAccessSyntax +//@[31:38) VariableAccessSyntax +//@[31:38) IdentifierSyntax +//@[31:38) Identifier |account| +//@[38:39) Dot |.| +//@[39:47) IdentifierSyntax +//@[39:47) Identifier |location| +//@[47:49) StringRightPiece |}'| +//@[49:51) NewLine |\r\n| + state: [for state in []: { +//@[8:219) ObjectPropertySyntax +//@[8:13) IdentifierSyntax +//@[8:13) Identifier |state| +//@[13:14) Colon |:| +//@[15:219) ForSyntax +//@[15:16) LeftSquare |[| +//@[16:19) Identifier |for| +//@[20:25) LocalVariableSyntax +//@[20:25) IdentifierSyntax +//@[20:25) Identifier |state| +//@[26:28) Identifier |in| +//@[29:31) ArraySyntax +//@[29:30) LeftSquare |[| +//@[30:31) RightSquare |]| +//@[31:32) Colon |:| +//@[33:218) ObjectSyntax +//@[33:34) LeftBrace |{| +//@[34:36) NewLine |\r\n| + // #completionTest(38) -> symbolsPlusAccountRuleStateSomething #completionTest(16,34) -> symbolsPlusAccountRuleState +//@[126:128) NewLine |\r\n| + fake: [for something in []: true] +//@[10:43) ObjectPropertySyntax +//@[10:14) IdentifierSyntax +//@[10:14) Identifier |fake| +//@[14:15) Colon |:| +//@[16:43) ForSyntax +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:30) LocalVariableSyntax +//@[21:30) IdentifierSyntax +//@[21:30) Identifier |something| +//@[31:33) Identifier |in| +//@[34:36) ArraySyntax +//@[34:35) LeftSquare |[| +//@[35:36) RightSquare |]| +//@[36:37) Colon |:| +//@[38:42) BooleanLiteralSyntax +//@[38:42) TrueKeyword |true| +//@[42:43) RightSquare |]| +//@[43:45) NewLine |\r\n| + }] +//@[8:9) RightBrace |}| +//@[9:10) RightSquare |]| +//@[10:12) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// just a storage account loop -//@[30:32) NewLine |\r\n| -resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { -//@[0:227) ResourceDeclarationSyntax +//@[2:6) NewLine |\r\n\r\n| + +// loops cannot be used inside of expressions +//@[45:47) NewLine |\r\n| +resource stuffs 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[0:381) ResourceDeclarationSyntax //@[0:8) Identifier |resource| -//@[9:25) IdentifierSyntax -//@[9:25) Identifier |storageResources| -//@[26:72) StringSyntax -//@[26:72) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| -//@[73:74) Assignment |=| -//@[75:227) ForSyntax -//@[75:76) LeftSquare |[| -//@[76:79) Identifier |for| -//@[80:87) LocalVariableSyntax -//@[80:87) IdentifierSyntax -//@[80:87) Identifier |account| -//@[88:90) Identifier |in| -//@[91:106) VariableAccessSyntax -//@[91:106) IdentifierSyntax -//@[91:106) Identifier |storageAccounts| -//@[106:107) Colon |:| -//@[108:226) ObjectSyntax -//@[108:109) LeftBrace |{| -//@[109:111) NewLine |\r\n| +//@[9:15) IdentifierSyntax +//@[9:15) Identifier |stuffs| +//@[16:62) StringSyntax +//@[16:62) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[63:64) Assignment |=| +//@[65:381) ForSyntax +//@[65:66) LeftSquare |[| +//@[66:69) Identifier |for| +//@[70:77) LocalVariableSyntax +//@[70:77) IdentifierSyntax +//@[70:77) Identifier |account| +//@[78:80) Identifier |in| +//@[81:96) VariableAccessSyntax +//@[81:96) IdentifierSyntax +//@[81:96) Identifier |storageAccounts| +//@[96:97) Colon |:| +//@[98:380) ObjectSyntax +//@[98:99) LeftBrace |{| +//@[99:101) NewLine |\r\n| name: account.name //@[2:20) ObjectPropertySyntax //@[2:6) IdentifierSyntax @@ -6630,21 +6600,97 @@ resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for //@[8:19) StringSyntax //@[8:19) StringComplete |'StorageV2'| //@[19:21) NewLine |\r\n| + properties: { +//@[2:162) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:162) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + networkAcls: { +//@[4:140) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |networkAcls| +//@[15:16) Colon |:| +//@[17:140) ObjectSyntax +//@[17:18) LeftBrace |{| +//@[18:20) NewLine |\r\n| + virtualNetworkRules: concat([for lol in []: { +//@[6:113) ObjectPropertySyntax +//@[6:25) IdentifierSyntax +//@[6:25) Identifier |virtualNetworkRules| +//@[25:26) Colon |:| +//@[27:113) FunctionCallSyntax +//@[27:33) IdentifierSyntax +//@[27:33) Identifier |concat| +//@[33:34) LeftParen |(| +//@[34:112) FunctionArgumentSyntax +//@[34:112) ForSyntax +//@[34:35) LeftSquare |[| +//@[35:38) Identifier |for| +//@[39:42) LocalVariableSyntax +//@[39:42) IdentifierSyntax +//@[39:42) Identifier |lol| +//@[43:45) Identifier |in| +//@[46:48) ArraySyntax +//@[46:47) LeftSquare |[| +//@[47:48) RightSquare |]| +//@[48:49) Colon |:| +//@[50:111) ObjectSyntax +//@[50:51) LeftBrace |{| +//@[51:53) NewLine |\r\n| + id: '${account.name}-${account.location}' +//@[8:49) ObjectPropertySyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:49) StringSyntax +//@[12:15) StringLeftPiece |'${| +//@[15:27) PropertyAccessSyntax +//@[15:22) VariableAccessSyntax +//@[15:22) IdentifierSyntax +//@[15:22) Identifier |account| +//@[22:23) Dot |.| +//@[23:27) IdentifierSyntax +//@[23:27) Identifier |name| +//@[27:31) StringMiddlePiece |}-${| +//@[31:47) PropertyAccessSyntax +//@[31:38) VariableAccessSyntax +//@[31:38) IdentifierSyntax +//@[31:38) Identifier |account| +//@[38:39) Dot |.| +//@[39:47) IdentifierSyntax +//@[39:47) Identifier |location| +//@[47:49) StringRightPiece |}'| +//@[49:51) NewLine |\r\n| + }]) +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:9) RightParen |)| +//@[9:11) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| +//@[2:6) NewLine |\r\n\r\n| + // using the same loop variable in a new language scope should be allowed //@[73:75) NewLine |\r\n| resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { -//@[0:271) ResourceDeclarationSyntax +//@[0:321) ResourceDeclarationSyntax //@[0:8) Identifier |resource| //@[9:24) IdentifierSyntax //@[9:24) Identifier |premiumStorages| //@[25:71) StringSyntax //@[25:71) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| //@[72:73) Assignment |=| -//@[74:271) ForSyntax +//@[74:321) ForSyntax //@[74:75) LeftSquare |[| //@[75:78) Identifier |for| //@[79:86) LocalVariableSyntax @@ -6655,9 +6701,11 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a //@[90:105) IdentifierSyntax //@[90:105) Identifier |storageAccounts| //@[105:106) Colon |:| -//@[107:270) ObjectSyntax +//@[107:320) ObjectSyntax //@[107:108) LeftBrace |{| //@[108:110) NewLine |\r\n| + // #completionTest(7,8) -> symbolsPlusAccount2 +//@[48:50) NewLine |\r\n| name: account.name //@[2:20) ObjectPropertySyntax //@[2:6) IdentifierSyntax @@ -6715,40 +6763,193 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// basic nested loop -//@[20:22) NewLine |\r\n| -resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[0:279) ResourceDeclarationSyntax +//@[2:6) NewLine |\r\n\r\n| + +var directRefViaVar = premiumStorages +//@[0:37) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:19) IdentifierSyntax +//@[4:19) Identifier |directRefViaVar| +//@[20:21) Assignment |=| +//@[22:37) VariableAccessSyntax +//@[22:37) IdentifierSyntax +//@[22:37) Identifier |premiumStorages| +//@[37:39) NewLine |\r\n| +output directRefViaOutput array = union(premiumStorages, stuffs) +//@[0:64) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:25) IdentifierSyntax +//@[7:25) Identifier |directRefViaOutput| +//@[26:31) TypeSyntax +//@[26:31) Identifier |array| +//@[32:33) Assignment |=| +//@[34:64) FunctionCallSyntax +//@[34:39) IdentifierSyntax +//@[34:39) Identifier |union| +//@[39:40) LeftParen |(| +//@[40:56) FunctionArgumentSyntax +//@[40:55) VariableAccessSyntax +//@[40:55) IdentifierSyntax +//@[40:55) Identifier |premiumStorages| +//@[55:56) Comma |,| +//@[57:63) FunctionArgumentSyntax +//@[57:63) VariableAccessSyntax +//@[57:63) IdentifierSyntax +//@[57:63) Identifier |stuffs| +//@[63:64) RightParen |)| +//@[64:68) NewLine |\r\n\r\n| + +resource directRefViaSingleResourceBody 'Microsoft.Network/dnszones@2018-05-01' = { +//@[0:199) ResourceDeclarationSyntax //@[0:8) Identifier |resource| -//@[9:13) IdentifierSyntax -//@[9:13) Identifier |vnet| -//@[14:60) StringSyntax -//@[14:60) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[61:62) Assignment |=| -//@[63:279) ForSyntax -//@[63:64) LeftSquare |[| -//@[64:67) Identifier |for| -//@[68:69) LocalVariableSyntax -//@[68:69) IdentifierSyntax -//@[68:69) Identifier |i| -//@[70:72) Identifier |in| -//@[73:84) FunctionCallSyntax -//@[73:78) IdentifierSyntax -//@[73:78) Identifier |range| -//@[78:79) LeftParen |(| -//@[79:81) FunctionArgumentSyntax -//@[79:80) IntegerLiteralSyntax -//@[79:80) Integer |0| -//@[80:81) Comma |,| -//@[82:83) FunctionArgumentSyntax -//@[82:83) IntegerLiteralSyntax -//@[82:83) Integer |3| -//@[83:84) RightParen |)| -//@[84:85) Colon |:| -//@[86:278) ObjectSyntax -//@[86:87) LeftBrace |{| -//@[87:89) NewLine |\r\n| +//@[9:39) IdentifierSyntax +//@[9:39) Identifier |directRefViaSingleResourceBody| +//@[40:79) StringSyntax +//@[40:79) StringComplete |'Microsoft.Network/dnszones@2018-05-01'| +//@[80:81) Assignment |=| +//@[82:199) ObjectSyntax +//@[82:83) LeftBrace |{| +//@[83:85) NewLine |\r\n| + name: 'myZone2' +//@[2:17) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringSyntax +//@[8:17) StringComplete |'myZone2'| +//@[17:19) NewLine |\r\n| + location: 'global' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'global'| +//@[20:22) NewLine |\r\n| + properties: { +//@[2:70) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:70) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + registrationVirtualNetworks: premiumStorages +//@[4:48) ObjectPropertySyntax +//@[4:31) IdentifierSyntax +//@[4:31) Identifier |registrationVirtualNetworks| +//@[31:32) Colon |:| +//@[33:48) VariableAccessSyntax +//@[33:48) IdentifierSyntax +//@[33:48) Identifier |premiumStorages| +//@[48:50) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource directRefViaSingleConditionalResourceBody 'Microsoft.Network/dnszones@2018-05-01' = if(true) { +//@[0:235) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:50) IdentifierSyntax +//@[9:50) Identifier |directRefViaSingleConditionalResourceBody| +//@[51:90) StringSyntax +//@[51:90) StringComplete |'Microsoft.Network/dnszones@2018-05-01'| +//@[91:92) Assignment |=| +//@[93:235) IfConditionSyntax +//@[93:95) Identifier |if| +//@[95:101) ParenthesizedExpressionSyntax +//@[95:96) LeftParen |(| +//@[96:100) BooleanLiteralSyntax +//@[96:100) TrueKeyword |true| +//@[100:101) RightParen |)| +//@[102:235) ObjectSyntax +//@[102:103) LeftBrace |{| +//@[103:105) NewLine |\r\n| + name: 'myZone3' +//@[2:17) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringSyntax +//@[8:17) StringComplete |'myZone3'| +//@[17:19) NewLine |\r\n| + location: 'global' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'global'| +//@[20:22) NewLine |\r\n| + properties: { +//@[2:86) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:86) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + registrationVirtualNetworks: concat(premiumStorages, stuffs) +//@[4:64) ObjectPropertySyntax +//@[4:31) IdentifierSyntax +//@[4:31) Identifier |registrationVirtualNetworks| +//@[31:32) Colon |:| +//@[33:64) FunctionCallSyntax +//@[33:39) IdentifierSyntax +//@[33:39) Identifier |concat| +//@[39:40) LeftParen |(| +//@[40:56) FunctionArgumentSyntax +//@[40:55) VariableAccessSyntax +//@[40:55) IdentifierSyntax +//@[40:55) Identifier |premiumStorages| +//@[55:56) Comma |,| +//@[57:63) FunctionArgumentSyntax +//@[57:63) VariableAccessSyntax +//@[57:63) IdentifierSyntax +//@[57:63) Identifier |stuffs| +//@[63:64) RightParen |)| +//@[64:66) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource directRefViaSingleLoopResourceBody 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:194) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:43) IdentifierSyntax +//@[9:43) Identifier |directRefViaSingleLoopResourceBody| +//@[44:90) StringSyntax +//@[44:90) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[91:92) Assignment |=| +//@[93:194) ForSyntax +//@[93:94) LeftSquare |[| +//@[94:97) Identifier |for| +//@[98:99) LocalVariableSyntax +//@[98:99) IdentifierSyntax +//@[98:99) Identifier |i| +//@[100:102) Identifier |in| +//@[103:114) FunctionCallSyntax +//@[103:108) IdentifierSyntax +//@[103:108) Identifier |range| +//@[108:109) LeftParen |(| +//@[109:111) FunctionArgumentSyntax +//@[109:110) IntegerLiteralSyntax +//@[109:110) Integer |0| +//@[110:111) Comma |,| +//@[112:113) FunctionArgumentSyntax +//@[112:113) IntegerLiteralSyntax +//@[112:113) Integer |3| +//@[113:114) RightParen |)| +//@[114:115) Colon |:| +//@[116:193) ObjectSyntax +//@[116:117) LeftBrace |{| +//@[117:119) NewLine |\r\n| name: 'vnet-${i}' //@[2:19) ObjectPropertySyntax //@[2:6) IdentifierSyntax @@ -6762,67 +6963,251 @@ resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0 //@[17:19) StringRightPiece |}'| //@[19:21) NewLine |\r\n| properties: { -//@[2:165) ObjectPropertySyntax +//@[2:50) ObjectPropertySyntax //@[2:12) IdentifierSyntax //@[2:12) Identifier |properties| //@[12:13) Colon |:| -//@[14:165) ObjectSyntax +//@[14:50) ObjectSyntax //@[14:15) LeftBrace |{| //@[15:17) NewLine |\r\n| - subnets: [for j in range(0, 4): { -//@[4:143) ObjectPropertySyntax + subnets: premiumStorages +//@[4:28) ObjectPropertySyntax //@[4:11) IdentifierSyntax //@[4:11) Identifier |subnets| //@[11:12) Colon |:| -//@[13:143) ForSyntax -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:19) LocalVariableSyntax -//@[18:19) IdentifierSyntax -//@[18:19) Identifier |j| -//@[20:22) Identifier |in| -//@[23:34) FunctionCallSyntax -//@[23:28) IdentifierSyntax -//@[23:28) Identifier |range| -//@[28:29) LeftParen |(| -//@[29:31) FunctionArgumentSyntax -//@[29:30) IntegerLiteralSyntax -//@[29:30) Integer |0| -//@[30:31) Comma |,| -//@[32:33) FunctionArgumentSyntax -//@[32:33) IntegerLiteralSyntax -//@[32:33) Integer |4| -//@[33:34) RightParen |)| -//@[34:35) Colon |:| -//@[36:142) ObjectSyntax -//@[36:37) LeftBrace |{| -//@[37:39) NewLine |\r\n| - // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties -//@[64:66) NewLine |\r\n| - name: 'subnet-${i}-${j}' -//@[6:30) ObjectPropertySyntax -//@[6:10) IdentifierSyntax -//@[6:10) Identifier |name| -//@[10:11) Colon |:| -//@[12:30) StringSyntax -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:23) VariableAccessSyntax -//@[22:23) IdentifierSyntax -//@[22:23) Identifier |i| -//@[23:27) StringMiddlePiece |}-${| -//@[27:28) VariableAccessSyntax -//@[27:28) IdentifierSyntax -//@[27:28) Identifier |j| -//@[28:30) StringRightPiece |}'| -//@[30:32) NewLine |\r\n| - }] -//@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[13:28) VariableAccessSyntax +//@[13:28) IdentifierSyntax +//@[13:28) Identifier |premiumStorages| +//@[28:30) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource directRefViaSingleLoopResourceBodyWithExtraDependsOn 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:287) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:61) IdentifierSyntax +//@[9:61) Identifier |directRefViaSingleLoopResourceBodyWithExtraDependsOn| +//@[62:108) StringSyntax +//@[62:108) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[109:110) Assignment |=| +//@[111:287) ForSyntax +//@[111:112) LeftSquare |[| +//@[112:115) Identifier |for| +//@[116:117) LocalVariableSyntax +//@[116:117) IdentifierSyntax +//@[116:117) Identifier |i| +//@[118:120) Identifier |in| +//@[121:132) FunctionCallSyntax +//@[121:126) IdentifierSyntax +//@[121:126) Identifier |range| +//@[126:127) LeftParen |(| +//@[127:129) FunctionArgumentSyntax +//@[127:128) IntegerLiteralSyntax +//@[127:128) Integer |0| +//@[128:129) Comma |,| +//@[130:131) FunctionArgumentSyntax +//@[130:131) IntegerLiteralSyntax +//@[130:131) Integer |3| +//@[131:132) RightParen |)| +//@[132:133) Colon |:| +//@[134:286) ObjectSyntax +//@[134:135) LeftBrace |{| +//@[135:137) NewLine |\r\n| + name: 'vnet-${i}' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:17) VariableAccessSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:21) NewLine |\r\n| + properties: { +//@[2:98) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:98) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: premiumStorages +//@[4:28) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:28) VariableAccessSyntax +//@[13:28) IdentifierSyntax +//@[13:28) Identifier |premiumStorages| +//@[28:30) NewLine |\r\n| + dependsOn: [ +//@[4:46) ObjectPropertySyntax +//@[4:13) IdentifierSyntax +//@[4:13) Identifier |dependsOn| +//@[13:14) Colon |:| +//@[15:46) ArraySyntax +//@[15:16) LeftSquare |[| +//@[16:18) NewLine |\r\n| + premiumStorages +//@[6:21) ArrayItemSyntax +//@[6:21) VariableAccessSyntax +//@[6:21) IdentifierSyntax +//@[6:21) Identifier |premiumStorages| +//@[21:23) NewLine |\r\n| + ] +//@[4:5) RightSquare |]| +//@[5:7) NewLine |\r\n| } //@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:25) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:25) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + +//@[4:6) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| //@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:2) EndOfFile || +//@[2:6) NewLine |\r\n\r\n| + +var expressionInPropertyLoopVar = true +//@[0:38) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:31) IdentifierSyntax +//@[4:31) Identifier |expressionInPropertyLoopVar| +//@[32:33) Assignment |=| +//@[34:38) BooleanLiteralSyntax +//@[34:38) TrueKeyword |true| +//@[38:40) NewLine |\r\n| +resource expressionsInPropertyLoopName 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[0:232) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:38) IdentifierSyntax +//@[9:38) Identifier |expressionsInPropertyLoopName| +//@[39:78) StringSyntax +//@[39:78) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[79:80) Assignment |=| +//@[81:232) ObjectSyntax +//@[81:82) LeftBrace |{| +//@[82:84) NewLine |\r\n| + name: 'hello' +//@[2:15) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringSyntax +//@[8:15) StringComplete |'hello'| +//@[15:17) NewLine |\r\n| + location: 'eastus' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'eastus'| +//@[20:22) NewLine |\r\n| + properties: { +//@[2:106) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:106) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + 'resolutionVirtualNetworks${expressionInPropertyLoopVar}': [for thing in []: {}] +//@[4:84) ObjectPropertySyntax +//@[4:61) StringSyntax +//@[4:32) StringLeftPiece |'resolutionVirtualNetworks${| +//@[32:59) VariableAccessSyntax +//@[32:59) IdentifierSyntax +//@[32:59) Identifier |expressionInPropertyLoopVar| +//@[59:61) StringRightPiece |}'| +//@[61:62) Colon |:| +//@[63:84) ForSyntax +//@[63:64) LeftSquare |[| +//@[64:67) Identifier |for| +//@[68:73) LocalVariableSyntax +//@[68:73) IdentifierSyntax +//@[68:73) Identifier |thing| +//@[74:76) Identifier |in| +//@[77:79) ArraySyntax +//@[77:78) LeftSquare |[| +//@[78:79) RightSquare |]| +//@[79:80) Colon |:| +//@[81:83) ObjectSyntax +//@[81:82) LeftBrace |{| +//@[82:83) RightBrace |}| +//@[83:84) RightSquare |]| +//@[84:86) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +// resource loop body that isn't an object +//@[42:44) NewLine |\r\n| +resource nonObjectResourceLoopBody 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: 'test'] +//@[0:102) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:34) IdentifierSyntax +//@[9:34) Identifier |nonObjectResourceLoopBody| +//@[35:74) StringSyntax +//@[35:74) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[75:76) Assignment |=| +//@[77:102) ForSyntax +//@[77:78) LeftSquare |[| +//@[78:81) Identifier |for| +//@[82:87) LocalVariableSyntax +//@[82:87) IdentifierSyntax +//@[82:87) Identifier |thing| +//@[88:90) Identifier |in| +//@[91:93) ArraySyntax +//@[91:92) LeftSquare |[| +//@[92:93) RightSquare |]| +//@[93:94) Colon |:| +//@[95:101) SkippedTriviaSyntax +//@[95:101) StringComplete |'test'| +//@[101:102) RightSquare |]| +//@[102:104) NewLine |\r\n| +resource nonObjectResourceLoopBody2 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: environment()] +//@[0:110) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:35) IdentifierSyntax +//@[9:35) Identifier |nonObjectResourceLoopBody2| +//@[36:75) StringSyntax +//@[36:75) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[76:77) Assignment |=| +//@[78:110) ForSyntax +//@[78:79) LeftSquare |[| +//@[79:82) Identifier |for| +//@[83:88) LocalVariableSyntax +//@[83:88) IdentifierSyntax +//@[83:88) Identifier |thing| +//@[89:91) Identifier |in| +//@[92:94) ArraySyntax +//@[92:93) LeftSquare |[| +//@[93:94) RightSquare |]| +//@[94:95) Colon |:| +//@[96:109) SkippedTriviaSyntax +//@[96:107) Identifier |environment| +//@[107:108) LeftParen |(| +//@[108:109) RightParen |)| +//@[109:110) RightSquare |]| +//@[110:110) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.tokens.bicep index ae92b0de0ce..b1d8b812ca8 100644 --- a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.tokens.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/main.tokens.bicep @@ -3996,280 +3996,264 @@ resource nonexistentArrays 'Microsoft.Network/virtualNetworks@2020-06-01' = [for //@[1:2) RightSquare |]| //@[2:6) NewLine |\r\n\r\n| -/* - valid loop cases - this should be moved to Resources_* test case after codegen works -*/ -//@[3:5) NewLine |\r\n| -var storageAccounts = [ -//@[0:3) Identifier |var| -//@[4:19) Identifier |storageAccounts| -//@[20:21) Assignment |=| -//@[22:23) LeftSquare |[| -//@[23:25) NewLine |\r\n| - { -//@[2:3) LeftBrace |{| -//@[3:5) NewLine |\r\n| - name: 'one' -//@[4:8) Identifier |name| -//@[8:9) Colon |:| -//@[10:15) StringComplete |'one'| -//@[15:17) NewLine |\r\n| - location: 'eastus2' -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:23) StringComplete |'eastus2'| -//@[23:25) NewLine |\r\n| - } -//@[2:3) RightBrace |}| -//@[3:5) NewLine |\r\n| - { -//@[2:3) LeftBrace |{| -//@[3:5) NewLine |\r\n| - name: 'two' +// property loops cannot be nested +//@[34:36) NewLine |\r\n| +resource propertyLoopsCannotNest 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[0:8) Identifier |resource| +//@[9:32) Identifier |propertyLoopsCannotNest| +//@[33:79) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[80:81) Assignment |=| +//@[82:83) LeftSquare |[| +//@[83:86) Identifier |for| +//@[87:94) Identifier |account| +//@[95:97) Identifier |in| +//@[98:113) Identifier |storageAccounts| +//@[113:114) Colon |:| +//@[115:116) LeftBrace |{| +//@[116:118) NewLine |\r\n| + name: account.name +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) Identifier |account| +//@[15:16) Dot |.| +//@[16:20) Identifier |name| +//@[20:22) NewLine |\r\n| + location: account.location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) Identifier |location| +//@[28:30) NewLine |\r\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:10) NewLine |\r\n| + name: 'Standard_LRS' //@[4:8) Identifier |name| //@[8:9) Colon |:| -//@[10:15) StringComplete |'two'| -//@[15:17) NewLine |\r\n| - location: 'westus' -//@[4:12) Identifier |location| -//@[12:13) Colon |:| -//@[14:22) StringComplete |'westus'| -//@[22:24) NewLine |\r\n| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:26) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| -] -//@[0:1) RightSquare |]| -//@[1:3) NewLine |\r\n| -// duplicate identifiers within the loop are allowed -//@[52:54) NewLine |\r\n| -resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { -//@[0:8) Identifier |resource| -//@[9:39) Identifier |duplicateIdentifiersWithinLoop| -//@[40:86) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[87:88) Assignment |=| -//@[89:90) LeftSquare |[| -//@[90:93) Identifier |for| -//@[94:95) Identifier |i| -//@[96:98) Identifier |in| -//@[99:104) Identifier |range| -//@[104:105) LeftParen |(| -//@[105:106) Integer |0| -//@[106:107) Comma |,| -//@[108:109) Integer |3| -//@[109:110) RightParen |)| -//@[110:111) Colon |:| -//@[112:113) LeftBrace |{| -//@[113:115) NewLine |\r\n| - name: 'vnet-${i}' -//@[2:6) Identifier |name| + kind: 'StorageV2' +//@[2:6) Identifier |kind| //@[6:7) Colon |:| -//@[8:16) StringLeftPiece |'vnet-${| -//@[16:17) Identifier |i| -//@[17:19) StringRightPiece |}'| +//@[8:19) StringComplete |'StorageV2'| //@[19:21) NewLine |\r\n| properties: { //@[2:12) Identifier |properties| //@[12:13) Colon |:| //@[14:15) LeftBrace |{| -//@[15:17) NewLine |\r\n| - subnets: [for i in range(0, 4): { -//@[4:11) Identifier |subnets| -//@[11:12) Colon |:| -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:19) Identifier |i| -//@[20:22) Identifier |in| -//@[23:28) Identifier |range| -//@[28:29) LeftParen |(| -//@[29:30) Integer |0| -//@[30:31) Comma |,| -//@[32:33) Integer |4| -//@[33:34) RightParen |)| -//@[34:35) Colon |:| -//@[36:37) LeftBrace |{| -//@[37:39) NewLine |\r\n| - name: 'subnet-${i}-${i}' -//@[6:10) Identifier |name| +//@[15:19) NewLine |\r\n\r\n| + + networkAcls: { +//@[4:15) Identifier |networkAcls| +//@[15:16) Colon |:| +//@[17:18) LeftBrace |{| +//@[18:20) NewLine |\r\n| + virtualNetworkRules: [for rule in []: { +//@[6:25) Identifier |virtualNetworkRules| +//@[25:26) Colon |:| +//@[27:28) LeftSquare |[| +//@[28:31) Identifier |for| +//@[32:36) Identifier |rule| +//@[37:39) Identifier |in| +//@[40:41) LeftSquare |[| +//@[41:42) RightSquare |]| +//@[42:43) Colon |:| +//@[44:45) LeftBrace |{| +//@[45:47) NewLine |\r\n| + id: '${account.name}-${account.location}' +//@[8:10) Identifier |id| //@[10:11) Colon |:| -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:23) Identifier |i| -//@[23:27) StringMiddlePiece |}-${| -//@[27:28) Identifier |i| -//@[28:30) StringRightPiece |}'| -//@[30:32) NewLine |\r\n| - }] +//@[12:15) StringLeftPiece |'${| +//@[15:22) Identifier |account| +//@[22:23) Dot |.| +//@[23:27) Identifier |name| +//@[27:31) StringMiddlePiece |}-${| +//@[31:38) Identifier |account| +//@[38:39) Dot |.| +//@[39:47) Identifier |location| +//@[47:49) StringRightPiece |}'| +//@[49:51) NewLine |\r\n| + state: [for lol in []: 4] +//@[8:13) Identifier |state| +//@[13:14) Colon |:| +//@[15:16) LeftSquare |[| +//@[16:19) Identifier |for| +//@[20:23) Identifier |lol| +//@[24:26) Identifier |in| +//@[27:28) LeftSquare |[| +//@[28:29) RightSquare |]| +//@[29:30) Colon |:| +//@[31:32) Integer |4| +//@[32:33) RightSquare |]| +//@[33:35) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } //@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[5:7) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) -//@[100:102) NewLine |\r\n| -var canHaveDuplicatesAcrossScopes = 'hello' -//@[0:3) Identifier |var| -//@[4:33) Identifier |canHaveDuplicatesAcrossScopes| -//@[34:35) Assignment |=| -//@[36:43) StringComplete |'hello'| -//@[43:45) NewLine |\r\n| -resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { +//@[2:6) NewLine |\r\n\r\n| + +// property loops cannot be nested (even more nesting) +//@[54:56) NewLine |\r\n| +resource propertyLoopsCannotNest2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { //@[0:8) Identifier |resource| -//@[9:36) Identifier |duplicateInGlobalAndOneLoop| -//@[37:83) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[84:85) Assignment |=| -//@[86:87) LeftSquare |[| -//@[87:90) Identifier |for| -//@[91:120) Identifier |canHaveDuplicatesAcrossScopes| -//@[121:123) Identifier |in| -//@[124:129) Identifier |range| -//@[129:130) LeftParen |(| -//@[130:131) Integer |0| -//@[131:132) Comma |,| -//@[133:134) Integer |3| -//@[134:135) RightParen |)| -//@[135:136) Colon |:| -//@[137:138) LeftBrace |{| -//@[138:140) NewLine |\r\n| - name: 'vnet-${canHaveDuplicatesAcrossScopes}' +//@[9:33) Identifier |propertyLoopsCannotNest2| +//@[34:80) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[81:82) Assignment |=| +//@[83:84) LeftSquare |[| +//@[84:87) Identifier |for| +//@[88:95) Identifier |account| +//@[96:98) Identifier |in| +//@[99:114) Identifier |storageAccounts| +//@[114:115) Colon |:| +//@[116:117) LeftBrace |{| +//@[117:119) NewLine |\r\n| + name: account.name //@[2:6) Identifier |name| //@[6:7) Colon |:| -//@[8:16) StringLeftPiece |'vnet-${| -//@[16:45) Identifier |canHaveDuplicatesAcrossScopes| -//@[45:47) StringRightPiece |}'| -//@[47:49) NewLine |\r\n| - properties: { -//@[2:12) Identifier |properties| -//@[12:13) Colon |:| -//@[14:15) LeftBrace |{| -//@[15:17) NewLine |\r\n| - subnets: [for i in range(0, 4): { -//@[4:11) Identifier |subnets| -//@[11:12) Colon |:| -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:19) Identifier |i| -//@[20:22) Identifier |in| -//@[23:28) Identifier |range| -//@[28:29) LeftParen |(| -//@[29:30) Integer |0| -//@[30:31) Comma |,| -//@[32:33) Integer |4| -//@[33:34) RightParen |)| -//@[34:35) Colon |:| -//@[36:37) LeftBrace |{| -//@[37:39) NewLine |\r\n| - name: 'subnet-${i}-${i}' -//@[6:10) Identifier |name| +//@[8:15) Identifier |account| +//@[15:16) Dot |.| +//@[16:20) Identifier |name| +//@[20:22) NewLine |\r\n| + location: account.location +//@[2:10) Identifier |location| //@[10:11) Colon |:| -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:23) Identifier |i| -//@[23:27) StringMiddlePiece |}-${| -//@[27:28) Identifier |i| -//@[28:30) StringRightPiece |}'| -//@[30:32) NewLine |\r\n| - }] -//@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) Identifier |location| +//@[28:30) NewLine |\r\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:10) NewLine |\r\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:26) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| -}] -//@[0:1) RightBrace |}| -//@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// duplicate in global and multiple loop scopes are allowed (inner hides the outer) -//@[83:85) NewLine |\r\n| -var duplicatesEverywhere = 'hello' -//@[0:3) Identifier |var| -//@[4:24) Identifier |duplicatesEverywhere| -//@[25:26) Assignment |=| -//@[27:34) StringComplete |'hello'| -//@[34:36) NewLine |\r\n| -resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { -//@[0:8) Identifier |resource| -//@[9:37) Identifier |duplicateInGlobalAndTwoLoops| -//@[38:84) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[85:86) Assignment |=| -//@[87:88) LeftSquare |[| -//@[88:91) Identifier |for| -//@[92:112) Identifier |duplicatesEverywhere| -//@[113:115) Identifier |in| -//@[116:121) Identifier |range| -//@[121:122) LeftParen |(| -//@[122:123) Integer |0| -//@[123:124) Comma |,| -//@[125:126) Integer |3| -//@[126:127) RightParen |)| -//@[127:128) Colon |:| -//@[129:130) LeftBrace |{| -//@[130:132) NewLine |\r\n| - name: 'vnet-${duplicatesEverywhere}' -//@[2:6) Identifier |name| + kind: 'StorageV2' +//@[2:6) Identifier |kind| //@[6:7) Colon |:| -//@[8:16) StringLeftPiece |'vnet-${| -//@[16:36) Identifier |duplicatesEverywhere| -//@[36:38) StringRightPiece |}'| -//@[38:40) NewLine |\r\n| +//@[8:19) StringComplete |'StorageV2'| +//@[19:21) NewLine |\r\n| properties: { //@[2:12) Identifier |properties| //@[12:13) Colon |:| //@[14:15) LeftBrace |{| //@[15:17) NewLine |\r\n| - subnets: [for duplicatesEverywhere in range(0, 4): { -//@[4:11) Identifier |subnets| -//@[11:12) Colon |:| -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:38) Identifier |duplicatesEverywhere| -//@[39:41) Identifier |in| -//@[42:47) Identifier |range| -//@[47:48) LeftParen |(| -//@[48:49) Integer |0| -//@[49:50) Comma |,| -//@[51:52) Integer |4| -//@[52:53) RightParen |)| -//@[53:54) Colon |:| -//@[55:56) LeftBrace |{| -//@[56:58) NewLine |\r\n| - name: 'subnet-${duplicatesEverywhere}' -//@[6:10) Identifier |name| + // #completionTest(17) -> symbolsPlusAccount +//@[48:50) NewLine |\r\n| + networkAcls: { +//@[4:15) Identifier |networkAcls| +//@[15:16) Colon |:| +//@[17:18) LeftBrace |{| +//@[18:20) NewLine |\r\n| + virtualNetworkRules: [for rule in []: { +//@[6:25) Identifier |virtualNetworkRules| +//@[25:26) Colon |:| +//@[27:28) LeftSquare |[| +//@[28:31) Identifier |for| +//@[32:36) Identifier |rule| +//@[37:39) Identifier |in| +//@[40:41) LeftSquare |[| +//@[41:42) RightSquare |]| +//@[42:43) Colon |:| +//@[44:45) LeftBrace |{| +//@[45:47) NewLine |\r\n| + // #completionTest(12,15,31) -> symbolsPlusRule +//@[55:57) NewLine |\r\n| + id: '${account.name}-${account.location}' +//@[8:10) Identifier |id| //@[10:11) Colon |:| -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:42) Identifier |duplicatesEverywhere| -//@[42:44) StringRightPiece |}'| -//@[44:46) NewLine |\r\n| - }] +//@[12:15) StringLeftPiece |'${| +//@[15:22) Identifier |account| +//@[22:23) Dot |.| +//@[23:27) Identifier |name| +//@[27:31) StringMiddlePiece |}-${| +//@[31:38) Identifier |account| +//@[38:39) Dot |.| +//@[39:47) Identifier |location| +//@[47:49) StringRightPiece |}'| +//@[49:51) NewLine |\r\n| + state: [for state in []: { +//@[8:13) Identifier |state| +//@[13:14) Colon |:| +//@[15:16) LeftSquare |[| +//@[16:19) Identifier |for| +//@[20:25) Identifier |state| +//@[26:28) Identifier |in| +//@[29:30) LeftSquare |[| +//@[30:31) RightSquare |]| +//@[31:32) Colon |:| +//@[33:34) LeftBrace |{| +//@[34:36) NewLine |\r\n| + // #completionTest(38) -> symbolsPlusAccountRuleStateSomething #completionTest(16,34) -> symbolsPlusAccountRuleState +//@[126:128) NewLine |\r\n| + fake: [for something in []: true] +//@[10:14) Identifier |fake| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:30) Identifier |something| +//@[31:33) Identifier |in| +//@[34:35) LeftSquare |[| +//@[35:36) RightSquare |]| +//@[36:37) Colon |:| +//@[38:42) TrueKeyword |true| +//@[42:43) RightSquare |]| +//@[43:45) NewLine |\r\n| + }] +//@[8:9) RightBrace |}| +//@[9:10) RightSquare |]| +//@[10:12) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } //@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[5:7) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// just a storage account loop -//@[30:32) NewLine |\r\n| -resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[2:6) NewLine |\r\n\r\n| + +// loops cannot be used inside of expressions +//@[45:47) NewLine |\r\n| +resource stuffs 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { //@[0:8) Identifier |resource| -//@[9:25) Identifier |storageResources| -//@[26:72) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| -//@[73:74) Assignment |=| -//@[75:76) LeftSquare |[| -//@[76:79) Identifier |for| -//@[80:87) Identifier |account| -//@[88:90) Identifier |in| -//@[91:106) Identifier |storageAccounts| -//@[106:107) Colon |:| -//@[108:109) LeftBrace |{| -//@[109:111) NewLine |\r\n| +//@[9:15) Identifier |stuffs| +//@[16:62) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[63:64) Assignment |=| +//@[65:66) LeftSquare |[| +//@[66:69) Identifier |for| +//@[70:77) Identifier |account| +//@[78:80) Identifier |in| +//@[81:96) Identifier |storageAccounts| +//@[96:97) Colon |:| +//@[98:99) LeftBrace |{| +//@[99:101) NewLine |\r\n| name: account.name //@[2:6) Identifier |name| //@[6:7) Colon |:| @@ -4302,10 +4286,59 @@ resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for //@[6:7) Colon |:| //@[8:19) StringComplete |'StorageV2'| //@[19:21) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + networkAcls: { +//@[4:15) Identifier |networkAcls| +//@[15:16) Colon |:| +//@[17:18) LeftBrace |{| +//@[18:20) NewLine |\r\n| + virtualNetworkRules: concat([for lol in []: { +//@[6:25) Identifier |virtualNetworkRules| +//@[25:26) Colon |:| +//@[27:33) Identifier |concat| +//@[33:34) LeftParen |(| +//@[34:35) LeftSquare |[| +//@[35:38) Identifier |for| +//@[39:42) Identifier |lol| +//@[43:45) Identifier |in| +//@[46:47) LeftSquare |[| +//@[47:48) RightSquare |]| +//@[48:49) Colon |:| +//@[50:51) LeftBrace |{| +//@[51:53) NewLine |\r\n| + id: '${account.name}-${account.location}' +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:15) StringLeftPiece |'${| +//@[15:22) Identifier |account| +//@[22:23) Dot |.| +//@[23:27) Identifier |name| +//@[27:31) StringMiddlePiece |}-${| +//@[31:38) Identifier |account| +//@[38:39) Dot |.| +//@[39:47) Identifier |location| +//@[47:49) StringRightPiece |}'| +//@[49:51) NewLine |\r\n| + }]) +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:9) RightParen |)| +//@[9:11) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| +//@[2:6) NewLine |\r\n\r\n| + // using the same loop variable in a new language scope should be allowed //@[73:75) NewLine |\r\n| resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { @@ -4321,6 +4354,8 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a //@[105:106) Colon |:| //@[107:108) LeftBrace |{| //@[108:110) NewLine |\r\n| + // #completionTest(7,8) -> symbolsPlusAccount2 +//@[48:50) NewLine |\r\n| name: account.name //@[2:6) Identifier |name| //@[6:7) Colon |:| @@ -4357,27 +4392,122 @@ resource premiumStorages 'Microsoft.Storage/storageAccounts@2019-06-01' = [for a }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:4) NewLine |\r\n| -// basic nested loop +//@[2:6) NewLine |\r\n\r\n| + +var directRefViaVar = premiumStorages +//@[0:3) Identifier |var| +//@[4:19) Identifier |directRefViaVar| +//@[20:21) Assignment |=| +//@[22:37) Identifier |premiumStorages| +//@[37:39) NewLine |\r\n| +output directRefViaOutput array = union(premiumStorages, stuffs) +//@[0:6) Identifier |output| +//@[7:25) Identifier |directRefViaOutput| +//@[26:31) Identifier |array| +//@[32:33) Assignment |=| +//@[34:39) Identifier |union| +//@[39:40) LeftParen |(| +//@[40:55) Identifier |premiumStorages| +//@[55:56) Comma |,| +//@[57:63) Identifier |stuffs| +//@[63:64) RightParen |)| +//@[64:68) NewLine |\r\n\r\n| + +resource directRefViaSingleResourceBody 'Microsoft.Network/dnszones@2018-05-01' = { +//@[0:8) Identifier |resource| +//@[9:39) Identifier |directRefViaSingleResourceBody| +//@[40:79) StringComplete |'Microsoft.Network/dnszones@2018-05-01'| +//@[80:81) Assignment |=| +//@[82:83) LeftBrace |{| +//@[83:85) NewLine |\r\n| + name: 'myZone2' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringComplete |'myZone2'| +//@[17:19) NewLine |\r\n| + location: 'global' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'global'| //@[20:22) NewLine |\r\n| -resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + registrationVirtualNetworks: premiumStorages +//@[4:31) Identifier |registrationVirtualNetworks| +//@[31:32) Colon |:| +//@[33:48) Identifier |premiumStorages| +//@[48:50) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource directRefViaSingleConditionalResourceBody 'Microsoft.Network/dnszones@2018-05-01' = if(true) { //@[0:8) Identifier |resource| -//@[9:13) Identifier |vnet| -//@[14:60) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| -//@[61:62) Assignment |=| -//@[63:64) LeftSquare |[| -//@[64:67) Identifier |for| -//@[68:69) Identifier |i| -//@[70:72) Identifier |in| -//@[73:78) Identifier |range| -//@[78:79) LeftParen |(| -//@[79:80) Integer |0| -//@[80:81) Comma |,| -//@[82:83) Integer |3| -//@[83:84) RightParen |)| -//@[84:85) Colon |:| -//@[86:87) LeftBrace |{| -//@[87:89) NewLine |\r\n| +//@[9:50) Identifier |directRefViaSingleConditionalResourceBody| +//@[51:90) StringComplete |'Microsoft.Network/dnszones@2018-05-01'| +//@[91:92) Assignment |=| +//@[93:95) Identifier |if| +//@[95:96) LeftParen |(| +//@[96:100) TrueKeyword |true| +//@[100:101) RightParen |)| +//@[102:103) LeftBrace |{| +//@[103:105) NewLine |\r\n| + name: 'myZone3' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringComplete |'myZone3'| +//@[17:19) NewLine |\r\n| + location: 'global' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'global'| +//@[20:22) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + registrationVirtualNetworks: concat(premiumStorages, stuffs) +//@[4:31) Identifier |registrationVirtualNetworks| +//@[31:32) Colon |:| +//@[33:39) Identifier |concat| +//@[39:40) LeftParen |(| +//@[40:55) Identifier |premiumStorages| +//@[55:56) Comma |,| +//@[57:63) Identifier |stuffs| +//@[63:64) RightParen |)| +//@[64:66) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource directRefViaSingleLoopResourceBody 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:8) Identifier |resource| +//@[9:43) Identifier |directRefViaSingleLoopResourceBody| +//@[44:90) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[91:92) Assignment |=| +//@[93:94) LeftSquare |[| +//@[94:97) Identifier |for| +//@[98:99) Identifier |i| +//@[100:102) Identifier |in| +//@[103:108) Identifier |range| +//@[108:109) LeftParen |(| +//@[109:110) Integer |0| +//@[110:111) Comma |,| +//@[112:113) Integer |3| +//@[113:114) RightParen |)| +//@[114:115) Colon |:| +//@[116:117) LeftBrace |{| +//@[117:119) NewLine |\r\n| name: 'vnet-${i}' //@[2:6) Identifier |name| //@[6:7) Colon |:| @@ -4390,41 +4520,165 @@ resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0 //@[12:13) Colon |:| //@[14:15) LeftBrace |{| //@[15:17) NewLine |\r\n| - subnets: [for j in range(0, 4): { + subnets: premiumStorages //@[4:11) Identifier |subnets| //@[11:12) Colon |:| -//@[13:14) LeftSquare |[| -//@[14:17) Identifier |for| -//@[18:19) Identifier |j| -//@[20:22) Identifier |in| -//@[23:28) Identifier |range| -//@[28:29) LeftParen |(| -//@[29:30) Integer |0| -//@[30:31) Comma |,| -//@[32:33) Integer |4| -//@[33:34) RightParen |)| -//@[34:35) Colon |:| -//@[36:37) LeftBrace |{| -//@[37:39) NewLine |\r\n| - // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties -//@[64:66) NewLine |\r\n| - name: 'subnet-${i}-${j}' -//@[6:10) Identifier |name| -//@[10:11) Colon |:| -//@[12:22) StringLeftPiece |'subnet-${| -//@[22:23) Identifier |i| -//@[23:27) StringMiddlePiece |}-${| -//@[27:28) Identifier |j| -//@[28:30) StringRightPiece |}'| -//@[30:32) NewLine |\r\n| - }] -//@[4:5) RightBrace |}| -//@[5:6) RightSquare |]| -//@[6:8) NewLine |\r\n| +//@[13:28) Identifier |premiumStorages| +//@[28:30) NewLine |\r\n| } //@[2:3) RightBrace |}| //@[3:5) NewLine |\r\n| }] //@[0:1) RightBrace |}| //@[1:2) RightSquare |]| -//@[2:2) EndOfFile || +//@[2:6) NewLine |\r\n\r\n| + +resource directRefViaSingleLoopResourceBodyWithExtraDependsOn 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:8) Identifier |resource| +//@[9:61) Identifier |directRefViaSingleLoopResourceBodyWithExtraDependsOn| +//@[62:108) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[109:110) Assignment |=| +//@[111:112) LeftSquare |[| +//@[112:115) Identifier |for| +//@[116:117) Identifier |i| +//@[118:120) Identifier |in| +//@[121:126) Identifier |range| +//@[126:127) LeftParen |(| +//@[127:128) Integer |0| +//@[128:129) Comma |,| +//@[130:131) Integer |3| +//@[131:132) RightParen |)| +//@[132:133) Colon |:| +//@[134:135) LeftBrace |{| +//@[135:137) NewLine |\r\n| + name: 'vnet-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:21) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: premiumStorages +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:28) Identifier |premiumStorages| +//@[28:30) NewLine |\r\n| + dependsOn: [ +//@[4:13) Identifier |dependsOn| +//@[13:14) Colon |:| +//@[15:16) LeftSquare |[| +//@[16:18) NewLine |\r\n| + premiumStorages +//@[6:21) Identifier |premiumStorages| +//@[21:23) NewLine |\r\n| + ] +//@[4:5) RightSquare |]| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + +//@[4:6) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +var expressionInPropertyLoopVar = true +//@[0:3) Identifier |var| +//@[4:31) Identifier |expressionInPropertyLoopVar| +//@[32:33) Assignment |=| +//@[34:38) TrueKeyword |true| +//@[38:40) NewLine |\r\n| +resource expressionsInPropertyLoopName 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[0:8) Identifier |resource| +//@[9:38) Identifier |expressionsInPropertyLoopName| +//@[39:78) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[79:80) Assignment |=| +//@[81:82) LeftBrace |{| +//@[82:84) NewLine |\r\n| + name: 'hello' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringComplete |'hello'| +//@[15:17) NewLine |\r\n| + location: 'eastus' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'eastus'| +//@[20:22) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + 'resolutionVirtualNetworks${expressionInPropertyLoopVar}': [for thing in []: {}] +//@[4:32) StringLeftPiece |'resolutionVirtualNetworks${| +//@[32:59) Identifier |expressionInPropertyLoopVar| +//@[59:61) StringRightPiece |}'| +//@[61:62) Colon |:| +//@[63:64) LeftSquare |[| +//@[64:67) Identifier |for| +//@[68:73) Identifier |thing| +//@[74:76) Identifier |in| +//@[77:78) LeftSquare |[| +//@[78:79) RightSquare |]| +//@[79:80) Colon |:| +//@[81:82) LeftBrace |{| +//@[82:83) RightBrace |}| +//@[83:84) RightSquare |]| +//@[84:86) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +// resource loop body that isn't an object +//@[42:44) NewLine |\r\n| +resource nonObjectResourceLoopBody 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: 'test'] +//@[0:8) Identifier |resource| +//@[9:34) Identifier |nonObjectResourceLoopBody| +//@[35:74) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[75:76) Assignment |=| +//@[77:78) LeftSquare |[| +//@[78:81) Identifier |for| +//@[82:87) Identifier |thing| +//@[88:90) Identifier |in| +//@[91:92) LeftSquare |[| +//@[92:93) RightSquare |]| +//@[93:94) Colon |:| +//@[95:101) StringComplete |'test'| +//@[101:102) RightSquare |]| +//@[102:104) NewLine |\r\n| +resource nonObjectResourceLoopBody2 'Microsoft.Network/dnsZones@2018-05-01' = [for thing in []: environment()] +//@[0:8) Identifier |resource| +//@[9:35) Identifier |nonObjectResourceLoopBody2| +//@[36:75) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[76:77) Assignment |=| +//@[78:79) LeftSquare |[| +//@[79:82) Identifier |for| +//@[83:88) Identifier |thing| +//@[89:91) Identifier |in| +//@[92:93) LeftSquare |[| +//@[93:94) RightSquare |]| +//@[94:95) Colon |:| +//@[96:107) Identifier |environment| +//@[107:108) LeftParen |(| +//@[108:109) RightParen |)| +//@[109:110) RightSquare |]| +//@[110:110) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/objectVarTopLevelIndexes.json b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/objectVarTopLevelIndexes.json index 97160aeb1f3..c14004634a2 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/objectVarTopLevelIndexes.json +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/objectVarTopLevelIndexes.json @@ -637,6 +637,20 @@ "command": "editor.action.triggerParameterHints" } }, + { + "label": "loopExpression", + "kind": "variable", + "detail": "loopExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_loopExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "loopExpression" + } + }, { "label": "managementGroup", "kind": "function", @@ -772,6 +786,34 @@ "newText": "mySum" } }, + { + "label": "noNestedVariableLoopsEither", + "kind": "variable", + "detail": "noNestedVariableLoopsEither", + "deprecated": false, + "preselect": false, + "sortText": "2_noNestedVariableLoopsEither", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "noNestedVariableLoopsEither" + } + }, + { + "label": "noVariableLoopsYet", + "kind": "variable", + "detail": "noVariableLoopsYet", + "deprecated": false, + "preselect": false, + "sortText": "2_noVariableLoopsYet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "noVariableLoopsYet" + } + }, { "label": "objWithInterp", "kind": "variable", diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/symbols.json b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/symbols.json index 890c20d108a..995dd403c84 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/symbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/symbols.json @@ -637,6 +637,20 @@ "command": "editor.action.triggerParameterHints" } }, + { + "label": "loopExpression", + "kind": "variable", + "detail": "loopExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_loopExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "loopExpression" + } + }, { "label": "managementGroup", "kind": "function", @@ -758,6 +772,34 @@ "newText": "mySum" } }, + { + "label": "noNestedVariableLoopsEither", + "kind": "variable", + "detail": "noNestedVariableLoopsEither", + "deprecated": false, + "preselect": false, + "sortText": "2_noNestedVariableLoopsEither", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "noNestedVariableLoopsEither" + } + }, + { + "label": "noVariableLoopsYet", + "kind": "variable", + "detail": "noVariableLoopsYet", + "deprecated": false, + "preselect": false, + "sortText": "2_noVariableLoopsYet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "noVariableLoopsYet" + } + }, { "label": "objWithInterp", "kind": "variable", diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/twoIndexPlusSymbols.json b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/twoIndexPlusSymbols.json index 3e596001c4a..b5e2ac2afbe 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/twoIndexPlusSymbols.json +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/Completions/twoIndexPlusSymbols.json @@ -655,6 +655,20 @@ "command": "editor.action.triggerParameterHints" } }, + { + "label": "loopExpression", + "kind": "variable", + "detail": "loopExpression", + "deprecated": false, + "preselect": false, + "sortText": "2_loopExpression", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "loopExpression" + } + }, { "label": "managementGroup", "kind": "function", @@ -790,6 +804,34 @@ "newText": "mySum" } }, + { + "label": "noNestedVariableLoopsEither", + "kind": "variable", + "detail": "noNestedVariableLoopsEither", + "deprecated": false, + "preselect": false, + "sortText": "2_noNestedVariableLoopsEither", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "noNestedVariableLoopsEither" + } + }, + { + "label": "noVariableLoopsYet", + "kind": "variable", + "detail": "noVariableLoopsYet", + "deprecated": false, + "preselect": false, + "sortText": "2_noVariableLoopsYet", + "insertTextFormat": "plainText", + "insertTextMode": "asIs", + "textEdit": { + "range": {}, + "newText": "noVariableLoopsYet" + } + }, { "label": "objWithInterp", "kind": "variable", diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.bicep b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.bicep index 3366da38ac2..6acabbc200f 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.bicep @@ -159,4 +159,15 @@ var anotherThing = true // invalid identifier character classes var ☕ = true -var a☕ = true \ No newline at end of file +var a☕ = true + +// loops are not allowed in variables +var noVariableLoopsYet = [for thing in stuff: 4] + +// nested loops are also not allowed +var noNestedVariableLoopsEither = [for thing in stuff: { + hello: [for thing in []: 4] +}] + +// cannot use loops in expressions +var loopExpression = union([for thing in stuff: 4], [for thing in stuff: true]) \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.diagnostics.bicep index 5fbb25a106b..ed19e10a127 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.diagnostics.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.diagnostics.bicep @@ -239,3 +239,23 @@ var a☕ = true //@[5:6) [BCP018 (Error)] Expected the "=" character at this location. |☕| //@[5:6) [BCP001 (Error)] The following token is not recognized: "☕". |☕| //@[13:13) [BCP009 (Error)] Expected a literal value, an array, an object, a parenthesized expression, or a function call at this location. || + +// loops are not allowed in variables +var noVariableLoopsYet = [for thing in stuff: 4] +//@[26:29) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[39:44) [BCP057 (Error)] The name "stuff" does not exist in the current context. |stuff| + +// nested loops are also not allowed +var noNestedVariableLoopsEither = [for thing in stuff: { +//@[35:38) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[48:53) [BCP057 (Error)] The name "stuff" does not exist in the current context. |stuff| + hello: [for thing in []: 4] +//@[10:13) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +}] + +// cannot use loops in expressions +var loopExpression = union([for thing in stuff: 4], [for thing in stuff: true]) +//@[28:31) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[41:46) [BCP057 (Error)] The name "stuff" does not exist in the current context. |stuff| +//@[53:56) [BCP138 (Error)] For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties. |for| +//@[66:71) [BCP057 (Error)] The name "stuff" does not exist in the current context. |stuff| diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.formatted.bicep index 1980e1ed08a..49b4f3bdb5f 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.formatted.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.formatted.bicep @@ -159,3 +159,14 @@ var anotherThing = true // invalid identifier character classes var ☕ = true var a☕ = true + +// loops are not allowed in variables +var noVariableLoopsYet = [for thing in stuff: 4] + +// nested loops are also not allowed +var noNestedVariableLoopsEither = [for thing in stuff: { + hello: [for thing in []: 4] +}] + +// cannot use loops in expressions +var loopExpression = union([for thing in stuff: 4], [for thing in stuff: true]) diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.symbols.bicep index cd6c4cc8418..b02287c196d 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.symbols.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.symbols.bicep @@ -208,3 +208,22 @@ var ☕ = true //@[4:5) Variable . Type: bool. Declaration start char: 0, length: 12 var a☕ = true //@[4:5) Variable a. Type: error. Declaration start char: 0, length: 13 + +// loops are not allowed in variables +var noVariableLoopsYet = [for thing in stuff: 4] +//@[30:35) Local thing. Type: any. Declaration start char: 30, length: 5 +//@[4:22) Variable noVariableLoopsYet. Type: error. Declaration start char: 0, length: 48 + +// nested loops are also not allowed +var noNestedVariableLoopsEither = [for thing in stuff: { +//@[39:44) Local thing. Type: any. Declaration start char: 39, length: 5 +//@[4:31) Variable noNestedVariableLoopsEither. Type: error. Declaration start char: 0, length: 89 + hello: [for thing in []: 4] +//@[14:19) Local thing. Type: any. Declaration start char: 14, length: 5 +}] + +// cannot use loops in expressions +var loopExpression = union([for thing in stuff: 4], [for thing in stuff: true]) +//@[32:37) Local thing. Type: any. Declaration start char: 32, length: 5 +//@[57:62) Local thing. Type: any. Declaration start char: 57, length: 5 +//@[4:18) Variable loopExpression. Type: error. Declaration start char: 0, length: 79 diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.syntax.bicep index d81c6aff50d..7ef3f3b5a18 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.syntax.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.syntax.bicep @@ -987,4 +987,121 @@ var a☕ = true //@[7:8) Assignment |=| //@[9:13) TrueKeyword |true| //@[13:13) SkippedTriviaSyntax -//@[13:13) EndOfFile || +//@[13:15) NewLine |\n\n| + +// loops are not allowed in variables +//@[37:38) NewLine |\n| +var noVariableLoopsYet = [for thing in stuff: 4] +//@[0:48) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:22) IdentifierSyntax +//@[4:22) Identifier |noVariableLoopsYet| +//@[23:24) Assignment |=| +//@[25:48) ForSyntax +//@[25:26) LeftSquare |[| +//@[26:29) Identifier |for| +//@[30:35) LocalVariableSyntax +//@[30:35) IdentifierSyntax +//@[30:35) Identifier |thing| +//@[36:38) Identifier |in| +//@[39:44) VariableAccessSyntax +//@[39:44) IdentifierSyntax +//@[39:44) Identifier |stuff| +//@[44:45) Colon |:| +//@[46:47) IntegerLiteralSyntax +//@[46:47) Integer |4| +//@[47:48) RightSquare |]| +//@[48:50) NewLine |\n\n| + +// nested loops are also not allowed +//@[36:37) NewLine |\n| +var noNestedVariableLoopsEither = [for thing in stuff: { +//@[0:89) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:31) IdentifierSyntax +//@[4:31) Identifier |noNestedVariableLoopsEither| +//@[32:33) Assignment |=| +//@[34:89) ForSyntax +//@[34:35) LeftSquare |[| +//@[35:38) Identifier |for| +//@[39:44) LocalVariableSyntax +//@[39:44) IdentifierSyntax +//@[39:44) Identifier |thing| +//@[45:47) Identifier |in| +//@[48:53) VariableAccessSyntax +//@[48:53) IdentifierSyntax +//@[48:53) Identifier |stuff| +//@[53:54) Colon |:| +//@[55:88) ObjectSyntax +//@[55:56) LeftBrace |{| +//@[56:57) NewLine |\n| + hello: [for thing in []: 4] +//@[2:29) ObjectPropertySyntax +//@[2:7) IdentifierSyntax +//@[2:7) Identifier |hello| +//@[7:8) Colon |:| +//@[9:29) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:19) LocalVariableSyntax +//@[14:19) IdentifierSyntax +//@[14:19) Identifier |thing| +//@[20:22) Identifier |in| +//@[23:25) ArraySyntax +//@[23:24) LeftSquare |[| +//@[24:25) RightSquare |]| +//@[25:26) Colon |:| +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |4| +//@[28:29) RightSquare |]| +//@[29:30) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// cannot use loops in expressions +//@[34:35) NewLine |\n| +var loopExpression = union([for thing in stuff: 4], [for thing in stuff: true]) +//@[0:79) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:18) IdentifierSyntax +//@[4:18) Identifier |loopExpression| +//@[19:20) Assignment |=| +//@[21:79) FunctionCallSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |union| +//@[26:27) LeftParen |(| +//@[27:51) FunctionArgumentSyntax +//@[27:50) ForSyntax +//@[27:28) LeftSquare |[| +//@[28:31) Identifier |for| +//@[32:37) LocalVariableSyntax +//@[32:37) IdentifierSyntax +//@[32:37) Identifier |thing| +//@[38:40) Identifier |in| +//@[41:46) VariableAccessSyntax +//@[41:46) IdentifierSyntax +//@[41:46) Identifier |stuff| +//@[46:47) Colon |:| +//@[48:49) IntegerLiteralSyntax +//@[48:49) Integer |4| +//@[49:50) RightSquare |]| +//@[50:51) Comma |,| +//@[52:78) FunctionArgumentSyntax +//@[52:78) ForSyntax +//@[52:53) LeftSquare |[| +//@[53:56) Identifier |for| +//@[57:62) LocalVariableSyntax +//@[57:62) IdentifierSyntax +//@[57:62) Identifier |thing| +//@[63:65) Identifier |in| +//@[66:71) VariableAccessSyntax +//@[66:71) IdentifierSyntax +//@[66:71) Identifier |stuff| +//@[71:72) Colon |:| +//@[73:77) BooleanLiteralSyntax +//@[73:77) TrueKeyword |true| +//@[77:78) RightSquare |]| +//@[78:79) RightParen |)| +//@[79:79) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.tokens.bicep index d11e1b66436..f8c2017aa49 100644 --- a/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.tokens.bicep +++ b/src/Bicep.Core.Samples/Files/InvalidVariables_LF/main.tokens.bicep @@ -646,4 +646,80 @@ var a☕ = true //@[5:6) Unrecognized |☕| //@[7:8) Assignment |=| //@[9:13) TrueKeyword |true| -//@[13:13) EndOfFile || +//@[13:15) NewLine |\n\n| + +// loops are not allowed in variables +//@[37:38) NewLine |\n| +var noVariableLoopsYet = [for thing in stuff: 4] +//@[0:3) Identifier |var| +//@[4:22) Identifier |noVariableLoopsYet| +//@[23:24) Assignment |=| +//@[25:26) LeftSquare |[| +//@[26:29) Identifier |for| +//@[30:35) Identifier |thing| +//@[36:38) Identifier |in| +//@[39:44) Identifier |stuff| +//@[44:45) Colon |:| +//@[46:47) Integer |4| +//@[47:48) RightSquare |]| +//@[48:50) NewLine |\n\n| + +// nested loops are also not allowed +//@[36:37) NewLine |\n| +var noNestedVariableLoopsEither = [for thing in stuff: { +//@[0:3) Identifier |var| +//@[4:31) Identifier |noNestedVariableLoopsEither| +//@[32:33) Assignment |=| +//@[34:35) LeftSquare |[| +//@[35:38) Identifier |for| +//@[39:44) Identifier |thing| +//@[45:47) Identifier |in| +//@[48:53) Identifier |stuff| +//@[53:54) Colon |:| +//@[55:56) LeftBrace |{| +//@[56:57) NewLine |\n| + hello: [for thing in []: 4] +//@[2:7) Identifier |hello| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:19) Identifier |thing| +//@[20:22) Identifier |in| +//@[23:24) LeftSquare |[| +//@[24:25) RightSquare |]| +//@[25:26) Colon |:| +//@[27:28) Integer |4| +//@[28:29) RightSquare |]| +//@[29:30) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// cannot use loops in expressions +//@[34:35) NewLine |\n| +var loopExpression = union([for thing in stuff: 4], [for thing in stuff: true]) +//@[0:3) Identifier |var| +//@[4:18) Identifier |loopExpression| +//@[19:20) Assignment |=| +//@[21:26) Identifier |union| +//@[26:27) LeftParen |(| +//@[27:28) LeftSquare |[| +//@[28:31) Identifier |for| +//@[32:37) Identifier |thing| +//@[38:40) Identifier |in| +//@[41:46) Identifier |stuff| +//@[46:47) Colon |:| +//@[48:49) Integer |4| +//@[49:50) RightSquare |]| +//@[50:51) Comma |,| +//@[52:53) LeftSquare |[| +//@[53:56) Identifier |for| +//@[57:62) Identifier |thing| +//@[63:65) Identifier |in| +//@[66:71) Identifier |stuff| +//@[71:72) Colon |:| +//@[73:77) TrueKeyword |true| +//@[77:78) RightSquare |]| +//@[78:79) RightParen |)| +//@[79:79) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/main.bicep new file mode 100644 index 00000000000..3fdee263110 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.bicep @@ -0,0 +1,275 @@ +param name string +param accounts array +param index int + +// single resource +resource singleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +} + +// extension of single resource +resource singleResourceExtension 'Microsoft.Authorization/locks@2016-09-01' = { + scope: singleResource + name: 'single-resource-lock' + properties: { + level: 'CanNotDelete' + } +} + +// single resource cascade extension +resource singleResourceCascadeExtension 'Microsoft.Authorization/locks@2016-09-01' = { + scope: singleResourceExtension + name: 'single-resource-cascade-extension' + properties: { + level: 'CanNotDelete' + } +} + +// resource collection +resource storageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + singleResource + ] +}] + +// extension of a single resource in a collection +resource extendSingleResourceInCollection 'Microsoft.Authorization/locks@2016-09-01' = { + name: 'one-resource-collection-item-lock' + properties: { + level: 'ReadOnly' + } + scope: storageAccounts[index % 2] +} + +// collection of extensions +resource extensionCollection 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { + name: 'lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: singleResource +}] + +// cascade extend the extension +resource lockTheLocks 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { + name: 'lock-the-lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: extensionCollection[i] +}] + +// special case property access +output indexedCollectionBlobEndpoint string = storageAccounts[index].properties.primaryEndpoints.blob +output indexedCollectionName string = storageAccounts[index].name +output indexedCollectionId string = storageAccounts[index].id +output indexedCollectionType string = storageAccounts[index].type +output indexedCollectionVersion string = storageAccounts[index].apiVersion + +// general case property access +output indexedCollectionIdentity object = storageAccounts[index].identity + +// indexed access of two properties +output indexedEndpointPair object = { + primary: storageAccounts[index].properties.primaryEndpoints.blob + secondary: storageAccounts[index + 1].properties.secondaryEndpoints.blob +} + +// nested indexer? +output indexViaReference string = storageAccounts[int(storageAccounts[index].properties.creationTime)].properties.accessTier + +// dependency on a resource collection +resource storageAccounts2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + storageAccounts + ] +}] + +// one-to-one paired dependencies +resource firstSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { + name: '${name}-set1-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +}] + +resource secondSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { + name: '${name}-set2-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + firstSet[i] + ] +}] + +// depending on collection and one resource in the collection optimizes the latter part away +resource anotherSingleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + secondSet + secondSet[0] + ] +} + +// vnets +var vnetConfigurations = [ + { + name: 'one' + location: resourceGroup().location + } + { + name: 'two' + location: 'westus' + } +] + +resource vnets 'Microsoft.Network/virtualNetworks@2020-06-01' = [for vnetConfig in vnetConfigurations: { + name: vnetConfig.name + location: vnetConfig.location +}] + +// implicit dependency on single resource from a resource collection +resource implicitDependencyOnSingleResourceByIndex 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'test' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index+1].id + } + ] + } +} + +// implicit and explicit dependency combined +resource combinedDependencies 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'test2' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index-1].id + } + { + id: vnets[index * 2].id + } + ] + } + dependsOn: [ + vnets + ] +} + +// single module +module singleModule 'passthrough.bicep' = { + name: 'test' + params: { + myInput: 'hello' + } +} + +var moduleSetup = [ + 'one' + 'two' + 'three' +] + +// module collection plus explicit dependency on single module +module moduleCollectionWithSingleDependency 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + singleModule + singleResource + ] +}] + +// another module collection with dependency on another module collection +module moduleCollectionWithCollectionDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + storageAccounts + moduleCollectionWithSingleDependency + ] +}] + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { + name: 'hello' + params: { + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) + } + dependsOn: [ + storageAccounts2[index - 10] + ] +} + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' + } + dependsOn: [ + storageAccounts2[index - 9] + ] +}] + +output indexedModulesName string = moduleCollectionWithSingleDependency[index].name +output indexedModuleOutput string = moduleCollectionWithSingleDependency[index * 1].outputs.myOutput + +// resource collection +resource existingStorageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' existing = [for account in accounts: { + name: '${name}-existing-${account.name}' +}] + +output existingIndexedResourceName string = existingStorageAccounts[index * 0].name +output existingIndexedResourceId string = existingStorageAccounts[index * 1].id +output existingIndexedResourceType string = existingStorageAccounts[index+2].type +output existingIndexedResourceApiVersion string = existingStorageAccounts[index-7].apiVersion +output existingIndexedResourceLocation string = existingStorageAccounts[index/2].location +output existingIndexedResourceAccessTier string = existingStorageAccounts[index%3].properties.accessTier + +resource duplicatedNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { + name: 'no loop variable' + location: 'eastus' +}] + +// reference to a resource collection whose name expression does not reference any loop variables +resource referenceToDuplicateNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { + name: 'no loop variable' + location: 'eastus' + dependsOn: [ + duplicatedNames[index] + ] +}] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/main.diagnostics.bicep new file mode 100644 index 00000000000..beab92b8c4a --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.diagnostics.bicep @@ -0,0 +1,275 @@ +param name string +param accounts array +param index int + +// single resource +resource singleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +} + +// extension of single resource +resource singleResourceExtension 'Microsoft.Authorization/locks@2016-09-01' = { + scope: singleResource + name: 'single-resource-lock' + properties: { + level: 'CanNotDelete' + } +} + +// single resource cascade extension +resource singleResourceCascadeExtension 'Microsoft.Authorization/locks@2016-09-01' = { + scope: singleResourceExtension + name: 'single-resource-cascade-extension' + properties: { + level: 'CanNotDelete' + } +} + +// resource collection +resource storageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + singleResource + ] +}] + +// extension of a single resource in a collection +resource extendSingleResourceInCollection 'Microsoft.Authorization/locks@2016-09-01' = { + name: 'one-resource-collection-item-lock' + properties: { + level: 'ReadOnly' + } + scope: storageAccounts[index % 2] +} + +// collection of extensions +resource extensionCollection 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { + name: 'lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: singleResource +}] + +// cascade extend the extension +resource lockTheLocks 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { + name: 'lock-the-lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: extensionCollection[i] +}] + +// special case property access +output indexedCollectionBlobEndpoint string = storageAccounts[index].properties.primaryEndpoints.blob +output indexedCollectionName string = storageAccounts[index].name +output indexedCollectionId string = storageAccounts[index].id +output indexedCollectionType string = storageAccounts[index].type +output indexedCollectionVersion string = storageAccounts[index].apiVersion + +// general case property access +output indexedCollectionIdentity object = storageAccounts[index].identity + +// indexed access of two properties +output indexedEndpointPair object = { + primary: storageAccounts[index].properties.primaryEndpoints.blob + secondary: storageAccounts[index + 1].properties.secondaryEndpoints.blob +} + +// nested indexer? +output indexViaReference string = storageAccounts[int(storageAccounts[index].properties.creationTime)].properties.accessTier + +// dependency on a resource collection +resource storageAccounts2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + storageAccounts + ] +}] + +// one-to-one paired dependencies +resource firstSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { + name: '${name}-set1-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +}] + +resource secondSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { + name: '${name}-set2-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + firstSet[i] + ] +}] + +// depending on collection and one resource in the collection optimizes the latter part away +resource anotherSingleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + secondSet + secondSet[0] + ] +} + +// vnets +var vnetConfigurations = [ + { + name: 'one' + location: resourceGroup().location + } + { + name: 'two' + location: 'westus' + } +] + +resource vnets 'Microsoft.Network/virtualNetworks@2020-06-01' = [for vnetConfig in vnetConfigurations: { + name: vnetConfig.name + location: vnetConfig.location +}] + +// implicit dependency on single resource from a resource collection +resource implicitDependencyOnSingleResourceByIndex 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'test' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index+1].id + } + ] + } +} + +// implicit and explicit dependency combined +resource combinedDependencies 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'test2' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index-1].id + } + { + id: vnets[index * 2].id + } + ] + } + dependsOn: [ + vnets + ] +} + +// single module +module singleModule 'passthrough.bicep' = { + name: 'test' + params: { + myInput: 'hello' + } +} + +var moduleSetup = [ + 'one' + 'two' + 'three' +] + +// module collection plus explicit dependency on single module +module moduleCollectionWithSingleDependency 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + singleModule + singleResource + ] +}] + +// another module collection with dependency on another module collection +module moduleCollectionWithCollectionDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + storageAccounts + moduleCollectionWithSingleDependency + ] +}] + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { + name: 'hello' + params: { + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) + } + dependsOn: [ + storageAccounts2[index - 10] + ] +} + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' + } + dependsOn: [ + storageAccounts2[index - 9] + ] +}] + +output indexedModulesName string = moduleCollectionWithSingleDependency[index].name +output indexedModuleOutput string = moduleCollectionWithSingleDependency[index * 1].outputs.myOutput + +// resource collection +resource existingStorageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' existing = [for account in accounts: { + name: '${name}-existing-${account.name}' +}] + +output existingIndexedResourceName string = existingStorageAccounts[index * 0].name +output existingIndexedResourceId string = existingStorageAccounts[index * 1].id +output existingIndexedResourceType string = existingStorageAccounts[index+2].type +output existingIndexedResourceApiVersion string = existingStorageAccounts[index-7].apiVersion +output existingIndexedResourceLocation string = existingStorageAccounts[index/2].location +output existingIndexedResourceAccessTier string = existingStorageAccounts[index%3].properties.accessTier + +resource duplicatedNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { + name: 'no loop variable' + location: 'eastus' +}] + +// reference to a resource collection whose name expression does not reference any loop variables +resource referenceToDuplicateNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { + name: 'no loop variable' + location: 'eastus' + dependsOn: [ + duplicatedNames[index] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/main.formatted.bicep new file mode 100644 index 00000000000..18c2bb113c4 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.formatted.bicep @@ -0,0 +1,275 @@ +param name string +param accounts array +param index int + +// single resource +resource singleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +} + +// extension of single resource +resource singleResourceExtension 'Microsoft.Authorization/locks@2016-09-01' = { + scope: singleResource + name: 'single-resource-lock' + properties: { + level: 'CanNotDelete' + } +} + +// single resource cascade extension +resource singleResourceCascadeExtension 'Microsoft.Authorization/locks@2016-09-01' = { + scope: singleResourceExtension + name: 'single-resource-cascade-extension' + properties: { + level: 'CanNotDelete' + } +} + +// resource collection +resource storageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + singleResource + ] +}] + +// extension of a single resource in a collection +resource extendSingleResourceInCollection 'Microsoft.Authorization/locks@2016-09-01' = { + name: 'one-resource-collection-item-lock' + properties: { + level: 'ReadOnly' + } + scope: storageAccounts[index % 2] +} + +// collection of extensions +resource extensionCollection 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0, 1): { + name: 'lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: singleResource +}] + +// cascade extend the extension +resource lockTheLocks 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0, 1): { + name: 'lock-the-lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: extensionCollection[i] +}] + +// special case property access +output indexedCollectionBlobEndpoint string = storageAccounts[index].properties.primaryEndpoints.blob +output indexedCollectionName string = storageAccounts[index].name +output indexedCollectionId string = storageAccounts[index].id +output indexedCollectionType string = storageAccounts[index].type +output indexedCollectionVersion string = storageAccounts[index].apiVersion + +// general case property access +output indexedCollectionIdentity object = storageAccounts[index].identity + +// indexed access of two properties +output indexedEndpointPair object = { + primary: storageAccounts[index].properties.primaryEndpoints.blob + secondary: storageAccounts[index + 1].properties.secondaryEndpoints.blob +} + +// nested indexer? +output indexViaReference string = storageAccounts[int(storageAccounts[index].properties.creationTime)].properties.accessTier + +// dependency on a resource collection +resource storageAccounts2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + storageAccounts + ] +}] + +// one-to-one paired dependencies +resource firstSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { + name: '${name}-set1-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +}] + +resource secondSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { + name: '${name}-set2-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + firstSet[i] + ] +}] + +// depending on collection and one resource in the collection optimizes the latter part away +resource anotherSingleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + secondSet + secondSet[0] + ] +} + +// vnets +var vnetConfigurations = [ + { + name: 'one' + location: resourceGroup().location + } + { + name: 'two' + location: 'westus' + } +] + +resource vnets 'Microsoft.Network/virtualNetworks@2020-06-01' = [for vnetConfig in vnetConfigurations: { + name: vnetConfig.name + location: vnetConfig.location +}] + +// implicit dependency on single resource from a resource collection +resource implicitDependencyOnSingleResourceByIndex 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'test' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index + 1].id + } + ] + } +} + +// implicit and explicit dependency combined +resource combinedDependencies 'Microsoft.Network/dnsZones@2018-05-01' = { + name: 'test2' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index - 1].id + } + { + id: vnets[index * 2].id + } + ] + } + dependsOn: [ + vnets + ] +} + +// single module +module singleModule 'passthrough.bicep' = { + name: 'test' + params: { + myInput: 'hello' + } +} + +var moduleSetup = [ + 'one' + 'two' + 'three' +] + +// module collection plus explicit dependency on single module +module moduleCollectionWithSingleDependency 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + singleModule + singleResource + ] +}] + +// another module collection with dependency on another module collection +module moduleCollectionWithCollectionDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + storageAccounts + moduleCollectionWithSingleDependency + ] +}] + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { + name: 'hello' + params: { + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) + } + dependsOn: [ + storageAccounts2[index - 10] + ] +} + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { + name: moduleName + params: { + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' + } + dependsOn: [ + storageAccounts2[index - 9] + ] +}] + +output indexedModulesName string = moduleCollectionWithSingleDependency[index].name +output indexedModuleOutput string = moduleCollectionWithSingleDependency[index * 1].outputs.myOutput + +// resource collection +resource existingStorageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' existing = [for account in accounts: { + name: '${name}-existing-${account.name}' +}] + +output existingIndexedResourceName string = existingStorageAccounts[index * 0].name +output existingIndexedResourceId string = existingStorageAccounts[index * 1].id +output existingIndexedResourceType string = existingStorageAccounts[index + 2].type +output existingIndexedResourceApiVersion string = existingStorageAccounts[index - 7].apiVersion +output existingIndexedResourceLocation string = existingStorageAccounts[index / 2].location +output existingIndexedResourceAccessTier string = existingStorageAccounts[index % 3].properties.accessTier + +resource duplicatedNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { + name: 'no loop variable' + location: 'eastus' +}] + +// reference to a resource collection whose name expression does not reference any loop variables +resource referenceToDuplicateNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { + name: 'no loop variable' + location: 'eastus' + dependsOn: [ + duplicatedNames[index] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.json b/src/Bicep.Core.Samples/Files/Loops_LF/main.json new file mode 100644 index 00000000000..9f607a5e71f --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.json @@ -0,0 +1,530 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "string" + }, + "accounts": { + "type": "array" + }, + "index": { + "type": "int" + } + }, + "functions": [], + "variables": { + "vnetConfigurations": [ + { + "name": "one", + "location": "[resourceGroup().location]" + }, + { + "name": "two", + "location": "westus" + } + ], + "moduleSetup": [ + "one", + "two", + "three" + ] + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[format('{0}single-resource-name', parameters('name'))]", + "location": "[resourceGroup().location]", + "kind": "StorageV2", + "sku": { + "name": "Standard_LRS" + } + }, + { + "type": "Microsoft.Authorization/locks", + "apiVersion": "2016-09-01", + "scope": "[format('Microsoft.Storage/storageAccounts/{0}', format('{0}single-resource-name', parameters('name')))]", + "name": "single-resource-lock", + "properties": { + "level": "CanNotDelete" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}single-resource-name', parameters('name')))]" + ] + }, + { + "type": "Microsoft.Authorization/locks", + "apiVersion": "2016-09-01", + "scope": "[extensionResourceId(format('Microsoft.Storage/storageAccounts/{0}', format('{0}single-resource-name', parameters('name'))), 'Microsoft.Authorization/locks', 'single-resource-lock')]", + "name": "single-resource-cascade-extension", + "properties": { + "level": "CanNotDelete" + }, + "dependsOn": [ + "[extensionResourceId(resourceId('Microsoft.Storage/storageAccounts', format('{0}single-resource-name', parameters('name'))), 'Microsoft.Authorization/locks', 'single-resource-lock')]" + ] + }, + { + "copy": { + "name": "storageAccounts", + "count": "[length(parameters('accounts'))]" + }, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[format('{0}-collection-{1}', parameters('name'), parameters('accounts')[copyIndex()].name)]", + "location": "[parameters('accounts')[copyIndex()].location]", + "kind": "StorageV2", + "sku": { + "name": "Standard_LRS" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}single-resource-name', parameters('name')))]" + ] + }, + { + "type": "Microsoft.Authorization/locks", + "apiVersion": "2016-09-01", + "scope": "[format('Microsoft.Storage/storageAccounts/{0}', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[copyIndex()].name))]", + "name": "one-resource-collection-item-lock", + "properties": { + "level": "ReadOnly" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[mod(parameters('index'), 2)].name))]" + ] + }, + { + "copy": { + "name": "extensionCollection", + "count": "[length(range(0, 1))]" + }, + "type": "Microsoft.Authorization/locks", + "apiVersion": "2016-09-01", + "scope": "[format('Microsoft.Storage/storageAccounts/{0}', format('{0}single-resource-name', parameters('name')))]", + "name": "[format('lock-{0}', range(0, 1)[copyIndex()])]", + "properties": { + "level": "[if(equals(range(0, 1)[copyIndex()], 0), 'CanNotDelete', 'ReadOnly')]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}single-resource-name', parameters('name')))]" + ] + }, + { + "copy": { + "name": "lockTheLocks", + "count": "[length(range(0, 1))]" + }, + "type": "Microsoft.Authorization/locks", + "apiVersion": "2016-09-01", + "scope": "[extensionResourceId(format('Microsoft.Storage/storageAccounts/{0}', format('{0}single-resource-name', parameters('name'))), 'Microsoft.Authorization/locks', format('lock-{0}', range(0, 1)[copyIndex()]))]", + "name": "[format('lock-the-lock-{0}', range(0, 1)[copyIndex()])]", + "properties": { + "level": "[if(equals(range(0, 1)[copyIndex()], 0), 'CanNotDelete', 'ReadOnly')]" + }, + "dependsOn": [ + "[extensionResourceId(resourceId('Microsoft.Storage/storageAccounts', format('{0}single-resource-name', parameters('name'))), 'Microsoft.Authorization/locks', format('lock-{0}', range(0, 1)[range(0, 1)[copyIndex()]]))]" + ] + }, + { + "copy": { + "name": "storageAccounts2", + "count": "[length(parameters('accounts'))]" + }, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[format('{0}-collection-{1}', parameters('name'), parameters('accounts')[copyIndex()].name)]", + "location": "[parameters('accounts')[copyIndex()].location]", + "kind": "StorageV2", + "sku": { + "name": "Standard_LRS" + }, + "dependsOn": [ + "storageAccounts" + ] + }, + { + "copy": { + "name": "firstSet", + "count": "[length(range(0, length(parameters('accounts'))))]" + }, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[format('{0}-set1-{1}', parameters('name'), range(0, length(parameters('accounts')))[copyIndex()])]", + "location": "[resourceGroup().location]", + "kind": "StorageV2", + "sku": { + "name": "Standard_LRS" + } + }, + { + "copy": { + "name": "secondSet", + "count": "[length(range(0, length(parameters('accounts'))))]" + }, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[format('{0}-set2-{1}', parameters('name'), range(0, length(parameters('accounts')))[copyIndex()])]", + "location": "[resourceGroup().location]", + "kind": "StorageV2", + "sku": { + "name": "Standard_LRS" + }, + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-set1-{1}', parameters('name'), range(0, length(parameters('accounts')))[range(0, length(parameters('accounts')))[copyIndex()]]))]" + ] + }, + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[format('{0}single-resource-name', parameters('name'))]", + "location": "[resourceGroup().location]", + "kind": "StorageV2", + "sku": { + "name": "Standard_LRS" + }, + "dependsOn": [ + "secondSet" + ] + }, + { + "copy": { + "name": "vnets", + "count": "[length(variables('vnetConfigurations'))]" + }, + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-06-01", + "name": "[variables('vnetConfigurations')[copyIndex()].name]", + "location": "[variables('vnetConfigurations')[copyIndex()].location]" + }, + { + "type": "Microsoft.Network/dnsZones", + "apiVersion": "2018-05-01", + "name": "test", + "location": "global", + "properties": { + "resolutionVirtualNetworks": [ + { + "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetConfigurations')[add(parameters('index'), 1)].name)]" + } + ] + }, + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetConfigurations')[add(parameters('index'), 1)].name)]" + ] + }, + { + "type": "Microsoft.Network/dnsZones", + "apiVersion": "2018-05-01", + "name": "test2", + "location": "global", + "properties": { + "resolutionVirtualNetworks": [ + { + "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetConfigurations')[sub(parameters('index'), 1)].name)]" + }, + { + "id": "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetConfigurations')[mul(parameters('index'), 2)].name)]" + } + ] + }, + "dependsOn": [ + "vnets" + ] + }, + { + "copy": { + "name": "duplicatedNames", + "count": "[length(createArray())]" + }, + "type": "Microsoft.Network/dnsZones", + "apiVersion": "2018-05-01", + "name": "no loop variable", + "location": "eastus" + }, + { + "copy": { + "name": "referenceToDuplicateNames", + "count": "[length(createArray())]" + }, + "type": "Microsoft.Network/dnsZones", + "apiVersion": "2018-05-01", + "name": "no loop variable", + "location": "eastus", + "dependsOn": [ + "[resourceId('Microsoft.Network/dnsZones', 'no loop variable')]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "test", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "myInput": { + "value": "hello" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "myInput": { + "type": "string" + } + }, + "functions": [], + "resources": [], + "outputs": { + "myOutput": { + "type": "string", + "value": "[parameters('myInput')]" + } + } + } + } + }, + { + "copy": { + "name": "moduleCollectionWithSingleDependency", + "count": "[length(variables('moduleSetup'))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[variables('moduleSetup')[copyIndex()]]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "myInput": { + "value": "[format('in-{0}', variables('moduleSetup')[copyIndex()])]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "myInput": { + "type": "string" + } + }, + "functions": [], + "resources": [], + "outputs": { + "myOutput": { + "type": "string", + "value": "[parameters('myInput')]" + } + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', 'test')]", + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}single-resource-name', parameters('name')))]" + ] + }, + { + "copy": { + "name": "moduleCollectionWithCollectionDependencies", + "count": "[length(variables('moduleSetup'))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[variables('moduleSetup')[copyIndex()]]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "myInput": { + "value": "[format('in-{0}', variables('moduleSetup')[copyIndex()])]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "myInput": { + "type": "string" + } + }, + "functions": [], + "resources": [], + "outputs": { + "myOutput": { + "type": "string", + "value": "[parameters('myInput')]" + } + } + } + }, + "dependsOn": [ + "moduleCollectionWithSingleDependency", + "storageAccounts" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "hello", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "myInput": { + "value": "[concat(reference(resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[parameters('index')]), '2019-10-01').outputs.myOutput.value, reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[mul(parameters('index'), 3)].name))).accessTier)]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "myInput": { + "type": "string" + } + }, + "functions": [], + "resources": [], + "outputs": { + "myOutput": { + "type": "string", + "value": "[parameters('myInput')]" + } + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[parameters('index')])]", + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[mul(parameters('index'), 3)].name))]", + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[sub(parameters('index'), 10)].name))]" + ] + }, + { + "copy": { + "name": "moduleCollectionWithIndexedDependencies", + "count": "[length(variables('moduleSetup'))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[variables('moduleSetup')[copyIndex()]]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "myInput": { + "value": "[format('{0} - {1} - {2}', reference(resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[parameters('index')]), '2019-10-01').outputs.myOutput.value, reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[mul(parameters('index'), 3)].name))).accessTier, variables('moduleSetup')[copyIndex()])]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "myInput": { + "type": "string" + } + }, + "functions": [], + "resources": [], + "outputs": { + "myOutput": { + "type": "string", + "value": "[parameters('myInput')]" + } + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[parameters('index')])]", + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[mul(parameters('index'), 3)].name))]", + "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[sub(parameters('index'), 9)].name))]" + ] + } + ], + "outputs": { + "indexedCollectionBlobEndpoint": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[parameters('index')].name))).primaryEndpoints.blob]" + }, + "indexedCollectionName": { + "type": "string", + "value": "[format('{0}-collection-{1}', parameters('name'), parameters('accounts')[parameters('index')].name)]" + }, + "indexedCollectionId": { + "type": "string", + "value": "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[parameters('index')].name))]" + }, + "indexedCollectionType": { + "type": "string", + "value": "Microsoft.Storage/storageAccounts" + }, + "indexedCollectionVersion": { + "type": "string", + "value": "2019-06-01" + }, + "indexedCollectionIdentity": { + "type": "object", + "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[parameters('index')].name)), '2019-06-01', 'full').identity]" + }, + "indexedEndpointPair": { + "type": "object", + "value": { + "primary": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[parameters('index')].name))).primaryEndpoints.blob]", + "secondary": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[add(parameters('index'), 1)].name))).secondaryEndpoints.blob]" + } + }, + "indexViaReference": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[int(reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-collection-{1}', parameters('name'), parameters('accounts')[parameters('index')].name))).creationTime)].name))).accessTier]" + }, + "indexedModulesName": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[parameters('index')]), '2019-10-01').outputs.name]" + }, + "indexedModuleOutput": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', variables('moduleSetup')[mul(parameters('index'), 1)]), '2019-10-01').outputs.myOutput.value]" + }, + "existingIndexedResourceName": { + "type": "string", + "value": "[format('{0}-existing-{1}', parameters('name'), parameters('accounts')[mul(parameters('index'), 0)].name)]" + }, + "existingIndexedResourceId": { + "type": "string", + "value": "[resourceId('Microsoft.Storage/storageAccounts', format('{0}-existing-{1}', parameters('name'), parameters('accounts')[mul(parameters('index'), 1)].name))]" + }, + "existingIndexedResourceType": { + "type": "string", + "value": "Microsoft.Storage/storageAccounts" + }, + "existingIndexedResourceApiVersion": { + "type": "string", + "value": "2019-06-01" + }, + "existingIndexedResourceLocation": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-existing-{1}', parameters('name'), parameters('accounts')[div(parameters('index'), 2)].name)), '2019-06-01', 'full').location]" + }, + "existingIndexedResourceAccessTier": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Storage/storageAccounts', format('{0}-existing-{1}', parameters('name'), parameters('accounts')[mod(parameters('index'), 3)].name)), '2019-06-01').accessTier]" + } + }, + "metadata": { + "_generator": { + "name": "bicep", + "version": "dev", + "templateHash": "3867827760539149194" + } + } +} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/main.symbols.bicep new file mode 100644 index 00000000000..81757ba78b5 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.symbols.bicep @@ -0,0 +1,331 @@ +param name string +//@[6:10) Parameter name. Type: string. Declaration start char: 0, length: 17 +param accounts array +//@[6:14) Parameter accounts. Type: array. Declaration start char: 0, length: 20 +param index int +//@[6:11) Parameter index. Type: int. Declaration start char: 0, length: 15 + +// single resource +resource singleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { +//@[9:23) Resource singleResource. Type: Microsoft.Storage/storageAccounts@2019-06-01. Declaration start char: 0, length: 209 + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +} + +// extension of single resource +resource singleResourceExtension 'Microsoft.Authorization/locks@2016-09-01' = { +//@[9:32) Resource singleResourceExtension. Type: Microsoft.Authorization/locks@2016-09-01. Declaration start char: 0, length: 182 + scope: singleResource + name: 'single-resource-lock' + properties: { + level: 'CanNotDelete' + } +} + +// single resource cascade extension +resource singleResourceCascadeExtension 'Microsoft.Authorization/locks@2016-09-01' = { +//@[9:39) Resource singleResourceCascadeExtension. Type: Microsoft.Authorization/locks@2016-09-01. Declaration start char: 0, length: 211 + scope: singleResourceExtension + name: 'single-resource-cascade-extension' + properties: { + level: 'CanNotDelete' + } +} + +// resource collection +resource storageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { +//@[79:86) Local account. Type: any. Declaration start char: 79, length: 7 +//@[9:24) Resource storageAccounts. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 274 + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + singleResource + ] +}] + +// extension of a single resource in a collection +resource extendSingleResourceInCollection 'Microsoft.Authorization/locks@2016-09-01' = { +//@[9:41) Resource extendSingleResourceInCollection. Type: Microsoft.Authorization/locks@2016-09-01. Declaration start char: 0, length: 212 + name: 'one-resource-collection-item-lock' + properties: { + level: 'ReadOnly' + } + scope: storageAccounts[index % 2] +} + +// collection of extensions +resource extensionCollection 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { +//@[79:80) Local i. Type: int. Declaration start char: 79, length: 1 +//@[9:28) Resource extensionCollection. Type: Microsoft.Authorization/locks@2016-09-01[]. Declaration start char: 0, length: 212 + name: 'lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: singleResource +}] + +// cascade extend the extension +resource lockTheLocks 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { +//@[72:73) Local i. Type: int. Declaration start char: 72, length: 1 +//@[9:21) Resource lockTheLocks. Type: Microsoft.Authorization/locks@2016-09-01[]. Declaration start char: 0, length: 222 + name: 'lock-the-lock-${i}' + properties: { + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' + } + scope: extensionCollection[i] +}] + +// special case property access +output indexedCollectionBlobEndpoint string = storageAccounts[index].properties.primaryEndpoints.blob +//@[7:36) Output indexedCollectionBlobEndpoint. Type: string. Declaration start char: 0, length: 101 +output indexedCollectionName string = storageAccounts[index].name +//@[7:28) Output indexedCollectionName. Type: string. Declaration start char: 0, length: 65 +output indexedCollectionId string = storageAccounts[index].id +//@[7:26) Output indexedCollectionId. Type: string. Declaration start char: 0, length: 61 +output indexedCollectionType string = storageAccounts[index].type +//@[7:28) Output indexedCollectionType. Type: string. Declaration start char: 0, length: 65 +output indexedCollectionVersion string = storageAccounts[index].apiVersion +//@[7:31) Output indexedCollectionVersion. Type: string. Declaration start char: 0, length: 74 + +// general case property access +output indexedCollectionIdentity object = storageAccounts[index].identity +//@[7:32) Output indexedCollectionIdentity. Type: object. Declaration start char: 0, length: 73 + +// indexed access of two properties +output indexedEndpointPair object = { +//@[7:26) Output indexedEndpointPair. Type: object. Declaration start char: 0, length: 181 + primary: storageAccounts[index].properties.primaryEndpoints.blob + secondary: storageAccounts[index + 1].properties.secondaryEndpoints.blob +} + +// nested indexer? +output indexViaReference string = storageAccounts[int(storageAccounts[index].properties.creationTime)].properties.accessTier +//@[7:24) Output indexViaReference. Type: string. Declaration start char: 0, length: 124 + +// dependency on a resource collection +resource storageAccounts2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { +//@[80:87) Local account. Type: any. Declaration start char: 80, length: 7 +//@[9:25) Resource storageAccounts2. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 276 + name: '${name}-collection-${account.name}' + location: account.location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + storageAccounts + ] +}] + +// one-to-one paired dependencies +resource firstSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { +//@[72:73) Local i. Type: int. Declaration start char: 72, length: 1 +//@[9:17) Resource firstSet. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 232 + name: '${name}-set1-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } +}] + +resource secondSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { +//@[73:74) Local i. Type: int. Declaration start char: 73, length: 1 +//@[9:18) Resource secondSet. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 268 + name: '${name}-set2-${i}' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + firstSet[i] + ] +}] + +// depending on collection and one resource in the collection optimizes the latter part away +resource anotherSingleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { +//@[9:30) Resource anotherSingleResource. Type: Microsoft.Storage/storageAccounts@2019-06-01. Declaration start char: 0, length: 266 + name: '${name}single-resource-name' + location: resourceGroup().location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + dependsOn: [ + secondSet + secondSet[0] + ] +} + +// vnets +var vnetConfigurations = [ +//@[4:22) Variable vnetConfigurations. Type: array. Declaration start char: 0, length: 138 + { + name: 'one' + location: resourceGroup().location + } + { + name: 'two' + location: 'westus' + } +] + +resource vnets 'Microsoft.Network/virtualNetworks@2020-06-01' = [for vnetConfig in vnetConfigurations: { +//@[69:79) Local vnetConfig. Type: any. Declaration start char: 69, length: 10 +//@[9:14) Resource vnets. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 163 + name: vnetConfig.name + location: vnetConfig.location +}] + +// implicit dependency on single resource from a resource collection +resource implicitDependencyOnSingleResourceByIndex 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[9:50) Resource implicitDependencyOnSingleResourceByIndex. Type: Microsoft.Network/dnsZones@2018-05-01. Declaration start char: 0, length: 237 + name: 'test' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index+1].id + } + ] + } +} + +// implicit and explicit dependency combined +resource combinedDependencies 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[9:29) Resource combinedDependencies. Type: Microsoft.Network/dnsZones@2018-05-01. Declaration start char: 0, length: 294 + name: 'test2' + location: 'global' + properties: { + resolutionVirtualNetworks: [ + { + id: vnets[index-1].id + } + { + id: vnets[index * 2].id + } + ] + } + dependsOn: [ + vnets + ] +} + +// single module +module singleModule 'passthrough.bicep' = { +//@[7:19) Module singleModule. Type: module. Declaration start char: 0, length: 97 + name: 'test' + params: { + myInput: 'hello' + } +} + +var moduleSetup = [ +//@[4:15) Variable moduleSetup. Type: array. Declaration start char: 0, length: 47 + 'one' + 'two' + 'three' +] + +// module collection plus explicit dependency on single module +module moduleCollectionWithSingleDependency 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[71:81) Local moduleName. Type: any. Declaration start char: 71, length: 10 +//@[7:43) Module moduleCollectionWithSingleDependency. Type: module[]. Declaration start char: 0, length: 224 + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + singleModule + singleResource + ] +}] + +// another module collection with dependency on another module collection +module moduleCollectionWithCollectionDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[77:87) Local moduleName. Type: any. Declaration start char: 77, length: 10 +//@[7:49) Module moduleCollectionWithCollectionDependencies. Type: module[]. Declaration start char: 0, length: 255 + name: moduleName + params: { + myInput: 'in-${moduleName}' + } + dependsOn: [ + storageAccounts + moduleCollectionWithSingleDependency + ] +}] + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { +//@[7:42) Module singleModuleWithIndexedDependencies. Type: module. Declaration start char: 0, length: 290 + name: 'hello' + params: { + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) + } + dependsOn: [ + storageAccounts2[index - 10] + ] +} + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[74:84) Local moduleName. Type: any. Declaration start char: 74, length: 10 +//@[7:46) Module moduleCollectionWithIndexedDependencies. Type: module[]. Declaration start char: 0, length: 346 + name: moduleName + params: { + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' + } + dependsOn: [ + storageAccounts2[index - 9] + ] +}] + +output indexedModulesName string = moduleCollectionWithSingleDependency[index].name +//@[7:25) Output indexedModulesName. Type: string. Declaration start char: 0, length: 83 +output indexedModuleOutput string = moduleCollectionWithSingleDependency[index * 1].outputs.myOutput +//@[7:26) Output indexedModuleOutput. Type: string. Declaration start char: 0, length: 100 + +// resource collection +resource existingStorageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' existing = [for account in accounts: { +//@[96:103) Local account. Type: any. Declaration start char: 96, length: 7 +//@[9:32) Resource existingStorageAccounts. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 164 + name: '${name}-existing-${account.name}' +}] + +output existingIndexedResourceName string = existingStorageAccounts[index * 0].name +//@[7:34) Output existingIndexedResourceName. Type: string. Declaration start char: 0, length: 83 +output existingIndexedResourceId string = existingStorageAccounts[index * 1].id +//@[7:32) Output existingIndexedResourceId. Type: string. Declaration start char: 0, length: 79 +output existingIndexedResourceType string = existingStorageAccounts[index+2].type +//@[7:34) Output existingIndexedResourceType. Type: string. Declaration start char: 0, length: 81 +output existingIndexedResourceApiVersion string = existingStorageAccounts[index-7].apiVersion +//@[7:40) Output existingIndexedResourceApiVersion. Type: string. Declaration start char: 0, length: 93 +output existingIndexedResourceLocation string = existingStorageAccounts[index/2].location +//@[7:38) Output existingIndexedResourceLocation. Type: string. Declaration start char: 0, length: 89 +output existingIndexedResourceAccessTier string = existingStorageAccounts[index%3].properties.accessTier +//@[7:40) Output existingIndexedResourceAccessTier. Type: string. Declaration start char: 0, length: 104 + +resource duplicatedNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { +//@[72:76) Local zone. Type: any. Declaration start char: 72, length: 4 +//@[9:24) Resource duplicatedNames. Type: Microsoft.Network/dnsZones@2018-05-01[]. Declaration start char: 0, length: 136 + name: 'no loop variable' + location: 'eastus' +}] + +// reference to a resource collection whose name expression does not reference any loop variables +resource referenceToDuplicateNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { +//@[82:86) Local zone. Type: any. Declaration start char: 82, length: 4 +//@[9:34) Resource referenceToDuplicateNames. Type: Microsoft.Network/dnsZones@2018-05-01[]. Declaration start char: 0, length: 192 + name: 'no loop variable' + location: 'eastus' + dependsOn: [ + duplicatedNames[index] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/main.syntax.bicep new file mode 100644 index 00000000000..4ad9f414072 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.syntax.bicep @@ -0,0 +1,2455 @@ +param name string +//@[0:17) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:10) IdentifierSyntax +//@[6:10) Identifier |name| +//@[11:17) TypeSyntax +//@[11:17) Identifier |string| +//@[17:18) NewLine |\n| +param accounts array +//@[0:20) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:14) IdentifierSyntax +//@[6:14) Identifier |accounts| +//@[15:20) TypeSyntax +//@[15:20) Identifier |array| +//@[20:21) NewLine |\n| +param index int +//@[0:15) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:11) IdentifierSyntax +//@[6:11) Identifier |index| +//@[12:15) TypeSyntax +//@[12:15) Identifier |int| +//@[15:17) NewLine |\n\n| + +// single resource +//@[18:19) NewLine |\n| +resource singleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { +//@[0:209) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:23) IdentifierSyntax +//@[9:23) Identifier |singleResource| +//@[24:70) StringSyntax +//@[24:70) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[71:72) Assignment |=| +//@[73:209) ObjectSyntax +//@[73:74) LeftBrace |{| +//@[74:75) NewLine |\n| + name: '${name}single-resource-name' +//@[2:37) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:37) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:37) StringRightPiece |}single-resource-name'| +//@[37:38) NewLine |\n| + location: resourceGroup().location +//@[2:36) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:36) PropertyAccessSyntax +//@[12:27) FunctionCallSyntax +//@[12:25) IdentifierSyntax +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) IdentifierSyntax +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:37) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:37) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// extension of single resource +//@[31:32) NewLine |\n| +resource singleResourceExtension 'Microsoft.Authorization/locks@2016-09-01' = { +//@[0:182) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:32) IdentifierSyntax +//@[9:32) Identifier |singleResourceExtension| +//@[33:75) StringSyntax +//@[33:75) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[76:77) Assignment |=| +//@[78:182) ObjectSyntax +//@[78:79) LeftBrace |{| +//@[79:80) NewLine |\n| + scope: singleResource +//@[2:23) ObjectPropertySyntax +//@[2:7) IdentifierSyntax +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:23) VariableAccessSyntax +//@[9:23) IdentifierSyntax +//@[9:23) Identifier |singleResource| +//@[23:24) NewLine |\n| + name: 'single-resource-lock' +//@[2:30) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:30) StringSyntax +//@[8:30) StringComplete |'single-resource-lock'| +//@[30:31) NewLine |\n| + properties: { +//@[2:45) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:45) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: 'CanNotDelete' +//@[4:25) ObjectPropertySyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:25) StringSyntax +//@[11:25) StringComplete |'CanNotDelete'| +//@[25:26) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// single resource cascade extension +//@[36:37) NewLine |\n| +resource singleResourceCascadeExtension 'Microsoft.Authorization/locks@2016-09-01' = { +//@[0:211) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:39) IdentifierSyntax +//@[9:39) Identifier |singleResourceCascadeExtension| +//@[40:82) StringSyntax +//@[40:82) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[83:84) Assignment |=| +//@[85:211) ObjectSyntax +//@[85:86) LeftBrace |{| +//@[86:87) NewLine |\n| + scope: singleResourceExtension +//@[2:32) ObjectPropertySyntax +//@[2:7) IdentifierSyntax +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:32) VariableAccessSyntax +//@[9:32) IdentifierSyntax +//@[9:32) Identifier |singleResourceExtension| +//@[32:33) NewLine |\n| + name: 'single-resource-cascade-extension' +//@[2:43) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:43) StringSyntax +//@[8:43) StringComplete |'single-resource-cascade-extension'| +//@[43:44) NewLine |\n| + properties: { +//@[2:45) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:45) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: 'CanNotDelete' +//@[4:25) ObjectPropertySyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:25) StringSyntax +//@[11:25) StringComplete |'CanNotDelete'| +//@[25:26) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// resource collection +//@[22:23) NewLine |\n| +resource storageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { +//@[0:274) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:24) IdentifierSyntax +//@[9:24) Identifier |storageAccounts| +//@[25:71) StringSyntax +//@[25:71) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[72:73) Assignment |=| +//@[74:274) ForSyntax +//@[74:75) LeftSquare |[| +//@[75:78) Identifier |for| +//@[79:86) LocalVariableSyntax +//@[79:86) IdentifierSyntax +//@[79:86) Identifier |account| +//@[87:89) Identifier |in| +//@[90:98) VariableAccessSyntax +//@[90:98) IdentifierSyntax +//@[90:98) Identifier |accounts| +//@[98:99) Colon |:| +//@[100:273) ObjectSyntax +//@[100:101) LeftBrace |{| +//@[101:102) NewLine |\n| + name: '${name}-collection-${account.name}' +//@[2:44) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:44) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:30) StringMiddlePiece |}-collection-${| +//@[30:42) PropertyAccessSyntax +//@[30:37) VariableAccessSyntax +//@[30:37) IdentifierSyntax +//@[30:37) Identifier |account| +//@[37:38) Dot |.| +//@[38:42) IdentifierSyntax +//@[38:42) Identifier |name| +//@[42:44) StringRightPiece |}'| +//@[44:45) NewLine |\n| + location: account.location +//@[2:28) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:28) PropertyAccessSyntax +//@[12:19) VariableAccessSyntax +//@[12:19) IdentifierSyntax +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) IdentifierSyntax +//@[20:28) Identifier |location| +//@[28:29) NewLine |\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:37) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:37) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:37) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:37) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + singleResource +//@[4:18) ArrayItemSyntax +//@[4:18) VariableAccessSyntax +//@[4:18) IdentifierSyntax +//@[4:18) Identifier |singleResource| +//@[18:19) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// extension of a single resource in a collection +//@[49:50) NewLine |\n| +resource extendSingleResourceInCollection 'Microsoft.Authorization/locks@2016-09-01' = { +//@[0:212) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:41) IdentifierSyntax +//@[9:41) Identifier |extendSingleResourceInCollection| +//@[42:84) StringSyntax +//@[42:84) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[85:86) Assignment |=| +//@[87:212) ObjectSyntax +//@[87:88) LeftBrace |{| +//@[88:89) NewLine |\n| + name: 'one-resource-collection-item-lock' +//@[2:43) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:43) StringSyntax +//@[8:43) StringComplete |'one-resource-collection-item-lock'| +//@[43:44) NewLine |\n| + properties: { +//@[2:41) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:41) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: 'ReadOnly' +//@[4:21) ObjectPropertySyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:21) StringSyntax +//@[11:21) StringComplete |'ReadOnly'| +//@[21:22) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + scope: storageAccounts[index % 2] +//@[2:35) ObjectPropertySyntax +//@[2:7) IdentifierSyntax +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:35) ArrayAccessSyntax +//@[9:24) VariableAccessSyntax +//@[9:24) IdentifierSyntax +//@[9:24) Identifier |storageAccounts| +//@[24:25) LeftSquare |[| +//@[25:34) BinaryOperationSyntax +//@[25:30) VariableAccessSyntax +//@[25:30) IdentifierSyntax +//@[25:30) Identifier |index| +//@[31:32) Modulo |%| +//@[33:34) IntegerLiteralSyntax +//@[33:34) Integer |2| +//@[34:35) RightSquare |]| +//@[35:36) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// collection of extensions +//@[27:28) NewLine |\n| +resource extensionCollection 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { +//@[0:212) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:28) IdentifierSyntax +//@[9:28) Identifier |extensionCollection| +//@[29:71) StringSyntax +//@[29:71) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[72:73) Assignment |=| +//@[74:212) ForSyntax +//@[74:75) LeftSquare |[| +//@[75:78) Identifier |for| +//@[79:80) LocalVariableSyntax +//@[79:80) IdentifierSyntax +//@[79:80) Identifier |i| +//@[81:83) Identifier |in| +//@[84:94) FunctionCallSyntax +//@[84:89) IdentifierSyntax +//@[84:89) Identifier |range| +//@[89:90) LeftParen |(| +//@[90:92) FunctionArgumentSyntax +//@[90:91) IntegerLiteralSyntax +//@[90:91) Integer |0| +//@[91:92) Comma |,| +//@[92:93) FunctionArgumentSyntax +//@[92:93) IntegerLiteralSyntax +//@[92:93) Integer |1| +//@[93:94) RightParen |)| +//@[94:95) Colon |:| +//@[96:211) ObjectSyntax +//@[96:97) LeftBrace |{| +//@[97:98) NewLine |\n| + name: 'lock-${i}' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:16) StringLeftPiece |'lock-${| +//@[16:17) VariableAccessSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:20) NewLine |\n| + properties: { +//@[2:67) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:67) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' +//@[4:47) ObjectPropertySyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:47) TernaryOperationSyntax +//@[11:17) BinaryOperationSyntax +//@[11:12) VariableAccessSyntax +//@[11:12) IdentifierSyntax +//@[11:12) Identifier |i| +//@[13:15) Equals |==| +//@[16:17) IntegerLiteralSyntax +//@[16:17) Integer |0| +//@[18:19) Question |?| +//@[20:34) StringSyntax +//@[20:34) StringComplete |'CanNotDelete'| +//@[35:36) Colon |:| +//@[37:47) StringSyntax +//@[37:47) StringComplete |'ReadOnly'| +//@[47:48) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + scope: singleResource +//@[2:23) ObjectPropertySyntax +//@[2:7) IdentifierSyntax +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:23) VariableAccessSyntax +//@[9:23) IdentifierSyntax +//@[9:23) Identifier |singleResource| +//@[23:24) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// cascade extend the extension +//@[31:32) NewLine |\n| +resource lockTheLocks 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { +//@[0:222) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:21) IdentifierSyntax +//@[9:21) Identifier |lockTheLocks| +//@[22:64) StringSyntax +//@[22:64) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[65:66) Assignment |=| +//@[67:222) ForSyntax +//@[67:68) LeftSquare |[| +//@[68:71) Identifier |for| +//@[72:73) LocalVariableSyntax +//@[72:73) IdentifierSyntax +//@[72:73) Identifier |i| +//@[74:76) Identifier |in| +//@[77:87) FunctionCallSyntax +//@[77:82) IdentifierSyntax +//@[77:82) Identifier |range| +//@[82:83) LeftParen |(| +//@[83:85) FunctionArgumentSyntax +//@[83:84) IntegerLiteralSyntax +//@[83:84) Integer |0| +//@[84:85) Comma |,| +//@[85:86) FunctionArgumentSyntax +//@[85:86) IntegerLiteralSyntax +//@[85:86) Integer |1| +//@[86:87) RightParen |)| +//@[87:88) Colon |:| +//@[89:221) ObjectSyntax +//@[89:90) LeftBrace |{| +//@[90:91) NewLine |\n| + name: 'lock-the-lock-${i}' +//@[2:28) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:28) StringSyntax +//@[8:25) StringLeftPiece |'lock-the-lock-${| +//@[25:26) VariableAccessSyntax +//@[25:26) IdentifierSyntax +//@[25:26) Identifier |i| +//@[26:28) StringRightPiece |}'| +//@[28:29) NewLine |\n| + properties: { +//@[2:67) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:67) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' +//@[4:47) ObjectPropertySyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:47) TernaryOperationSyntax +//@[11:17) BinaryOperationSyntax +//@[11:12) VariableAccessSyntax +//@[11:12) IdentifierSyntax +//@[11:12) Identifier |i| +//@[13:15) Equals |==| +//@[16:17) IntegerLiteralSyntax +//@[16:17) Integer |0| +//@[18:19) Question |?| +//@[20:34) StringSyntax +//@[20:34) StringComplete |'CanNotDelete'| +//@[35:36) Colon |:| +//@[37:47) StringSyntax +//@[37:47) StringComplete |'ReadOnly'| +//@[47:48) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + scope: extensionCollection[i] +//@[2:31) ObjectPropertySyntax +//@[2:7) IdentifierSyntax +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:31) ArrayAccessSyntax +//@[9:28) VariableAccessSyntax +//@[9:28) IdentifierSyntax +//@[9:28) Identifier |extensionCollection| +//@[28:29) LeftSquare |[| +//@[29:30) VariableAccessSyntax +//@[29:30) IdentifierSyntax +//@[29:30) Identifier |i| +//@[30:31) RightSquare |]| +//@[31:32) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// special case property access +//@[31:32) NewLine |\n| +output indexedCollectionBlobEndpoint string = storageAccounts[index].properties.primaryEndpoints.blob +//@[0:101) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:36) IdentifierSyntax +//@[7:36) Identifier |indexedCollectionBlobEndpoint| +//@[37:43) TypeSyntax +//@[37:43) Identifier |string| +//@[44:45) Assignment |=| +//@[46:101) PropertyAccessSyntax +//@[46:96) PropertyAccessSyntax +//@[46:79) PropertyAccessSyntax +//@[46:68) ArrayAccessSyntax +//@[46:61) VariableAccessSyntax +//@[46:61) IdentifierSyntax +//@[46:61) Identifier |storageAccounts| +//@[61:62) LeftSquare |[| +//@[62:67) VariableAccessSyntax +//@[62:67) IdentifierSyntax +//@[62:67) Identifier |index| +//@[67:68) RightSquare |]| +//@[68:69) Dot |.| +//@[69:79) IdentifierSyntax +//@[69:79) Identifier |properties| +//@[79:80) Dot |.| +//@[80:96) IdentifierSyntax +//@[80:96) Identifier |primaryEndpoints| +//@[96:97) Dot |.| +//@[97:101) IdentifierSyntax +//@[97:101) Identifier |blob| +//@[101:102) NewLine |\n| +output indexedCollectionName string = storageAccounts[index].name +//@[0:65) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:28) IdentifierSyntax +//@[7:28) Identifier |indexedCollectionName| +//@[29:35) TypeSyntax +//@[29:35) Identifier |string| +//@[36:37) Assignment |=| +//@[38:65) PropertyAccessSyntax +//@[38:60) ArrayAccessSyntax +//@[38:53) VariableAccessSyntax +//@[38:53) IdentifierSyntax +//@[38:53) Identifier |storageAccounts| +//@[53:54) LeftSquare |[| +//@[54:59) VariableAccessSyntax +//@[54:59) IdentifierSyntax +//@[54:59) Identifier |index| +//@[59:60) RightSquare |]| +//@[60:61) Dot |.| +//@[61:65) IdentifierSyntax +//@[61:65) Identifier |name| +//@[65:66) NewLine |\n| +output indexedCollectionId string = storageAccounts[index].id +//@[0:61) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:26) IdentifierSyntax +//@[7:26) Identifier |indexedCollectionId| +//@[27:33) TypeSyntax +//@[27:33) Identifier |string| +//@[34:35) Assignment |=| +//@[36:61) PropertyAccessSyntax +//@[36:58) ArrayAccessSyntax +//@[36:51) VariableAccessSyntax +//@[36:51) IdentifierSyntax +//@[36:51) Identifier |storageAccounts| +//@[51:52) LeftSquare |[| +//@[52:57) VariableAccessSyntax +//@[52:57) IdentifierSyntax +//@[52:57) Identifier |index| +//@[57:58) RightSquare |]| +//@[58:59) Dot |.| +//@[59:61) IdentifierSyntax +//@[59:61) Identifier |id| +//@[61:62) NewLine |\n| +output indexedCollectionType string = storageAccounts[index].type +//@[0:65) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:28) IdentifierSyntax +//@[7:28) Identifier |indexedCollectionType| +//@[29:35) TypeSyntax +//@[29:35) Identifier |string| +//@[36:37) Assignment |=| +//@[38:65) PropertyAccessSyntax +//@[38:60) ArrayAccessSyntax +//@[38:53) VariableAccessSyntax +//@[38:53) IdentifierSyntax +//@[38:53) Identifier |storageAccounts| +//@[53:54) LeftSquare |[| +//@[54:59) VariableAccessSyntax +//@[54:59) IdentifierSyntax +//@[54:59) Identifier |index| +//@[59:60) RightSquare |]| +//@[60:61) Dot |.| +//@[61:65) IdentifierSyntax +//@[61:65) Identifier |type| +//@[65:66) NewLine |\n| +output indexedCollectionVersion string = storageAccounts[index].apiVersion +//@[0:74) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:31) IdentifierSyntax +//@[7:31) Identifier |indexedCollectionVersion| +//@[32:38) TypeSyntax +//@[32:38) Identifier |string| +//@[39:40) Assignment |=| +//@[41:74) PropertyAccessSyntax +//@[41:63) ArrayAccessSyntax +//@[41:56) VariableAccessSyntax +//@[41:56) IdentifierSyntax +//@[41:56) Identifier |storageAccounts| +//@[56:57) LeftSquare |[| +//@[57:62) VariableAccessSyntax +//@[57:62) IdentifierSyntax +//@[57:62) Identifier |index| +//@[62:63) RightSquare |]| +//@[63:64) Dot |.| +//@[64:74) IdentifierSyntax +//@[64:74) Identifier |apiVersion| +//@[74:76) NewLine |\n\n| + +// general case property access +//@[31:32) NewLine |\n| +output indexedCollectionIdentity object = storageAccounts[index].identity +//@[0:73) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:32) IdentifierSyntax +//@[7:32) Identifier |indexedCollectionIdentity| +//@[33:39) TypeSyntax +//@[33:39) Identifier |object| +//@[40:41) Assignment |=| +//@[42:73) PropertyAccessSyntax +//@[42:64) ArrayAccessSyntax +//@[42:57) VariableAccessSyntax +//@[42:57) IdentifierSyntax +//@[42:57) Identifier |storageAccounts| +//@[57:58) LeftSquare |[| +//@[58:63) VariableAccessSyntax +//@[58:63) IdentifierSyntax +//@[58:63) Identifier |index| +//@[63:64) RightSquare |]| +//@[64:65) Dot |.| +//@[65:73) IdentifierSyntax +//@[65:73) Identifier |identity| +//@[73:75) NewLine |\n\n| + +// indexed access of two properties +//@[35:36) NewLine |\n| +output indexedEndpointPair object = { +//@[0:181) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:26) IdentifierSyntax +//@[7:26) Identifier |indexedEndpointPair| +//@[27:33) TypeSyntax +//@[27:33) Identifier |object| +//@[34:35) Assignment |=| +//@[36:181) ObjectSyntax +//@[36:37) LeftBrace |{| +//@[37:38) NewLine |\n| + primary: storageAccounts[index].properties.primaryEndpoints.blob +//@[2:66) ObjectPropertySyntax +//@[2:9) IdentifierSyntax +//@[2:9) Identifier |primary| +//@[9:10) Colon |:| +//@[11:66) PropertyAccessSyntax +//@[11:61) PropertyAccessSyntax +//@[11:44) PropertyAccessSyntax +//@[11:33) ArrayAccessSyntax +//@[11:26) VariableAccessSyntax +//@[11:26) IdentifierSyntax +//@[11:26) Identifier |storageAccounts| +//@[26:27) LeftSquare |[| +//@[27:32) VariableAccessSyntax +//@[27:32) IdentifierSyntax +//@[27:32) Identifier |index| +//@[32:33) RightSquare |]| +//@[33:34) Dot |.| +//@[34:44) IdentifierSyntax +//@[34:44) Identifier |properties| +//@[44:45) Dot |.| +//@[45:61) IdentifierSyntax +//@[45:61) Identifier |primaryEndpoints| +//@[61:62) Dot |.| +//@[62:66) IdentifierSyntax +//@[62:66) Identifier |blob| +//@[66:67) NewLine |\n| + secondary: storageAccounts[index + 1].properties.secondaryEndpoints.blob +//@[2:74) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |secondary| +//@[11:12) Colon |:| +//@[13:74) PropertyAccessSyntax +//@[13:69) PropertyAccessSyntax +//@[13:50) PropertyAccessSyntax +//@[13:39) ArrayAccessSyntax +//@[13:28) VariableAccessSyntax +//@[13:28) IdentifierSyntax +//@[13:28) Identifier |storageAccounts| +//@[28:29) LeftSquare |[| +//@[29:38) BinaryOperationSyntax +//@[29:34) VariableAccessSyntax +//@[29:34) IdentifierSyntax +//@[29:34) Identifier |index| +//@[35:36) Plus |+| +//@[37:38) IntegerLiteralSyntax +//@[37:38) Integer |1| +//@[38:39) RightSquare |]| +//@[39:40) Dot |.| +//@[40:50) IdentifierSyntax +//@[40:50) Identifier |properties| +//@[50:51) Dot |.| +//@[51:69) IdentifierSyntax +//@[51:69) Identifier |secondaryEndpoints| +//@[69:70) Dot |.| +//@[70:74) IdentifierSyntax +//@[70:74) Identifier |blob| +//@[74:75) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// nested indexer? +//@[18:19) NewLine |\n| +output indexViaReference string = storageAccounts[int(storageAccounts[index].properties.creationTime)].properties.accessTier +//@[0:124) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:24) IdentifierSyntax +//@[7:24) Identifier |indexViaReference| +//@[25:31) TypeSyntax +//@[25:31) Identifier |string| +//@[32:33) Assignment |=| +//@[34:124) PropertyAccessSyntax +//@[34:113) PropertyAccessSyntax +//@[34:102) ArrayAccessSyntax +//@[34:49) VariableAccessSyntax +//@[34:49) IdentifierSyntax +//@[34:49) Identifier |storageAccounts| +//@[49:50) LeftSquare |[| +//@[50:101) FunctionCallSyntax +//@[50:53) IdentifierSyntax +//@[50:53) Identifier |int| +//@[53:54) LeftParen |(| +//@[54:100) FunctionArgumentSyntax +//@[54:100) PropertyAccessSyntax +//@[54:87) PropertyAccessSyntax +//@[54:76) ArrayAccessSyntax +//@[54:69) VariableAccessSyntax +//@[54:69) IdentifierSyntax +//@[54:69) Identifier |storageAccounts| +//@[69:70) LeftSquare |[| +//@[70:75) VariableAccessSyntax +//@[70:75) IdentifierSyntax +//@[70:75) Identifier |index| +//@[75:76) RightSquare |]| +//@[76:77) Dot |.| +//@[77:87) IdentifierSyntax +//@[77:87) Identifier |properties| +//@[87:88) Dot |.| +//@[88:100) IdentifierSyntax +//@[88:100) Identifier |creationTime| +//@[100:101) RightParen |)| +//@[101:102) RightSquare |]| +//@[102:103) Dot |.| +//@[103:113) IdentifierSyntax +//@[103:113) Identifier |properties| +//@[113:114) Dot |.| +//@[114:124) IdentifierSyntax +//@[114:124) Identifier |accessTier| +//@[124:126) NewLine |\n\n| + +// dependency on a resource collection +//@[38:39) NewLine |\n| +resource storageAccounts2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { +//@[0:276) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:25) IdentifierSyntax +//@[9:25) Identifier |storageAccounts2| +//@[26:72) StringSyntax +//@[26:72) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[73:74) Assignment |=| +//@[75:276) ForSyntax +//@[75:76) LeftSquare |[| +//@[76:79) Identifier |for| +//@[80:87) LocalVariableSyntax +//@[80:87) IdentifierSyntax +//@[80:87) Identifier |account| +//@[88:90) Identifier |in| +//@[91:99) VariableAccessSyntax +//@[91:99) IdentifierSyntax +//@[91:99) Identifier |accounts| +//@[99:100) Colon |:| +//@[101:275) ObjectSyntax +//@[101:102) LeftBrace |{| +//@[102:103) NewLine |\n| + name: '${name}-collection-${account.name}' +//@[2:44) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:44) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:30) StringMiddlePiece |}-collection-${| +//@[30:42) PropertyAccessSyntax +//@[30:37) VariableAccessSyntax +//@[30:37) IdentifierSyntax +//@[30:37) Identifier |account| +//@[37:38) Dot |.| +//@[38:42) IdentifierSyntax +//@[38:42) Identifier |name| +//@[42:44) StringRightPiece |}'| +//@[44:45) NewLine |\n| + location: account.location +//@[2:28) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:28) PropertyAccessSyntax +//@[12:19) VariableAccessSyntax +//@[12:19) IdentifierSyntax +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) IdentifierSyntax +//@[20:28) Identifier |location| +//@[28:29) NewLine |\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:37) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:37) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:38) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:38) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts +//@[4:19) ArrayItemSyntax +//@[4:19) VariableAccessSyntax +//@[4:19) IdentifierSyntax +//@[4:19) Identifier |storageAccounts| +//@[19:20) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// one-to-one paired dependencies +//@[33:34) NewLine |\n| +resource firstSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { +//@[0:232) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:17) IdentifierSyntax +//@[9:17) Identifier |firstSet| +//@[18:64) StringSyntax +//@[18:64) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[65:66) Assignment |=| +//@[67:232) ForSyntax +//@[67:68) LeftSquare |[| +//@[68:71) Identifier |for| +//@[72:73) LocalVariableSyntax +//@[72:73) IdentifierSyntax +//@[72:73) Identifier |i| +//@[74:76) Identifier |in| +//@[77:103) FunctionCallSyntax +//@[77:82) IdentifierSyntax +//@[77:82) Identifier |range| +//@[82:83) LeftParen |(| +//@[83:85) FunctionArgumentSyntax +//@[83:84) IntegerLiteralSyntax +//@[83:84) Integer |0| +//@[84:85) Comma |,| +//@[86:102) FunctionArgumentSyntax +//@[86:102) FunctionCallSyntax +//@[86:92) IdentifierSyntax +//@[86:92) Identifier |length| +//@[92:93) LeftParen |(| +//@[93:101) FunctionArgumentSyntax +//@[93:101) VariableAccessSyntax +//@[93:101) IdentifierSyntax +//@[93:101) Identifier |accounts| +//@[101:102) RightParen |)| +//@[102:103) RightParen |)| +//@[103:104) Colon |:| +//@[105:231) ObjectSyntax +//@[105:106) LeftBrace |{| +//@[106:107) NewLine |\n| + name: '${name}-set1-${i}' +//@[2:27) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:27) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:24) StringMiddlePiece |}-set1-${| +//@[24:25) VariableAccessSyntax +//@[24:25) IdentifierSyntax +//@[24:25) Identifier |i| +//@[25:27) StringRightPiece |}'| +//@[27:28) NewLine |\n| + location: resourceGroup().location +//@[2:36) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:36) PropertyAccessSyntax +//@[12:27) FunctionCallSyntax +//@[12:25) IdentifierSyntax +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) IdentifierSyntax +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:37) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:37) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +resource secondSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { +//@[0:268) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:18) IdentifierSyntax +//@[9:18) Identifier |secondSet| +//@[19:65) StringSyntax +//@[19:65) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[66:67) Assignment |=| +//@[68:268) ForSyntax +//@[68:69) LeftSquare |[| +//@[69:72) Identifier |for| +//@[73:74) LocalVariableSyntax +//@[73:74) IdentifierSyntax +//@[73:74) Identifier |i| +//@[75:77) Identifier |in| +//@[78:104) FunctionCallSyntax +//@[78:83) IdentifierSyntax +//@[78:83) Identifier |range| +//@[83:84) LeftParen |(| +//@[84:86) FunctionArgumentSyntax +//@[84:85) IntegerLiteralSyntax +//@[84:85) Integer |0| +//@[85:86) Comma |,| +//@[87:103) FunctionArgumentSyntax +//@[87:103) FunctionCallSyntax +//@[87:93) IdentifierSyntax +//@[87:93) Identifier |length| +//@[93:94) LeftParen |(| +//@[94:102) FunctionArgumentSyntax +//@[94:102) VariableAccessSyntax +//@[94:102) IdentifierSyntax +//@[94:102) Identifier |accounts| +//@[102:103) RightParen |)| +//@[103:104) RightParen |)| +//@[104:105) Colon |:| +//@[106:267) ObjectSyntax +//@[106:107) LeftBrace |{| +//@[107:108) NewLine |\n| + name: '${name}-set2-${i}' +//@[2:27) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:27) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:24) StringMiddlePiece |}-set2-${| +//@[24:25) VariableAccessSyntax +//@[24:25) IdentifierSyntax +//@[24:25) Identifier |i| +//@[25:27) StringRightPiece |}'| +//@[27:28) NewLine |\n| + location: resourceGroup().location +//@[2:36) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:36) PropertyAccessSyntax +//@[12:27) FunctionCallSyntax +//@[12:25) IdentifierSyntax +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) IdentifierSyntax +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:37) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:37) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:34) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:34) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + firstSet[i] +//@[4:15) ArrayItemSyntax +//@[4:15) ArrayAccessSyntax +//@[4:12) VariableAccessSyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |firstSet| +//@[12:13) LeftSquare |[| +//@[13:14) VariableAccessSyntax +//@[13:14) IdentifierSyntax +//@[13:14) Identifier |i| +//@[14:15) RightSquare |]| +//@[15:16) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// depending on collection and one resource in the collection optimizes the latter part away +//@[92:93) NewLine |\n| +resource anotherSingleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { +//@[0:266) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:30) IdentifierSyntax +//@[9:30) Identifier |anotherSingleResource| +//@[31:77) StringSyntax +//@[31:77) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[78:79) Assignment |=| +//@[80:266) ObjectSyntax +//@[80:81) LeftBrace |{| +//@[81:82) NewLine |\n| + name: '${name}single-resource-name' +//@[2:37) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:37) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:37) StringRightPiece |}single-resource-name'| +//@[37:38) NewLine |\n| + location: resourceGroup().location +//@[2:36) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:36) PropertyAccessSyntax +//@[12:27) FunctionCallSyntax +//@[12:25) IdentifierSyntax +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) IdentifierSyntax +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:37) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:37) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:49) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:49) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + secondSet +//@[4:13) ArrayItemSyntax +//@[4:13) VariableAccessSyntax +//@[4:13) IdentifierSyntax +//@[4:13) Identifier |secondSet| +//@[13:14) NewLine |\n| + secondSet[0] +//@[4:16) ArrayItemSyntax +//@[4:16) ArrayAccessSyntax +//@[4:13) VariableAccessSyntax +//@[4:13) IdentifierSyntax +//@[4:13) Identifier |secondSet| +//@[13:14) LeftSquare |[| +//@[14:15) IntegerLiteralSyntax +//@[14:15) Integer |0| +//@[15:16) RightSquare |]| +//@[16:17) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// vnets +//@[8:9) NewLine |\n| +var vnetConfigurations = [ +//@[0:138) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:22) IdentifierSyntax +//@[4:22) Identifier |vnetConfigurations| +//@[23:24) Assignment |=| +//@[25:138) ArraySyntax +//@[25:26) LeftSquare |[| +//@[26:27) NewLine |\n| + { +//@[2:62) ArrayItemSyntax +//@[2:62) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:4) NewLine |\n| + name: 'one' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'one'| +//@[15:16) NewLine |\n| + location: resourceGroup().location +//@[4:38) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:38) PropertyAccessSyntax +//@[14:29) FunctionCallSyntax +//@[14:27) IdentifierSyntax +//@[14:27) Identifier |resourceGroup| +//@[27:28) LeftParen |(| +//@[28:29) RightParen |)| +//@[29:30) Dot |.| +//@[30:38) IdentifierSyntax +//@[30:38) Identifier |location| +//@[38:39) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + { +//@[2:46) ArrayItemSyntax +//@[2:46) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:4) NewLine |\n| + name: 'two' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'two'| +//@[15:16) NewLine |\n| + location: 'westus' +//@[4:22) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:22) StringSyntax +//@[14:22) StringComplete |'westus'| +//@[22:23) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +] +//@[0:1) RightSquare |]| +//@[1:3) NewLine |\n\n| + +resource vnets 'Microsoft.Network/virtualNetworks@2020-06-01' = [for vnetConfig in vnetConfigurations: { +//@[0:163) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:14) IdentifierSyntax +//@[9:14) Identifier |vnets| +//@[15:61) StringSyntax +//@[15:61) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[62:63) Assignment |=| +//@[64:163) ForSyntax +//@[64:65) LeftSquare |[| +//@[65:68) Identifier |for| +//@[69:79) LocalVariableSyntax +//@[69:79) IdentifierSyntax +//@[69:79) Identifier |vnetConfig| +//@[80:82) Identifier |in| +//@[83:101) VariableAccessSyntax +//@[83:101) IdentifierSyntax +//@[83:101) Identifier |vnetConfigurations| +//@[101:102) Colon |:| +//@[103:162) ObjectSyntax +//@[103:104) LeftBrace |{| +//@[104:105) NewLine |\n| + name: vnetConfig.name +//@[2:23) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:23) PropertyAccessSyntax +//@[8:18) VariableAccessSyntax +//@[8:18) IdentifierSyntax +//@[8:18) Identifier |vnetConfig| +//@[18:19) Dot |.| +//@[19:23) IdentifierSyntax +//@[19:23) Identifier |name| +//@[23:24) NewLine |\n| + location: vnetConfig.location +//@[2:31) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:31) PropertyAccessSyntax +//@[12:22) VariableAccessSyntax +//@[12:22) IdentifierSyntax +//@[12:22) Identifier |vnetConfig| +//@[22:23) Dot |.| +//@[23:31) IdentifierSyntax +//@[23:31) Identifier |location| +//@[31:32) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// implicit dependency on single resource from a resource collection +//@[68:69) NewLine |\n| +resource implicitDependencyOnSingleResourceByIndex 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[0:237) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:50) IdentifierSyntax +//@[9:50) Identifier |implicitDependencyOnSingleResourceByIndex| +//@[51:90) StringSyntax +//@[51:90) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[91:92) Assignment |=| +//@[93:237) ObjectSyntax +//@[93:94) LeftBrace |{| +//@[94:95) NewLine |\n| + name: 'test' +//@[2:14) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) StringSyntax +//@[8:14) StringComplete |'test'| +//@[14:15) NewLine |\n| + location: 'global' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'global'| +//@[20:21) NewLine |\n| + properties: { +//@[2:104) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:104) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + resolutionVirtualNetworks: [ +//@[4:84) ObjectPropertySyntax +//@[4:29) IdentifierSyntax +//@[4:29) Identifier |resolutionVirtualNetworks| +//@[29:30) Colon |:| +//@[31:84) ArraySyntax +//@[31:32) LeftSquare |[| +//@[32:33) NewLine |\n| + { +//@[6:45) ArrayItemSyntax +//@[6:45) ObjectSyntax +//@[6:7) LeftBrace |{| +//@[7:8) NewLine |\n| + id: vnets[index+1].id +//@[8:29) ObjectPropertySyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:29) PropertyAccessSyntax +//@[12:26) ArrayAccessSyntax +//@[12:17) VariableAccessSyntax +//@[12:17) IdentifierSyntax +//@[12:17) Identifier |vnets| +//@[17:18) LeftSquare |[| +//@[18:25) BinaryOperationSyntax +//@[18:23) VariableAccessSyntax +//@[18:23) IdentifierSyntax +//@[18:23) Identifier |index| +//@[23:24) Plus |+| +//@[24:25) IntegerLiteralSyntax +//@[24:25) Integer |1| +//@[25:26) RightSquare |]| +//@[26:27) Dot |.| +//@[27:29) IdentifierSyntax +//@[27:29) Identifier |id| +//@[29:30) NewLine |\n| + } +//@[6:7) RightBrace |}| +//@[7:8) NewLine |\n| + ] +//@[4:5) RightSquare |]| +//@[5:6) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// implicit and explicit dependency combined +//@[44:45) NewLine |\n| +resource combinedDependencies 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[0:294) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:29) IdentifierSyntax +//@[9:29) Identifier |combinedDependencies| +//@[30:69) StringSyntax +//@[30:69) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[70:71) Assignment |=| +//@[72:294) ObjectSyntax +//@[72:73) LeftBrace |{| +//@[73:74) NewLine |\n| + name: 'test2' +//@[2:15) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringSyntax +//@[8:15) StringComplete |'test2'| +//@[15:16) NewLine |\n| + location: 'global' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'global'| +//@[20:21) NewLine |\n| + properties: { +//@[2:152) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:152) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + resolutionVirtualNetworks: [ +//@[4:132) ObjectPropertySyntax +//@[4:29) IdentifierSyntax +//@[4:29) Identifier |resolutionVirtualNetworks| +//@[29:30) Colon |:| +//@[31:132) ArraySyntax +//@[31:32) LeftSquare |[| +//@[32:33) NewLine |\n| + { +//@[6:45) ArrayItemSyntax +//@[6:45) ObjectSyntax +//@[6:7) LeftBrace |{| +//@[7:8) NewLine |\n| + id: vnets[index-1].id +//@[8:29) ObjectPropertySyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:29) PropertyAccessSyntax +//@[12:26) ArrayAccessSyntax +//@[12:17) VariableAccessSyntax +//@[12:17) IdentifierSyntax +//@[12:17) Identifier |vnets| +//@[17:18) LeftSquare |[| +//@[18:25) BinaryOperationSyntax +//@[18:23) VariableAccessSyntax +//@[18:23) IdentifierSyntax +//@[18:23) Identifier |index| +//@[23:24) Minus |-| +//@[24:25) IntegerLiteralSyntax +//@[24:25) Integer |1| +//@[25:26) RightSquare |]| +//@[26:27) Dot |.| +//@[27:29) IdentifierSyntax +//@[27:29) Identifier |id| +//@[29:30) NewLine |\n| + } +//@[6:7) RightBrace |}| +//@[7:8) NewLine |\n| + { +//@[6:47) ArrayItemSyntax +//@[6:47) ObjectSyntax +//@[6:7) LeftBrace |{| +//@[7:8) NewLine |\n| + id: vnets[index * 2].id +//@[8:31) ObjectPropertySyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:31) PropertyAccessSyntax +//@[12:28) ArrayAccessSyntax +//@[12:17) VariableAccessSyntax +//@[12:17) IdentifierSyntax +//@[12:17) Identifier |vnets| +//@[17:18) LeftSquare |[| +//@[18:27) BinaryOperationSyntax +//@[18:23) VariableAccessSyntax +//@[18:23) IdentifierSyntax +//@[18:23) Identifier |index| +//@[24:25) Asterisk |*| +//@[26:27) IntegerLiteralSyntax +//@[26:27) Integer |2| +//@[27:28) RightSquare |]| +//@[28:29) Dot |.| +//@[29:31) IdentifierSyntax +//@[29:31) Identifier |id| +//@[31:32) NewLine |\n| + } +//@[6:7) RightBrace |}| +//@[7:8) NewLine |\n| + ] +//@[4:5) RightSquare |]| +//@[5:6) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:28) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:28) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + vnets +//@[4:9) ArrayItemSyntax +//@[4:9) VariableAccessSyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |vnets| +//@[9:10) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// single module +//@[16:17) NewLine |\n| +module singleModule 'passthrough.bicep' = { +//@[0:97) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:19) IdentifierSyntax +//@[7:19) Identifier |singleModule| +//@[20:39) StringSyntax +//@[20:39) StringComplete |'passthrough.bicep'| +//@[40:41) Assignment |=| +//@[42:97) ObjectSyntax +//@[42:43) LeftBrace |{| +//@[43:44) NewLine |\n| + name: 'test' +//@[2:14) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) StringSyntax +//@[8:14) StringComplete |'test'| +//@[14:15) NewLine |\n| + params: { +//@[2:36) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:36) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: 'hello' +//@[4:20) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:20) StringSyntax +//@[13:20) StringComplete |'hello'| +//@[20:21) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +var moduleSetup = [ +//@[0:47) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |moduleSetup| +//@[16:17) Assignment |=| +//@[18:47) ArraySyntax +//@[18:19) LeftSquare |[| +//@[19:20) NewLine |\n| + 'one' +//@[2:7) ArrayItemSyntax +//@[2:7) StringSyntax +//@[2:7) StringComplete |'one'| +//@[7:8) NewLine |\n| + 'two' +//@[2:7) ArrayItemSyntax +//@[2:7) StringSyntax +//@[2:7) StringComplete |'two'| +//@[7:8) NewLine |\n| + 'three' +//@[2:9) ArrayItemSyntax +//@[2:9) StringSyntax +//@[2:9) StringComplete |'three'| +//@[9:10) NewLine |\n| +] +//@[0:1) RightSquare |]| +//@[1:3) NewLine |\n\n| + +// module collection plus explicit dependency on single module +//@[62:63) NewLine |\n| +module moduleCollectionWithSingleDependency 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[0:224) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:43) IdentifierSyntax +//@[7:43) Identifier |moduleCollectionWithSingleDependency| +//@[44:63) StringSyntax +//@[44:63) StringComplete |'passthrough.bicep'| +//@[64:65) Assignment |=| +//@[66:224) ForSyntax +//@[66:67) LeftSquare |[| +//@[67:70) Identifier |for| +//@[71:81) LocalVariableSyntax +//@[71:81) IdentifierSyntax +//@[71:81) Identifier |moduleName| +//@[82:84) Identifier |in| +//@[85:96) VariableAccessSyntax +//@[85:96) IdentifierSyntax +//@[85:96) Identifier |moduleSetup| +//@[96:97) Colon |:| +//@[98:223) ObjectSyntax +//@[98:99) LeftBrace |{| +//@[99:100) NewLine |\n| + name: moduleName +//@[2:18) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) VariableAccessSyntax +//@[8:18) IdentifierSyntax +//@[8:18) Identifier |moduleName| +//@[18:19) NewLine |\n| + params: { +//@[2:47) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:47) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: 'in-${moduleName}' +//@[4:31) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:31) StringSyntax +//@[13:19) StringLeftPiece |'in-${| +//@[19:29) VariableAccessSyntax +//@[19:29) IdentifierSyntax +//@[19:29) Identifier |moduleName| +//@[29:31) StringRightPiece |}'| +//@[31:32) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:54) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:54) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + singleModule +//@[4:16) ArrayItemSyntax +//@[4:16) VariableAccessSyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |singleModule| +//@[16:17) NewLine |\n| + singleResource +//@[4:18) ArrayItemSyntax +//@[4:18) VariableAccessSyntax +//@[4:18) IdentifierSyntax +//@[4:18) Identifier |singleResource| +//@[18:19) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// another module collection with dependency on another module collection +//@[73:74) NewLine |\n| +module moduleCollectionWithCollectionDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[0:255) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:49) IdentifierSyntax +//@[7:49) Identifier |moduleCollectionWithCollectionDependencies| +//@[50:69) StringSyntax +//@[50:69) StringComplete |'passthrough.bicep'| +//@[70:71) Assignment |=| +//@[72:255) ForSyntax +//@[72:73) LeftSquare |[| +//@[73:76) Identifier |for| +//@[77:87) LocalVariableSyntax +//@[77:87) IdentifierSyntax +//@[77:87) Identifier |moduleName| +//@[88:90) Identifier |in| +//@[91:102) VariableAccessSyntax +//@[91:102) IdentifierSyntax +//@[91:102) Identifier |moduleSetup| +//@[102:103) Colon |:| +//@[104:254) ObjectSyntax +//@[104:105) LeftBrace |{| +//@[105:106) NewLine |\n| + name: moduleName +//@[2:18) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) VariableAccessSyntax +//@[8:18) IdentifierSyntax +//@[8:18) Identifier |moduleName| +//@[18:19) NewLine |\n| + params: { +//@[2:47) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:47) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: 'in-${moduleName}' +//@[4:31) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:31) StringSyntax +//@[13:19) StringLeftPiece |'in-${| +//@[19:29) VariableAccessSyntax +//@[19:29) IdentifierSyntax +//@[19:29) Identifier |moduleName| +//@[29:31) StringRightPiece |}'| +//@[31:32) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:79) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:79) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts +//@[4:19) ArrayItemSyntax +//@[4:19) VariableAccessSyntax +//@[4:19) IdentifierSyntax +//@[4:19) Identifier |storageAccounts| +//@[19:20) NewLine |\n| + moduleCollectionWithSingleDependency +//@[4:40) ArrayItemSyntax +//@[4:40) VariableAccessSyntax +//@[4:40) IdentifierSyntax +//@[4:40) Identifier |moduleCollectionWithSingleDependency| +//@[40:41) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { +//@[0:290) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:42) IdentifierSyntax +//@[7:42) Identifier |singleModuleWithIndexedDependencies| +//@[43:62) StringSyntax +//@[43:62) StringComplete |'passthrough.bicep'| +//@[63:64) Assignment |=| +//@[65:290) ObjectSyntax +//@[65:66) LeftBrace |{| +//@[66:67) NewLine |\n| + name: 'hello' +//@[2:15) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringSyntax +//@[8:15) StringComplete |'hello'| +//@[15:16) NewLine |\n| + params: { +//@[2:153) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:153) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) +//@[4:137) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:137) FunctionCallSyntax +//@[13:19) IdentifierSyntax +//@[13:19) Identifier |concat| +//@[19:20) LeftParen |(| +//@[20:87) FunctionArgumentSyntax +//@[20:86) PropertyAccessSyntax +//@[20:77) PropertyAccessSyntax +//@[20:69) ArrayAccessSyntax +//@[20:62) VariableAccessSyntax +//@[20:62) IdentifierSyntax +//@[20:62) Identifier |moduleCollectionWithCollectionDependencies| +//@[62:63) LeftSquare |[| +//@[63:68) VariableAccessSyntax +//@[63:68) IdentifierSyntax +//@[63:68) Identifier |index| +//@[68:69) RightSquare |]| +//@[69:70) Dot |.| +//@[70:77) IdentifierSyntax +//@[70:77) Identifier |outputs| +//@[77:78) Dot |.| +//@[78:86) IdentifierSyntax +//@[78:86) Identifier |myOutput| +//@[86:87) Comma |,| +//@[88:136) FunctionArgumentSyntax +//@[88:136) PropertyAccessSyntax +//@[88:125) PropertyAccessSyntax +//@[88:114) ArrayAccessSyntax +//@[88:103) VariableAccessSyntax +//@[88:103) IdentifierSyntax +//@[88:103) Identifier |storageAccounts| +//@[103:104) LeftSquare |[| +//@[104:113) BinaryOperationSyntax +//@[104:109) VariableAccessSyntax +//@[104:109) IdentifierSyntax +//@[104:109) Identifier |index| +//@[110:111) Asterisk |*| +//@[112:113) IntegerLiteralSyntax +//@[112:113) Integer |3| +//@[113:114) RightSquare |]| +//@[114:115) Dot |.| +//@[115:125) IdentifierSyntax +//@[115:125) Identifier |properties| +//@[125:126) Dot |.| +//@[126:136) IdentifierSyntax +//@[126:136) Identifier |accessTier| +//@[136:137) RightParen |)| +//@[137:138) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:51) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:51) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts2[index - 10] +//@[4:32) ArrayItemSyntax +//@[4:32) ArrayAccessSyntax +//@[4:20) VariableAccessSyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |storageAccounts2| +//@[20:21) LeftSquare |[| +//@[21:31) BinaryOperationSyntax +//@[21:26) VariableAccessSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |index| +//@[27:28) Minus |-| +//@[29:31) IntegerLiteralSyntax +//@[29:31) Integer |10| +//@[31:32) RightSquare |]| +//@[32:33) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[0:346) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:46) IdentifierSyntax +//@[7:46) Identifier |moduleCollectionWithIndexedDependencies| +//@[47:66) StringSyntax +//@[47:66) StringComplete |'passthrough.bicep'| +//@[67:68) Assignment |=| +//@[69:346) ForSyntax +//@[69:70) LeftSquare |[| +//@[70:73) Identifier |for| +//@[74:84) LocalVariableSyntax +//@[74:84) IdentifierSyntax +//@[74:84) Identifier |moduleName| +//@[85:87) Identifier |in| +//@[88:99) VariableAccessSyntax +//@[88:99) IdentifierSyntax +//@[88:99) Identifier |moduleSetup| +//@[99:100) Colon |:| +//@[101:345) ObjectSyntax +//@[101:102) LeftBrace |{| +//@[102:103) NewLine |\n| + name: moduleName +//@[2:18) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) VariableAccessSyntax +//@[8:18) IdentifierSyntax +//@[8:18) Identifier |moduleName| +//@[18:19) NewLine |\n| + params: { +//@[2:170) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:170) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' +//@[4:154) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:154) StringSyntax +//@[13:16) StringLeftPiece |'${| +//@[16:82) PropertyAccessSyntax +//@[16:73) PropertyAccessSyntax +//@[16:65) ArrayAccessSyntax +//@[16:58) VariableAccessSyntax +//@[16:58) IdentifierSyntax +//@[16:58) Identifier |moduleCollectionWithCollectionDependencies| +//@[58:59) LeftSquare |[| +//@[59:64) VariableAccessSyntax +//@[59:64) IdentifierSyntax +//@[59:64) Identifier |index| +//@[64:65) RightSquare |]| +//@[65:66) Dot |.| +//@[66:73) IdentifierSyntax +//@[66:73) Identifier |outputs| +//@[73:74) Dot |.| +//@[74:82) IdentifierSyntax +//@[74:82) Identifier |myOutput| +//@[82:88) StringMiddlePiece |} - ${| +//@[88:136) PropertyAccessSyntax +//@[88:125) PropertyAccessSyntax +//@[88:114) ArrayAccessSyntax +//@[88:103) VariableAccessSyntax +//@[88:103) IdentifierSyntax +//@[88:103) Identifier |storageAccounts| +//@[103:104) LeftSquare |[| +//@[104:113) BinaryOperationSyntax +//@[104:109) VariableAccessSyntax +//@[104:109) IdentifierSyntax +//@[104:109) Identifier |index| +//@[110:111) Asterisk |*| +//@[112:113) IntegerLiteralSyntax +//@[112:113) Integer |3| +//@[113:114) RightSquare |]| +//@[114:115) Dot |.| +//@[115:125) IdentifierSyntax +//@[115:125) Identifier |properties| +//@[125:126) Dot |.| +//@[126:136) IdentifierSyntax +//@[126:136) Identifier |accessTier| +//@[136:142) StringMiddlePiece |} - ${| +//@[142:152) VariableAccessSyntax +//@[142:152) IdentifierSyntax +//@[142:152) Identifier |moduleName| +//@[152:154) StringRightPiece |}'| +//@[154:155) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:50) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:50) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts2[index - 9] +//@[4:31) ArrayItemSyntax +//@[4:31) ArrayAccessSyntax +//@[4:20) VariableAccessSyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |storageAccounts2| +//@[20:21) LeftSquare |[| +//@[21:30) BinaryOperationSyntax +//@[21:26) VariableAccessSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |index| +//@[27:28) Minus |-| +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |9| +//@[30:31) RightSquare |]| +//@[31:32) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +output indexedModulesName string = moduleCollectionWithSingleDependency[index].name +//@[0:83) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:25) IdentifierSyntax +//@[7:25) Identifier |indexedModulesName| +//@[26:32) TypeSyntax +//@[26:32) Identifier |string| +//@[33:34) Assignment |=| +//@[35:83) PropertyAccessSyntax +//@[35:78) ArrayAccessSyntax +//@[35:71) VariableAccessSyntax +//@[35:71) IdentifierSyntax +//@[35:71) Identifier |moduleCollectionWithSingleDependency| +//@[71:72) LeftSquare |[| +//@[72:77) VariableAccessSyntax +//@[72:77) IdentifierSyntax +//@[72:77) Identifier |index| +//@[77:78) RightSquare |]| +//@[78:79) Dot |.| +//@[79:83) IdentifierSyntax +//@[79:83) Identifier |name| +//@[83:84) NewLine |\n| +output indexedModuleOutput string = moduleCollectionWithSingleDependency[index * 1].outputs.myOutput +//@[0:100) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:26) IdentifierSyntax +//@[7:26) Identifier |indexedModuleOutput| +//@[27:33) TypeSyntax +//@[27:33) Identifier |string| +//@[34:35) Assignment |=| +//@[36:100) PropertyAccessSyntax +//@[36:91) PropertyAccessSyntax +//@[36:83) ArrayAccessSyntax +//@[36:72) VariableAccessSyntax +//@[36:72) IdentifierSyntax +//@[36:72) Identifier |moduleCollectionWithSingleDependency| +//@[72:73) LeftSquare |[| +//@[73:82) BinaryOperationSyntax +//@[73:78) VariableAccessSyntax +//@[73:78) IdentifierSyntax +//@[73:78) Identifier |index| +//@[79:80) Asterisk |*| +//@[81:82) IntegerLiteralSyntax +//@[81:82) Integer |1| +//@[82:83) RightSquare |]| +//@[83:84) Dot |.| +//@[84:91) IdentifierSyntax +//@[84:91) Identifier |outputs| +//@[91:92) Dot |.| +//@[92:100) IdentifierSyntax +//@[92:100) Identifier |myOutput| +//@[100:102) NewLine |\n\n| + +// resource collection +//@[22:23) NewLine |\n| +resource existingStorageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' existing = [for account in accounts: { +//@[0:164) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:32) IdentifierSyntax +//@[9:32) Identifier |existingStorageAccounts| +//@[33:79) StringSyntax +//@[33:79) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[80:88) Identifier |existing| +//@[89:90) Assignment |=| +//@[91:164) ForSyntax +//@[91:92) LeftSquare |[| +//@[92:95) Identifier |for| +//@[96:103) LocalVariableSyntax +//@[96:103) IdentifierSyntax +//@[96:103) Identifier |account| +//@[104:106) Identifier |in| +//@[107:115) VariableAccessSyntax +//@[107:115) IdentifierSyntax +//@[107:115) Identifier |accounts| +//@[115:116) Colon |:| +//@[117:163) ObjectSyntax +//@[117:118) LeftBrace |{| +//@[118:119) NewLine |\n| + name: '${name}-existing-${account.name}' +//@[2:42) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:42) StringSyntax +//@[8:11) StringLeftPiece |'${| +//@[11:15) VariableAccessSyntax +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:28) StringMiddlePiece |}-existing-${| +//@[28:40) PropertyAccessSyntax +//@[28:35) VariableAccessSyntax +//@[28:35) IdentifierSyntax +//@[28:35) Identifier |account| +//@[35:36) Dot |.| +//@[36:40) IdentifierSyntax +//@[36:40) Identifier |name| +//@[40:42) StringRightPiece |}'| +//@[42:43) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +output existingIndexedResourceName string = existingStorageAccounts[index * 0].name +//@[0:83) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:34) IdentifierSyntax +//@[7:34) Identifier |existingIndexedResourceName| +//@[35:41) TypeSyntax +//@[35:41) Identifier |string| +//@[42:43) Assignment |=| +//@[44:83) PropertyAccessSyntax +//@[44:78) ArrayAccessSyntax +//@[44:67) VariableAccessSyntax +//@[44:67) IdentifierSyntax +//@[44:67) Identifier |existingStorageAccounts| +//@[67:68) LeftSquare |[| +//@[68:77) BinaryOperationSyntax +//@[68:73) VariableAccessSyntax +//@[68:73) IdentifierSyntax +//@[68:73) Identifier |index| +//@[74:75) Asterisk |*| +//@[76:77) IntegerLiteralSyntax +//@[76:77) Integer |0| +//@[77:78) RightSquare |]| +//@[78:79) Dot |.| +//@[79:83) IdentifierSyntax +//@[79:83) Identifier |name| +//@[83:84) NewLine |\n| +output existingIndexedResourceId string = existingStorageAccounts[index * 1].id +//@[0:79) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:32) IdentifierSyntax +//@[7:32) Identifier |existingIndexedResourceId| +//@[33:39) TypeSyntax +//@[33:39) Identifier |string| +//@[40:41) Assignment |=| +//@[42:79) PropertyAccessSyntax +//@[42:76) ArrayAccessSyntax +//@[42:65) VariableAccessSyntax +//@[42:65) IdentifierSyntax +//@[42:65) Identifier |existingStorageAccounts| +//@[65:66) LeftSquare |[| +//@[66:75) BinaryOperationSyntax +//@[66:71) VariableAccessSyntax +//@[66:71) IdentifierSyntax +//@[66:71) Identifier |index| +//@[72:73) Asterisk |*| +//@[74:75) IntegerLiteralSyntax +//@[74:75) Integer |1| +//@[75:76) RightSquare |]| +//@[76:77) Dot |.| +//@[77:79) IdentifierSyntax +//@[77:79) Identifier |id| +//@[79:80) NewLine |\n| +output existingIndexedResourceType string = existingStorageAccounts[index+2].type +//@[0:81) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:34) IdentifierSyntax +//@[7:34) Identifier |existingIndexedResourceType| +//@[35:41) TypeSyntax +//@[35:41) Identifier |string| +//@[42:43) Assignment |=| +//@[44:81) PropertyAccessSyntax +//@[44:76) ArrayAccessSyntax +//@[44:67) VariableAccessSyntax +//@[44:67) IdentifierSyntax +//@[44:67) Identifier |existingStorageAccounts| +//@[67:68) LeftSquare |[| +//@[68:75) BinaryOperationSyntax +//@[68:73) VariableAccessSyntax +//@[68:73) IdentifierSyntax +//@[68:73) Identifier |index| +//@[73:74) Plus |+| +//@[74:75) IntegerLiteralSyntax +//@[74:75) Integer |2| +//@[75:76) RightSquare |]| +//@[76:77) Dot |.| +//@[77:81) IdentifierSyntax +//@[77:81) Identifier |type| +//@[81:82) NewLine |\n| +output existingIndexedResourceApiVersion string = existingStorageAccounts[index-7].apiVersion +//@[0:93) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:40) IdentifierSyntax +//@[7:40) Identifier |existingIndexedResourceApiVersion| +//@[41:47) TypeSyntax +//@[41:47) Identifier |string| +//@[48:49) Assignment |=| +//@[50:93) PropertyAccessSyntax +//@[50:82) ArrayAccessSyntax +//@[50:73) VariableAccessSyntax +//@[50:73) IdentifierSyntax +//@[50:73) Identifier |existingStorageAccounts| +//@[73:74) LeftSquare |[| +//@[74:81) BinaryOperationSyntax +//@[74:79) VariableAccessSyntax +//@[74:79) IdentifierSyntax +//@[74:79) Identifier |index| +//@[79:80) Minus |-| +//@[80:81) IntegerLiteralSyntax +//@[80:81) Integer |7| +//@[81:82) RightSquare |]| +//@[82:83) Dot |.| +//@[83:93) IdentifierSyntax +//@[83:93) Identifier |apiVersion| +//@[93:94) NewLine |\n| +output existingIndexedResourceLocation string = existingStorageAccounts[index/2].location +//@[0:89) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:38) IdentifierSyntax +//@[7:38) Identifier |existingIndexedResourceLocation| +//@[39:45) TypeSyntax +//@[39:45) Identifier |string| +//@[46:47) Assignment |=| +//@[48:89) PropertyAccessSyntax +//@[48:80) ArrayAccessSyntax +//@[48:71) VariableAccessSyntax +//@[48:71) IdentifierSyntax +//@[48:71) Identifier |existingStorageAccounts| +//@[71:72) LeftSquare |[| +//@[72:79) BinaryOperationSyntax +//@[72:77) VariableAccessSyntax +//@[72:77) IdentifierSyntax +//@[72:77) Identifier |index| +//@[77:78) Slash |/| +//@[78:79) IntegerLiteralSyntax +//@[78:79) Integer |2| +//@[79:80) RightSquare |]| +//@[80:81) Dot |.| +//@[81:89) IdentifierSyntax +//@[81:89) Identifier |location| +//@[89:90) NewLine |\n| +output existingIndexedResourceAccessTier string = existingStorageAccounts[index%3].properties.accessTier +//@[0:104) OutputDeclarationSyntax +//@[0:6) Identifier |output| +//@[7:40) IdentifierSyntax +//@[7:40) Identifier |existingIndexedResourceAccessTier| +//@[41:47) TypeSyntax +//@[41:47) Identifier |string| +//@[48:49) Assignment |=| +//@[50:104) PropertyAccessSyntax +//@[50:93) PropertyAccessSyntax +//@[50:82) ArrayAccessSyntax +//@[50:73) VariableAccessSyntax +//@[50:73) IdentifierSyntax +//@[50:73) Identifier |existingStorageAccounts| +//@[73:74) LeftSquare |[| +//@[74:81) BinaryOperationSyntax +//@[74:79) VariableAccessSyntax +//@[74:79) IdentifierSyntax +//@[74:79) Identifier |index| +//@[79:80) Modulo |%| +//@[80:81) IntegerLiteralSyntax +//@[80:81) Integer |3| +//@[81:82) RightSquare |]| +//@[82:83) Dot |.| +//@[83:93) IdentifierSyntax +//@[83:93) Identifier |properties| +//@[93:94) Dot |.| +//@[94:104) IdentifierSyntax +//@[94:104) Identifier |accessTier| +//@[104:106) NewLine |\n\n| + +resource duplicatedNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { +//@[0:136) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:24) IdentifierSyntax +//@[9:24) Identifier |duplicatedNames| +//@[25:64) StringSyntax +//@[25:64) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[65:66) Assignment |=| +//@[67:136) ForSyntax +//@[67:68) LeftSquare |[| +//@[68:71) Identifier |for| +//@[72:76) LocalVariableSyntax +//@[72:76) IdentifierSyntax +//@[72:76) Identifier |zone| +//@[77:79) Identifier |in| +//@[80:82) ArraySyntax +//@[80:81) LeftSquare |[| +//@[81:82) RightSquare |]| +//@[82:83) Colon |:| +//@[84:135) ObjectSyntax +//@[84:85) LeftBrace |{| +//@[85:86) NewLine |\n| + name: 'no loop variable' +//@[2:26) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:26) StringSyntax +//@[8:26) StringComplete |'no loop variable'| +//@[26:27) NewLine |\n| + location: 'eastus' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'eastus'| +//@[20:21) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// reference to a resource collection whose name expression does not reference any loop variables +//@[97:98) NewLine |\n| +resource referenceToDuplicateNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { +//@[0:192) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:34) IdentifierSyntax +//@[9:34) Identifier |referenceToDuplicateNames| +//@[35:74) StringSyntax +//@[35:74) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[75:76) Assignment |=| +//@[77:192) ForSyntax +//@[77:78) LeftSquare |[| +//@[78:81) Identifier |for| +//@[82:86) LocalVariableSyntax +//@[82:86) IdentifierSyntax +//@[82:86) Identifier |zone| +//@[87:89) Identifier |in| +//@[90:92) ArraySyntax +//@[90:91) LeftSquare |[| +//@[91:92) RightSquare |]| +//@[92:93) Colon |:| +//@[94:191) ObjectSyntax +//@[94:95) LeftBrace |{| +//@[95:96) NewLine |\n| + name: 'no loop variable' +//@[2:26) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:26) StringSyntax +//@[8:26) StringComplete |'no loop variable'| +//@[26:27) NewLine |\n| + location: 'eastus' +//@[2:20) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringSyntax +//@[12:20) StringComplete |'eastus'| +//@[20:21) NewLine |\n| + dependsOn: [ +//@[2:45) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:45) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + duplicatedNames[index] +//@[4:26) ArrayItemSyntax +//@[4:26) ArrayAccessSyntax +//@[4:19) VariableAccessSyntax +//@[4:19) IdentifierSyntax +//@[4:19) Identifier |duplicatedNames| +//@[19:20) LeftSquare |[| +//@[20:25) VariableAccessSyntax +//@[20:25) IdentifierSyntax +//@[20:25) Identifier |index| +//@[25:26) RightSquare |]| +//@[26:27) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/main.tokens.bicep new file mode 100644 index 00000000000..04866e130ea --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/main.tokens.bicep @@ -0,0 +1,1523 @@ +param name string +//@[0:5) Identifier |param| +//@[6:10) Identifier |name| +//@[11:17) Identifier |string| +//@[17:18) NewLine |\n| +param accounts array +//@[0:5) Identifier |param| +//@[6:14) Identifier |accounts| +//@[15:20) Identifier |array| +//@[20:21) NewLine |\n| +param index int +//@[0:5) Identifier |param| +//@[6:11) Identifier |index| +//@[12:15) Identifier |int| +//@[15:17) NewLine |\n\n| + +// single resource +//@[18:19) NewLine |\n| +resource singleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { +//@[0:8) Identifier |resource| +//@[9:23) Identifier |singleResource| +//@[24:70) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[71:72) Assignment |=| +//@[73:74) LeftBrace |{| +//@[74:75) NewLine |\n| + name: '${name}single-resource-name' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:37) StringRightPiece |}single-resource-name'| +//@[37:38) NewLine |\n| + location: resourceGroup().location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// extension of single resource +//@[31:32) NewLine |\n| +resource singleResourceExtension 'Microsoft.Authorization/locks@2016-09-01' = { +//@[0:8) Identifier |resource| +//@[9:32) Identifier |singleResourceExtension| +//@[33:75) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[76:77) Assignment |=| +//@[78:79) LeftBrace |{| +//@[79:80) NewLine |\n| + scope: singleResource +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:23) Identifier |singleResource| +//@[23:24) NewLine |\n| + name: 'single-resource-lock' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:30) StringComplete |'single-resource-lock'| +//@[30:31) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: 'CanNotDelete' +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:25) StringComplete |'CanNotDelete'| +//@[25:26) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// single resource cascade extension +//@[36:37) NewLine |\n| +resource singleResourceCascadeExtension 'Microsoft.Authorization/locks@2016-09-01' = { +//@[0:8) Identifier |resource| +//@[9:39) Identifier |singleResourceCascadeExtension| +//@[40:82) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[83:84) Assignment |=| +//@[85:86) LeftBrace |{| +//@[86:87) NewLine |\n| + scope: singleResourceExtension +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:32) Identifier |singleResourceExtension| +//@[32:33) NewLine |\n| + name: 'single-resource-cascade-extension' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:43) StringComplete |'single-resource-cascade-extension'| +//@[43:44) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: 'CanNotDelete' +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:25) StringComplete |'CanNotDelete'| +//@[25:26) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// resource collection +//@[22:23) NewLine |\n| +resource storageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { +//@[0:8) Identifier |resource| +//@[9:24) Identifier |storageAccounts| +//@[25:71) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[72:73) Assignment |=| +//@[74:75) LeftSquare |[| +//@[75:78) Identifier |for| +//@[79:86) Identifier |account| +//@[87:89) Identifier |in| +//@[90:98) Identifier |accounts| +//@[98:99) Colon |:| +//@[100:101) LeftBrace |{| +//@[101:102) NewLine |\n| + name: '${name}-collection-${account.name}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:30) StringMiddlePiece |}-collection-${| +//@[30:37) Identifier |account| +//@[37:38) Dot |.| +//@[38:42) Identifier |name| +//@[42:44) StringRightPiece |}'| +//@[44:45) NewLine |\n| + location: account.location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) Identifier |location| +//@[28:29) NewLine |\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + singleResource +//@[4:18) Identifier |singleResource| +//@[18:19) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// extension of a single resource in a collection +//@[49:50) NewLine |\n| +resource extendSingleResourceInCollection 'Microsoft.Authorization/locks@2016-09-01' = { +//@[0:8) Identifier |resource| +//@[9:41) Identifier |extendSingleResourceInCollection| +//@[42:84) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[85:86) Assignment |=| +//@[87:88) LeftBrace |{| +//@[88:89) NewLine |\n| + name: 'one-resource-collection-item-lock' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:43) StringComplete |'one-resource-collection-item-lock'| +//@[43:44) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: 'ReadOnly' +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:21) StringComplete |'ReadOnly'| +//@[21:22) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + scope: storageAccounts[index % 2] +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:24) Identifier |storageAccounts| +//@[24:25) LeftSquare |[| +//@[25:30) Identifier |index| +//@[31:32) Modulo |%| +//@[33:34) Integer |2| +//@[34:35) RightSquare |]| +//@[35:36) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// collection of extensions +//@[27:28) NewLine |\n| +resource extensionCollection 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { +//@[0:8) Identifier |resource| +//@[9:28) Identifier |extensionCollection| +//@[29:71) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[72:73) Assignment |=| +//@[74:75) LeftSquare |[| +//@[75:78) Identifier |for| +//@[79:80) Identifier |i| +//@[81:83) Identifier |in| +//@[84:89) Identifier |range| +//@[89:90) LeftParen |(| +//@[90:91) Integer |0| +//@[91:92) Comma |,| +//@[92:93) Integer |1| +//@[93:94) RightParen |)| +//@[94:95) Colon |:| +//@[96:97) LeftBrace |{| +//@[97:98) NewLine |\n| + name: 'lock-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:16) StringLeftPiece |'lock-${| +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:20) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:12) Identifier |i| +//@[13:15) Equals |==| +//@[16:17) Integer |0| +//@[18:19) Question |?| +//@[20:34) StringComplete |'CanNotDelete'| +//@[35:36) Colon |:| +//@[37:47) StringComplete |'ReadOnly'| +//@[47:48) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + scope: singleResource +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:23) Identifier |singleResource| +//@[23:24) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// cascade extend the extension +//@[31:32) NewLine |\n| +resource lockTheLocks 'Microsoft.Authorization/locks@2016-09-01' = [for i in range(0,1): { +//@[0:8) Identifier |resource| +//@[9:21) Identifier |lockTheLocks| +//@[22:64) StringComplete |'Microsoft.Authorization/locks@2016-09-01'| +//@[65:66) Assignment |=| +//@[67:68) LeftSquare |[| +//@[68:71) Identifier |for| +//@[72:73) Identifier |i| +//@[74:76) Identifier |in| +//@[77:82) Identifier |range| +//@[82:83) LeftParen |(| +//@[83:84) Integer |0| +//@[84:85) Comma |,| +//@[85:86) Integer |1| +//@[86:87) RightParen |)| +//@[87:88) Colon |:| +//@[89:90) LeftBrace |{| +//@[90:91) NewLine |\n| + name: 'lock-the-lock-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:25) StringLeftPiece |'lock-the-lock-${| +//@[25:26) Identifier |i| +//@[26:28) StringRightPiece |}'| +//@[28:29) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + level: i == 0 ? 'CanNotDelete' : 'ReadOnly' +//@[4:9) Identifier |level| +//@[9:10) Colon |:| +//@[11:12) Identifier |i| +//@[13:15) Equals |==| +//@[16:17) Integer |0| +//@[18:19) Question |?| +//@[20:34) StringComplete |'CanNotDelete'| +//@[35:36) Colon |:| +//@[37:47) StringComplete |'ReadOnly'| +//@[47:48) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + scope: extensionCollection[i] +//@[2:7) Identifier |scope| +//@[7:8) Colon |:| +//@[9:28) Identifier |extensionCollection| +//@[28:29) LeftSquare |[| +//@[29:30) Identifier |i| +//@[30:31) RightSquare |]| +//@[31:32) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// special case property access +//@[31:32) NewLine |\n| +output indexedCollectionBlobEndpoint string = storageAccounts[index].properties.primaryEndpoints.blob +//@[0:6) Identifier |output| +//@[7:36) Identifier |indexedCollectionBlobEndpoint| +//@[37:43) Identifier |string| +//@[44:45) Assignment |=| +//@[46:61) Identifier |storageAccounts| +//@[61:62) LeftSquare |[| +//@[62:67) Identifier |index| +//@[67:68) RightSquare |]| +//@[68:69) Dot |.| +//@[69:79) Identifier |properties| +//@[79:80) Dot |.| +//@[80:96) Identifier |primaryEndpoints| +//@[96:97) Dot |.| +//@[97:101) Identifier |blob| +//@[101:102) NewLine |\n| +output indexedCollectionName string = storageAccounts[index].name +//@[0:6) Identifier |output| +//@[7:28) Identifier |indexedCollectionName| +//@[29:35) Identifier |string| +//@[36:37) Assignment |=| +//@[38:53) Identifier |storageAccounts| +//@[53:54) LeftSquare |[| +//@[54:59) Identifier |index| +//@[59:60) RightSquare |]| +//@[60:61) Dot |.| +//@[61:65) Identifier |name| +//@[65:66) NewLine |\n| +output indexedCollectionId string = storageAccounts[index].id +//@[0:6) Identifier |output| +//@[7:26) Identifier |indexedCollectionId| +//@[27:33) Identifier |string| +//@[34:35) Assignment |=| +//@[36:51) Identifier |storageAccounts| +//@[51:52) LeftSquare |[| +//@[52:57) Identifier |index| +//@[57:58) RightSquare |]| +//@[58:59) Dot |.| +//@[59:61) Identifier |id| +//@[61:62) NewLine |\n| +output indexedCollectionType string = storageAccounts[index].type +//@[0:6) Identifier |output| +//@[7:28) Identifier |indexedCollectionType| +//@[29:35) Identifier |string| +//@[36:37) Assignment |=| +//@[38:53) Identifier |storageAccounts| +//@[53:54) LeftSquare |[| +//@[54:59) Identifier |index| +//@[59:60) RightSquare |]| +//@[60:61) Dot |.| +//@[61:65) Identifier |type| +//@[65:66) NewLine |\n| +output indexedCollectionVersion string = storageAccounts[index].apiVersion +//@[0:6) Identifier |output| +//@[7:31) Identifier |indexedCollectionVersion| +//@[32:38) Identifier |string| +//@[39:40) Assignment |=| +//@[41:56) Identifier |storageAccounts| +//@[56:57) LeftSquare |[| +//@[57:62) Identifier |index| +//@[62:63) RightSquare |]| +//@[63:64) Dot |.| +//@[64:74) Identifier |apiVersion| +//@[74:76) NewLine |\n\n| + +// general case property access +//@[31:32) NewLine |\n| +output indexedCollectionIdentity object = storageAccounts[index].identity +//@[0:6) Identifier |output| +//@[7:32) Identifier |indexedCollectionIdentity| +//@[33:39) Identifier |object| +//@[40:41) Assignment |=| +//@[42:57) Identifier |storageAccounts| +//@[57:58) LeftSquare |[| +//@[58:63) Identifier |index| +//@[63:64) RightSquare |]| +//@[64:65) Dot |.| +//@[65:73) Identifier |identity| +//@[73:75) NewLine |\n\n| + +// indexed access of two properties +//@[35:36) NewLine |\n| +output indexedEndpointPair object = { +//@[0:6) Identifier |output| +//@[7:26) Identifier |indexedEndpointPair| +//@[27:33) Identifier |object| +//@[34:35) Assignment |=| +//@[36:37) LeftBrace |{| +//@[37:38) NewLine |\n| + primary: storageAccounts[index].properties.primaryEndpoints.blob +//@[2:9) Identifier |primary| +//@[9:10) Colon |:| +//@[11:26) Identifier |storageAccounts| +//@[26:27) LeftSquare |[| +//@[27:32) Identifier |index| +//@[32:33) RightSquare |]| +//@[33:34) Dot |.| +//@[34:44) Identifier |properties| +//@[44:45) Dot |.| +//@[45:61) Identifier |primaryEndpoints| +//@[61:62) Dot |.| +//@[62:66) Identifier |blob| +//@[66:67) NewLine |\n| + secondary: storageAccounts[index + 1].properties.secondaryEndpoints.blob +//@[2:11) Identifier |secondary| +//@[11:12) Colon |:| +//@[13:28) Identifier |storageAccounts| +//@[28:29) LeftSquare |[| +//@[29:34) Identifier |index| +//@[35:36) Plus |+| +//@[37:38) Integer |1| +//@[38:39) RightSquare |]| +//@[39:40) Dot |.| +//@[40:50) Identifier |properties| +//@[50:51) Dot |.| +//@[51:69) Identifier |secondaryEndpoints| +//@[69:70) Dot |.| +//@[70:74) Identifier |blob| +//@[74:75) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// nested indexer? +//@[18:19) NewLine |\n| +output indexViaReference string = storageAccounts[int(storageAccounts[index].properties.creationTime)].properties.accessTier +//@[0:6) Identifier |output| +//@[7:24) Identifier |indexViaReference| +//@[25:31) Identifier |string| +//@[32:33) Assignment |=| +//@[34:49) Identifier |storageAccounts| +//@[49:50) LeftSquare |[| +//@[50:53) Identifier |int| +//@[53:54) LeftParen |(| +//@[54:69) Identifier |storageAccounts| +//@[69:70) LeftSquare |[| +//@[70:75) Identifier |index| +//@[75:76) RightSquare |]| +//@[76:77) Dot |.| +//@[77:87) Identifier |properties| +//@[87:88) Dot |.| +//@[88:100) Identifier |creationTime| +//@[100:101) RightParen |)| +//@[101:102) RightSquare |]| +//@[102:103) Dot |.| +//@[103:113) Identifier |properties| +//@[113:114) Dot |.| +//@[114:124) Identifier |accessTier| +//@[124:126) NewLine |\n\n| + +// dependency on a resource collection +//@[38:39) NewLine |\n| +resource storageAccounts2 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in accounts: { +//@[0:8) Identifier |resource| +//@[9:25) Identifier |storageAccounts2| +//@[26:72) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[73:74) Assignment |=| +//@[75:76) LeftSquare |[| +//@[76:79) Identifier |for| +//@[80:87) Identifier |account| +//@[88:90) Identifier |in| +//@[91:99) Identifier |accounts| +//@[99:100) Colon |:| +//@[101:102) LeftBrace |{| +//@[102:103) NewLine |\n| + name: '${name}-collection-${account.name}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:30) StringMiddlePiece |}-collection-${| +//@[30:37) Identifier |account| +//@[37:38) Dot |.| +//@[38:42) Identifier |name| +//@[42:44) StringRightPiece |}'| +//@[44:45) NewLine |\n| + location: account.location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) Identifier |location| +//@[28:29) NewLine |\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts +//@[4:19) Identifier |storageAccounts| +//@[19:20) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// one-to-one paired dependencies +//@[33:34) NewLine |\n| +resource firstSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { +//@[0:8) Identifier |resource| +//@[9:17) Identifier |firstSet| +//@[18:64) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[65:66) Assignment |=| +//@[67:68) LeftSquare |[| +//@[68:71) Identifier |for| +//@[72:73) Identifier |i| +//@[74:76) Identifier |in| +//@[77:82) Identifier |range| +//@[82:83) LeftParen |(| +//@[83:84) Integer |0| +//@[84:85) Comma |,| +//@[86:92) Identifier |length| +//@[92:93) LeftParen |(| +//@[93:101) Identifier |accounts| +//@[101:102) RightParen |)| +//@[102:103) RightParen |)| +//@[103:104) Colon |:| +//@[105:106) LeftBrace |{| +//@[106:107) NewLine |\n| + name: '${name}-set1-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:24) StringMiddlePiece |}-set1-${| +//@[24:25) Identifier |i| +//@[25:27) StringRightPiece |}'| +//@[27:28) NewLine |\n| + location: resourceGroup().location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +resource secondSet 'Microsoft.Storage/storageAccounts@2019-06-01' = [for i in range(0, length(accounts)): { +//@[0:8) Identifier |resource| +//@[9:18) Identifier |secondSet| +//@[19:65) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[66:67) Assignment |=| +//@[68:69) LeftSquare |[| +//@[69:72) Identifier |for| +//@[73:74) Identifier |i| +//@[75:77) Identifier |in| +//@[78:83) Identifier |range| +//@[83:84) LeftParen |(| +//@[84:85) Integer |0| +//@[85:86) Comma |,| +//@[87:93) Identifier |length| +//@[93:94) LeftParen |(| +//@[94:102) Identifier |accounts| +//@[102:103) RightParen |)| +//@[103:104) RightParen |)| +//@[104:105) Colon |:| +//@[106:107) LeftBrace |{| +//@[107:108) NewLine |\n| + name: '${name}-set2-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:24) StringMiddlePiece |}-set2-${| +//@[24:25) Identifier |i| +//@[25:27) StringRightPiece |}'| +//@[27:28) NewLine |\n| + location: resourceGroup().location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + firstSet[i] +//@[4:12) Identifier |firstSet| +//@[12:13) LeftSquare |[| +//@[13:14) Identifier |i| +//@[14:15) RightSquare |]| +//@[15:16) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// depending on collection and one resource in the collection optimizes the latter part away +//@[92:93) NewLine |\n| +resource anotherSingleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = { +//@[0:8) Identifier |resource| +//@[9:30) Identifier |anotherSingleResource| +//@[31:77) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[78:79) Assignment |=| +//@[80:81) LeftBrace |{| +//@[81:82) NewLine |\n| + name: '${name}single-resource-name' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:37) StringRightPiece |}single-resource-name'| +//@[37:38) NewLine |\n| + location: resourceGroup().location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:25) Identifier |resourceGroup| +//@[25:26) LeftParen |(| +//@[26:27) RightParen |)| +//@[27:28) Dot |.| +//@[28:36) Identifier |location| +//@[36:37) NewLine |\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:20) NewLine |\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:9) NewLine |\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:25) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + secondSet +//@[4:13) Identifier |secondSet| +//@[13:14) NewLine |\n| + secondSet[0] +//@[4:13) Identifier |secondSet| +//@[13:14) LeftSquare |[| +//@[14:15) Integer |0| +//@[15:16) RightSquare |]| +//@[16:17) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// vnets +//@[8:9) NewLine |\n| +var vnetConfigurations = [ +//@[0:3) Identifier |var| +//@[4:22) Identifier |vnetConfigurations| +//@[23:24) Assignment |=| +//@[25:26) LeftSquare |[| +//@[26:27) NewLine |\n| + { +//@[2:3) LeftBrace |{| +//@[3:4) NewLine |\n| + name: 'one' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'one'| +//@[15:16) NewLine |\n| + location: resourceGroup().location +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:27) Identifier |resourceGroup| +//@[27:28) LeftParen |(| +//@[28:29) RightParen |)| +//@[29:30) Dot |.| +//@[30:38) Identifier |location| +//@[38:39) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + { +//@[2:3) LeftBrace |{| +//@[3:4) NewLine |\n| + name: 'two' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'two'| +//@[15:16) NewLine |\n| + location: 'westus' +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:22) StringComplete |'westus'| +//@[22:23) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +] +//@[0:1) RightSquare |]| +//@[1:3) NewLine |\n\n| + +resource vnets 'Microsoft.Network/virtualNetworks@2020-06-01' = [for vnetConfig in vnetConfigurations: { +//@[0:8) Identifier |resource| +//@[9:14) Identifier |vnets| +//@[15:61) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[62:63) Assignment |=| +//@[64:65) LeftSquare |[| +//@[65:68) Identifier |for| +//@[69:79) Identifier |vnetConfig| +//@[80:82) Identifier |in| +//@[83:101) Identifier |vnetConfigurations| +//@[101:102) Colon |:| +//@[103:104) LeftBrace |{| +//@[104:105) NewLine |\n| + name: vnetConfig.name +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) Identifier |vnetConfig| +//@[18:19) Dot |.| +//@[19:23) Identifier |name| +//@[23:24) NewLine |\n| + location: vnetConfig.location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:22) Identifier |vnetConfig| +//@[22:23) Dot |.| +//@[23:31) Identifier |location| +//@[31:32) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// implicit dependency on single resource from a resource collection +//@[68:69) NewLine |\n| +resource implicitDependencyOnSingleResourceByIndex 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[0:8) Identifier |resource| +//@[9:50) Identifier |implicitDependencyOnSingleResourceByIndex| +//@[51:90) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[91:92) Assignment |=| +//@[93:94) LeftBrace |{| +//@[94:95) NewLine |\n| + name: 'test' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) StringComplete |'test'| +//@[14:15) NewLine |\n| + location: 'global' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'global'| +//@[20:21) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + resolutionVirtualNetworks: [ +//@[4:29) Identifier |resolutionVirtualNetworks| +//@[29:30) Colon |:| +//@[31:32) LeftSquare |[| +//@[32:33) NewLine |\n| + { +//@[6:7) LeftBrace |{| +//@[7:8) NewLine |\n| + id: vnets[index+1].id +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:17) Identifier |vnets| +//@[17:18) LeftSquare |[| +//@[18:23) Identifier |index| +//@[23:24) Plus |+| +//@[24:25) Integer |1| +//@[25:26) RightSquare |]| +//@[26:27) Dot |.| +//@[27:29) Identifier |id| +//@[29:30) NewLine |\n| + } +//@[6:7) RightBrace |}| +//@[7:8) NewLine |\n| + ] +//@[4:5) RightSquare |]| +//@[5:6) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// implicit and explicit dependency combined +//@[44:45) NewLine |\n| +resource combinedDependencies 'Microsoft.Network/dnsZones@2018-05-01' = { +//@[0:8) Identifier |resource| +//@[9:29) Identifier |combinedDependencies| +//@[30:69) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[70:71) Assignment |=| +//@[72:73) LeftBrace |{| +//@[73:74) NewLine |\n| + name: 'test2' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringComplete |'test2'| +//@[15:16) NewLine |\n| + location: 'global' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'global'| +//@[20:21) NewLine |\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) NewLine |\n| + resolutionVirtualNetworks: [ +//@[4:29) Identifier |resolutionVirtualNetworks| +//@[29:30) Colon |:| +//@[31:32) LeftSquare |[| +//@[32:33) NewLine |\n| + { +//@[6:7) LeftBrace |{| +//@[7:8) NewLine |\n| + id: vnets[index-1].id +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:17) Identifier |vnets| +//@[17:18) LeftSquare |[| +//@[18:23) Identifier |index| +//@[23:24) Minus |-| +//@[24:25) Integer |1| +//@[25:26) RightSquare |]| +//@[26:27) Dot |.| +//@[27:29) Identifier |id| +//@[29:30) NewLine |\n| + } +//@[6:7) RightBrace |}| +//@[7:8) NewLine |\n| + { +//@[6:7) LeftBrace |{| +//@[7:8) NewLine |\n| + id: vnets[index * 2].id +//@[8:10) Identifier |id| +//@[10:11) Colon |:| +//@[12:17) Identifier |vnets| +//@[17:18) LeftSquare |[| +//@[18:23) Identifier |index| +//@[24:25) Asterisk |*| +//@[26:27) Integer |2| +//@[27:28) RightSquare |]| +//@[28:29) Dot |.| +//@[29:31) Identifier |id| +//@[31:32) NewLine |\n| + } +//@[6:7) RightBrace |}| +//@[7:8) NewLine |\n| + ] +//@[4:5) RightSquare |]| +//@[5:6) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + vnets +//@[4:9) Identifier |vnets| +//@[9:10) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +// single module +//@[16:17) NewLine |\n| +module singleModule 'passthrough.bicep' = { +//@[0:6) Identifier |module| +//@[7:19) Identifier |singleModule| +//@[20:39) StringComplete |'passthrough.bicep'| +//@[40:41) Assignment |=| +//@[42:43) LeftBrace |{| +//@[43:44) NewLine |\n| + name: 'test' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) StringComplete |'test'| +//@[14:15) NewLine |\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: 'hello' +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:20) StringComplete |'hello'| +//@[20:21) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +var moduleSetup = [ +//@[0:3) Identifier |var| +//@[4:15) Identifier |moduleSetup| +//@[16:17) Assignment |=| +//@[18:19) LeftSquare |[| +//@[19:20) NewLine |\n| + 'one' +//@[2:7) StringComplete |'one'| +//@[7:8) NewLine |\n| + 'two' +//@[2:7) StringComplete |'two'| +//@[7:8) NewLine |\n| + 'three' +//@[2:9) StringComplete |'three'| +//@[9:10) NewLine |\n| +] +//@[0:1) RightSquare |]| +//@[1:3) NewLine |\n\n| + +// module collection plus explicit dependency on single module +//@[62:63) NewLine |\n| +module moduleCollectionWithSingleDependency 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[0:6) Identifier |module| +//@[7:43) Identifier |moduleCollectionWithSingleDependency| +//@[44:63) StringComplete |'passthrough.bicep'| +//@[64:65) Assignment |=| +//@[66:67) LeftSquare |[| +//@[67:70) Identifier |for| +//@[71:81) Identifier |moduleName| +//@[82:84) Identifier |in| +//@[85:96) Identifier |moduleSetup| +//@[96:97) Colon |:| +//@[98:99) LeftBrace |{| +//@[99:100) NewLine |\n| + name: moduleName +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) Identifier |moduleName| +//@[18:19) NewLine |\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: 'in-${moduleName}' +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:19) StringLeftPiece |'in-${| +//@[19:29) Identifier |moduleName| +//@[29:31) StringRightPiece |}'| +//@[31:32) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + singleModule +//@[4:16) Identifier |singleModule| +//@[16:17) NewLine |\n| + singleResource +//@[4:18) Identifier |singleResource| +//@[18:19) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// another module collection with dependency on another module collection +//@[73:74) NewLine |\n| +module moduleCollectionWithCollectionDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[0:6) Identifier |module| +//@[7:49) Identifier |moduleCollectionWithCollectionDependencies| +//@[50:69) StringComplete |'passthrough.bicep'| +//@[70:71) Assignment |=| +//@[72:73) LeftSquare |[| +//@[73:76) Identifier |for| +//@[77:87) Identifier |moduleName| +//@[88:90) Identifier |in| +//@[91:102) Identifier |moduleSetup| +//@[102:103) Colon |:| +//@[104:105) LeftBrace |{| +//@[105:106) NewLine |\n| + name: moduleName +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) Identifier |moduleName| +//@[18:19) NewLine |\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: 'in-${moduleName}' +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:19) StringLeftPiece |'in-${| +//@[19:29) Identifier |moduleName| +//@[29:31) StringRightPiece |}'| +//@[31:32) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts +//@[4:19) Identifier |storageAccounts| +//@[19:20) NewLine |\n| + moduleCollectionWithSingleDependency +//@[4:40) Identifier |moduleCollectionWithSingleDependency| +//@[40:41) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +module singleModuleWithIndexedDependencies 'passthrough.bicep' = { +//@[0:6) Identifier |module| +//@[7:42) Identifier |singleModuleWithIndexedDependencies| +//@[43:62) StringComplete |'passthrough.bicep'| +//@[63:64) Assignment |=| +//@[65:66) LeftBrace |{| +//@[66:67) NewLine |\n| + name: 'hello' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) StringComplete |'hello'| +//@[15:16) NewLine |\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: concat(moduleCollectionWithCollectionDependencies[index].outputs.myOutput, storageAccounts[index * 3].properties.accessTier) +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:19) Identifier |concat| +//@[19:20) LeftParen |(| +//@[20:62) Identifier |moduleCollectionWithCollectionDependencies| +//@[62:63) LeftSquare |[| +//@[63:68) Identifier |index| +//@[68:69) RightSquare |]| +//@[69:70) Dot |.| +//@[70:77) Identifier |outputs| +//@[77:78) Dot |.| +//@[78:86) Identifier |myOutput| +//@[86:87) Comma |,| +//@[88:103) Identifier |storageAccounts| +//@[103:104) LeftSquare |[| +//@[104:109) Identifier |index| +//@[110:111) Asterisk |*| +//@[112:113) Integer |3| +//@[113:114) RightSquare |]| +//@[114:115) Dot |.| +//@[115:125) Identifier |properties| +//@[125:126) Dot |.| +//@[126:136) Identifier |accessTier| +//@[136:137) RightParen |)| +//@[137:138) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts2[index - 10] +//@[4:20) Identifier |storageAccounts2| +//@[20:21) LeftSquare |[| +//@[21:26) Identifier |index| +//@[27:28) Minus |-| +//@[29:31) Integer |10| +//@[31:32) RightSquare |]| +//@[32:33) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +} +//@[0:1) RightBrace |}| +//@[1:3) NewLine |\n\n| + +module moduleCollectionWithIndexedDependencies 'passthrough.bicep' = [for moduleName in moduleSetup: { +//@[0:6) Identifier |module| +//@[7:46) Identifier |moduleCollectionWithIndexedDependencies| +//@[47:66) StringComplete |'passthrough.bicep'| +//@[67:68) Assignment |=| +//@[69:70) LeftSquare |[| +//@[70:73) Identifier |for| +//@[74:84) Identifier |moduleName| +//@[85:87) Identifier |in| +//@[88:99) Identifier |moduleSetup| +//@[99:100) Colon |:| +//@[101:102) LeftBrace |{| +//@[102:103) NewLine |\n| + name: moduleName +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:18) Identifier |moduleName| +//@[18:19) NewLine |\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:12) NewLine |\n| + myInput: '${moduleCollectionWithCollectionDependencies[index].outputs.myOutput} - ${storageAccounts[index * 3].properties.accessTier} - ${moduleName}' +//@[4:11) Identifier |myInput| +//@[11:12) Colon |:| +//@[13:16) StringLeftPiece |'${| +//@[16:58) Identifier |moduleCollectionWithCollectionDependencies| +//@[58:59) LeftSquare |[| +//@[59:64) Identifier |index| +//@[64:65) RightSquare |]| +//@[65:66) Dot |.| +//@[66:73) Identifier |outputs| +//@[73:74) Dot |.| +//@[74:82) Identifier |myOutput| +//@[82:88) StringMiddlePiece |} - ${| +//@[88:103) Identifier |storageAccounts| +//@[103:104) LeftSquare |[| +//@[104:109) Identifier |index| +//@[110:111) Asterisk |*| +//@[112:113) Integer |3| +//@[113:114) RightSquare |]| +//@[114:115) Dot |.| +//@[115:125) Identifier |properties| +//@[125:126) Dot |.| +//@[126:136) Identifier |accessTier| +//@[136:142) StringMiddlePiece |} - ${| +//@[142:152) Identifier |moduleName| +//@[152:154) StringRightPiece |}'| +//@[154:155) NewLine |\n| + } +//@[2:3) RightBrace |}| +//@[3:4) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + storageAccounts2[index - 9] +//@[4:20) Identifier |storageAccounts2| +//@[20:21) LeftSquare |[| +//@[21:26) Identifier |index| +//@[27:28) Minus |-| +//@[29:30) Integer |9| +//@[30:31) RightSquare |]| +//@[31:32) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +output indexedModulesName string = moduleCollectionWithSingleDependency[index].name +//@[0:6) Identifier |output| +//@[7:25) Identifier |indexedModulesName| +//@[26:32) Identifier |string| +//@[33:34) Assignment |=| +//@[35:71) Identifier |moduleCollectionWithSingleDependency| +//@[71:72) LeftSquare |[| +//@[72:77) Identifier |index| +//@[77:78) RightSquare |]| +//@[78:79) Dot |.| +//@[79:83) Identifier |name| +//@[83:84) NewLine |\n| +output indexedModuleOutput string = moduleCollectionWithSingleDependency[index * 1].outputs.myOutput +//@[0:6) Identifier |output| +//@[7:26) Identifier |indexedModuleOutput| +//@[27:33) Identifier |string| +//@[34:35) Assignment |=| +//@[36:72) Identifier |moduleCollectionWithSingleDependency| +//@[72:73) LeftSquare |[| +//@[73:78) Identifier |index| +//@[79:80) Asterisk |*| +//@[81:82) Integer |1| +//@[82:83) RightSquare |]| +//@[83:84) Dot |.| +//@[84:91) Identifier |outputs| +//@[91:92) Dot |.| +//@[92:100) Identifier |myOutput| +//@[100:102) NewLine |\n\n| + +// resource collection +//@[22:23) NewLine |\n| +resource existingStorageAccounts 'Microsoft.Storage/storageAccounts@2019-06-01' existing = [for account in accounts: { +//@[0:8) Identifier |resource| +//@[9:32) Identifier |existingStorageAccounts| +//@[33:79) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[80:88) Identifier |existing| +//@[89:90) Assignment |=| +//@[91:92) LeftSquare |[| +//@[92:95) Identifier |for| +//@[96:103) Identifier |account| +//@[104:106) Identifier |in| +//@[107:115) Identifier |accounts| +//@[115:116) Colon |:| +//@[117:118) LeftBrace |{| +//@[118:119) NewLine |\n| + name: '${name}-existing-${account.name}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:11) StringLeftPiece |'${| +//@[11:15) Identifier |name| +//@[15:28) StringMiddlePiece |}-existing-${| +//@[28:35) Identifier |account| +//@[35:36) Dot |.| +//@[36:40) Identifier |name| +//@[40:42) StringRightPiece |}'| +//@[42:43) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +output existingIndexedResourceName string = existingStorageAccounts[index * 0].name +//@[0:6) Identifier |output| +//@[7:34) Identifier |existingIndexedResourceName| +//@[35:41) Identifier |string| +//@[42:43) Assignment |=| +//@[44:67) Identifier |existingStorageAccounts| +//@[67:68) LeftSquare |[| +//@[68:73) Identifier |index| +//@[74:75) Asterisk |*| +//@[76:77) Integer |0| +//@[77:78) RightSquare |]| +//@[78:79) Dot |.| +//@[79:83) Identifier |name| +//@[83:84) NewLine |\n| +output existingIndexedResourceId string = existingStorageAccounts[index * 1].id +//@[0:6) Identifier |output| +//@[7:32) Identifier |existingIndexedResourceId| +//@[33:39) Identifier |string| +//@[40:41) Assignment |=| +//@[42:65) Identifier |existingStorageAccounts| +//@[65:66) LeftSquare |[| +//@[66:71) Identifier |index| +//@[72:73) Asterisk |*| +//@[74:75) Integer |1| +//@[75:76) RightSquare |]| +//@[76:77) Dot |.| +//@[77:79) Identifier |id| +//@[79:80) NewLine |\n| +output existingIndexedResourceType string = existingStorageAccounts[index+2].type +//@[0:6) Identifier |output| +//@[7:34) Identifier |existingIndexedResourceType| +//@[35:41) Identifier |string| +//@[42:43) Assignment |=| +//@[44:67) Identifier |existingStorageAccounts| +//@[67:68) LeftSquare |[| +//@[68:73) Identifier |index| +//@[73:74) Plus |+| +//@[74:75) Integer |2| +//@[75:76) RightSquare |]| +//@[76:77) Dot |.| +//@[77:81) Identifier |type| +//@[81:82) NewLine |\n| +output existingIndexedResourceApiVersion string = existingStorageAccounts[index-7].apiVersion +//@[0:6) Identifier |output| +//@[7:40) Identifier |existingIndexedResourceApiVersion| +//@[41:47) Identifier |string| +//@[48:49) Assignment |=| +//@[50:73) Identifier |existingStorageAccounts| +//@[73:74) LeftSquare |[| +//@[74:79) Identifier |index| +//@[79:80) Minus |-| +//@[80:81) Integer |7| +//@[81:82) RightSquare |]| +//@[82:83) Dot |.| +//@[83:93) Identifier |apiVersion| +//@[93:94) NewLine |\n| +output existingIndexedResourceLocation string = existingStorageAccounts[index/2].location +//@[0:6) Identifier |output| +//@[7:38) Identifier |existingIndexedResourceLocation| +//@[39:45) Identifier |string| +//@[46:47) Assignment |=| +//@[48:71) Identifier |existingStorageAccounts| +//@[71:72) LeftSquare |[| +//@[72:77) Identifier |index| +//@[77:78) Slash |/| +//@[78:79) Integer |2| +//@[79:80) RightSquare |]| +//@[80:81) Dot |.| +//@[81:89) Identifier |location| +//@[89:90) NewLine |\n| +output existingIndexedResourceAccessTier string = existingStorageAccounts[index%3].properties.accessTier +//@[0:6) Identifier |output| +//@[7:40) Identifier |existingIndexedResourceAccessTier| +//@[41:47) Identifier |string| +//@[48:49) Assignment |=| +//@[50:73) Identifier |existingStorageAccounts| +//@[73:74) LeftSquare |[| +//@[74:79) Identifier |index| +//@[79:80) Modulo |%| +//@[80:81) Integer |3| +//@[81:82) RightSquare |]| +//@[82:83) Dot |.| +//@[83:93) Identifier |properties| +//@[93:94) Dot |.| +//@[94:104) Identifier |accessTier| +//@[104:106) NewLine |\n\n| + +resource duplicatedNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { +//@[0:8) Identifier |resource| +//@[9:24) Identifier |duplicatedNames| +//@[25:64) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[65:66) Assignment |=| +//@[67:68) LeftSquare |[| +//@[68:71) Identifier |for| +//@[72:76) Identifier |zone| +//@[77:79) Identifier |in| +//@[80:81) LeftSquare |[| +//@[81:82) RightSquare |]| +//@[82:83) Colon |:| +//@[84:85) LeftBrace |{| +//@[85:86) NewLine |\n| + name: 'no loop variable' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:26) StringComplete |'no loop variable'| +//@[26:27) NewLine |\n| + location: 'eastus' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'eastus'| +//@[20:21) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\n\n| + +// reference to a resource collection whose name expression does not reference any loop variables +//@[97:98) NewLine |\n| +resource referenceToDuplicateNames 'Microsoft.Network/dnsZones@2018-05-01' = [for zone in []: { +//@[0:8) Identifier |resource| +//@[9:34) Identifier |referenceToDuplicateNames| +//@[35:74) StringComplete |'Microsoft.Network/dnsZones@2018-05-01'| +//@[75:76) Assignment |=| +//@[77:78) LeftSquare |[| +//@[78:81) Identifier |for| +//@[82:86) Identifier |zone| +//@[87:89) Identifier |in| +//@[90:91) LeftSquare |[| +//@[91:92) RightSquare |]| +//@[92:93) Colon |:| +//@[94:95) LeftBrace |{| +//@[95:96) NewLine |\n| + name: 'no loop variable' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:26) StringComplete |'no loop variable'| +//@[26:27) NewLine |\n| + location: 'eastus' +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:20) StringComplete |'eastus'| +//@[20:21) NewLine |\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:15) NewLine |\n| + duplicatedNames[index] +//@[4:19) Identifier |duplicatedNames| +//@[19:20) LeftSquare |[| +//@[20:25) Identifier |index| +//@[25:26) RightSquare |]| +//@[26:27) NewLine |\n| + ] +//@[2:3) RightSquare |]| +//@[3:4) NewLine |\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/Loops_LF/passthrough.bicep b/src/Bicep.Core.Samples/Files/Loops_LF/passthrough.bicep new file mode 100644 index 00000000000..f8596287a4c --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Loops_LF/passthrough.bicep @@ -0,0 +1,3 @@ +param myInput string + +output myOutput string = myInput \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.bicep index 005941196ab..8df2568e500 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.bicep +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.bicep @@ -103,4 +103,118 @@ output stringOutputA string = modATest.outputs.stringOutputA output stringOutputB string = modATest.outputs.stringOutputB output objOutput object = modATest.outputs.objOutput output arrayOutput array = modATest.outputs.arrayOutput -output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputObj \ No newline at end of file +output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputObj + +/* + valid loop cases +*/ +var myModules = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +var emptyArray = [] + +// simple module loop +module storageResources 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [] + objParam: module + stringParamB: module.location + } +}] + +// nested module loop +module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [for i in range(0,3): concat('test-', i, '-', module.name)] + objParam: module + stringParamB: module.location + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ + name: 'hello-${x}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +var duplicateAcrossScopes = 'hello' +module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { + name: 'hello-${duplicateAcrossScopes}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] + } +}] + +var someDuplicate = true +var otherDuplicate = false +module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { + name: 'hello-${someDuplicate}' + params: { + objParam: {} + stringParamB: 'test' + arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] + } +}] + +module propertyLoopInsideParameterValue 'modulea.bicep' = { + name: 'propertyLoopInsideParameterValue' + params: { + objParam: { + a: [for i in range(0,10): i] + b: [for i in range(1,2): i] + c: { + d: [for j in range(2,3): j] + } + e: [for k in range(4,4): { + f: k + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7,7): j] + } + ] + } +} + +module propertyLoopInsideParameterValueInsideModuleLoop 'modulea.bicep' = [for thing in range(0,1): { + name: 'propertyLoopInsideParameterValueInsideModuleLoop' + params: { + objParam: { + a: [for i in range(0,10): i + thing] + b: [for i in range(1,2): i * thing] + c: { + d: [for j in range(2,3): j] + } + e: [for k in range(4,4): { + f: k - thing + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7,7): j % thing] + } + ] + } +}] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.diagnostics.bicep index c90cbcc9466..05febebe074 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.diagnostics.bicep +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.diagnostics.bicep @@ -106,3 +106,117 @@ output stringOutputB string = modATest.outputs.stringOutputB output objOutput object = modATest.outputs.objOutput output arrayOutput array = modATest.outputs.arrayOutput output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputObj + +/* + valid loop cases +*/ +var myModules = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +var emptyArray = [] + +// simple module loop +module storageResources 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [] + objParam: module + stringParamB: module.location + } +}] + +// nested module loop +module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [for i in range(0,3): concat('test-', i, '-', module.name)] + objParam: module + stringParamB: module.location + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ + name: 'hello-${x}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +var duplicateAcrossScopes = 'hello' +module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { + name: 'hello-${duplicateAcrossScopes}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] + } +}] + +var someDuplicate = true +var otherDuplicate = false +module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { + name: 'hello-${someDuplicate}' + params: { + objParam: {} + stringParamB: 'test' + arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] + } +}] + +module propertyLoopInsideParameterValue 'modulea.bicep' = { + name: 'propertyLoopInsideParameterValue' + params: { + objParam: { + a: [for i in range(0,10): i] + b: [for i in range(1,2): i] + c: { + d: [for j in range(2,3): j] + } + e: [for k in range(4,4): { + f: k + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7,7): j] + } + ] + } +} + +module propertyLoopInsideParameterValueInsideModuleLoop 'modulea.bicep' = [for thing in range(0,1): { + name: 'propertyLoopInsideParameterValueInsideModuleLoop' + params: { + objParam: { + a: [for i in range(0,10): i + thing] + b: [for i in range(1,2): i * thing] + c: { + d: [for j in range(2,3): j] + } + e: [for k in range(4,4): { + f: k - thing + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7,7): j % thing] + } + ] + } +}] diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.formatted.bicep index e04aa21a019..e86778f11e3 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.formatted.bicep +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.formatted.bicep @@ -103,3 +103,117 @@ output stringOutputB string = modATest.outputs.stringOutputB output objOutput object = modATest.outputs.objOutput output arrayOutput array = modATest.outputs.arrayOutput output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputObj + +/* + valid loop cases +*/ +var myModules = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +var emptyArray = [] + +// simple module loop +module storageResources 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [] + objParam: module + stringParamB: module.location + } +}] + +// nested module loop +module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [for i in range(0, 3): concat('test-', i, '-', module.name)] + objParam: module + stringParamB: module.location + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray: { + name: 'hello-${x}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +var duplicateAcrossScopes = 'hello' +module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { + name: 'hello-${duplicateAcrossScopes}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] + } +}] + +var someDuplicate = true +var otherDuplicate = false +module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { + name: 'hello-${someDuplicate}' + params: { + objParam: {} + stringParamB: 'test' + arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] + } +}] + +module propertyLoopInsideParameterValue 'modulea.bicep' = { + name: 'propertyLoopInsideParameterValue' + params: { + objParam: { + a: [for i in range(0, 10): i] + b: [for i in range(1, 2): i] + c: { + d: [for j in range(2, 3): j] + } + e: [for k in range(4, 4): { + f: k + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7, 7): j] + } + ] + } +} + +module propertyLoopInsideParameterValueInsideModuleLoop 'modulea.bicep' = [for thing in range(0, 1): { + name: 'propertyLoopInsideParameterValueInsideModuleLoop' + params: { + objParam: { + a: [for i in range(0, 10): i + thing] + b: [for i in range(1, 2): i * thing] + c: { + d: [for j in range(2, 3): j] + } + e: [for k in range(4, 4): { + f: k - thing + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7, 7): j % thing] + } + ] + } +}] diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json index 970117edc67..2bee5d3b718 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.json @@ -8,6 +8,22 @@ } }, "functions": [], + "variables": { + "myModules": [ + { + "name": "one", + "location": "eastus2" + }, + { + "name": "two", + "location": "westus" + } + ], + "emptyArray": [], + "duplicateAcrossScopes": "hello", + "someDuplicate": true, + "otherDuplicate": false + }, "resources": [ { "type": "Mock.Rp/mockResource", @@ -579,6 +595,677 @@ "[resourceId('Microsoft.Resources/deployments', 'optionalWithAllParamsAndManualDependency')]", "[resourceId('Mock.Rp/mockResource', 'harry')]" ] + }, + { + "copy": { + "name": "storageResources", + "count": "[length(variables('myModules'))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[variables('myModules')[copyIndex()].name]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "arrayParam": { + "value": [] + }, + "objParam": { + "value": "[variables('myModules')[copyIndex()]]" + }, + "stringParamB": { + "value": "[variables('myModules')[copyIndex()].location]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } + }, + { + "copy": { + "name": "nestedModuleLoop", + "count": "[length(variables('myModules'))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[variables('myModules')[copyIndex()].name]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "arrayParam": { + "copy": [ + { + "name": "value", + "count": "[length(range(0, 3))]", + "input": "[concat('test-', range(0, 3)[copyIndex('value')], '-', variables('myModules')[copyIndex()].name)]" + } + ] + }, + "objParam": { + "value": "[variables('myModules')[copyIndex()]]" + }, + "stringParamB": { + "value": "[variables('myModules')[copyIndex()].location]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } + }, + { + "copy": { + "name": "duplicateIdentifiersWithinLoop", + "count": "[length(variables('emptyArray'))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[format('hello-{0}', variables('emptyArray')[copyIndex()])]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "objParam": { + "value": {} + }, + "stringParamA": { + "value": "test" + }, + "stringParamB": { + "value": "test" + }, + "arrayParam": { + "copy": [ + { + "name": "value", + "count": "[length(variables('emptyArray'))]", + "input": "[variables('emptyArray')[copyIndex('value')]]" + } + ] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } + }, + { + "copy": { + "name": "duplicateInGlobalAndOneLoop", + "count": "[length(createArray())]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[format('hello-{0}', createArray()[copyIndex()])]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "objParam": { + "value": {} + }, + "stringParamA": { + "value": "test" + }, + "stringParamB": { + "value": "test" + }, + "arrayParam": { + "copy": [ + { + "name": "value", + "count": "[length(variables('emptyArray'))]", + "input": "[variables('emptyArray')[copyIndex('value')]]" + } + ] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } + }, + { + "copy": { + "name": "duplicatesEverywhere", + "count": "[length(createArray())]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "[format('hello-{0}', createArray()[copyIndex()])]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "objParam": { + "value": {} + }, + "stringParamB": { + "value": "test" + }, + "arrayParam": { + "copy": [ + { + "name": "value", + "count": "[length(variables('emptyArray'))]", + "input": "[format('{0}-{1}', createArray()[copyIndex()], variables('emptyArray')[copyIndex('value')])]" + } + ] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "propertyLoopInsideParameterValue", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "objParam": { + "value": { + "copy": [ + { + "name": "a", + "count": "[length(range(0, 10))]", + "input": "[range(0, 10)[copyIndex('a')]]" + }, + { + "name": "b", + "count": "[length(range(1, 2))]", + "input": "[range(1, 2)[copyIndex('b')]]" + }, + { + "name": "e", + "count": "[length(range(4, 4))]", + "input": { + "f": "[range(4, 4)[copyIndex('e')]]" + } + } + ], + "c": { + "copy": [ + { + "name": "d", + "count": "[length(range(2, 3))]", + "input": "[range(2, 3)[copyIndex('d')]]" + } + ] + } + } + }, + "stringParamB": { + "value": "" + }, + "arrayParam": { + "value": [ + { + "copy": [ + { + "name": "e", + "count": "[length(range(7, 7))]", + "input": "[range(7, 7)[copyIndex('e')]]" + } + ] + } + ] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } + }, + { + "copy": { + "name": "propertyLoopInsideParameterValueInsideModuleLoop", + "count": "[length(range(0, 1))]" + }, + "type": "Microsoft.Resources/deployments", + "apiVersion": "2019-10-01", + "name": "propertyLoopInsideParameterValueInsideModuleLoop", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "objParam": { + "value": { + "copy": [ + { + "name": "a", + "count": "[length(range(0, 10))]", + "input": "[add(range(0, 10)[copyIndex('a')], range(0, 1)[copyIndex()])]" + }, + { + "name": "b", + "count": "[length(range(1, 2))]", + "input": "[mul(range(1, 2)[copyIndex('b')], range(0, 1)[copyIndex()])]" + }, + { + "name": "e", + "count": "[length(range(4, 4))]", + "input": { + "f": "[sub(range(4, 4)[copyIndex('e')], range(0, 1)[copyIndex()])]" + } + } + ], + "c": { + "copy": [ + { + "name": "d", + "count": "[length(range(2, 3))]", + "input": "[range(2, 3)[copyIndex('d')]]" + } + ] + } + } + }, + "stringParamB": { + "value": "" + }, + "arrayParam": { + "value": [ + { + "copy": [ + { + "name": "e", + "count": "[length(range(7, 7))]", + "input": "[mod(range(7, 7)[copyIndex('e')], range(0, 1)[copyIndex()])]" + } + ] + } + ] + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "stringParamA": { + "type": "string", + "defaultValue": "test" + }, + "stringParamB": { + "type": "string" + }, + "objParam": { + "type": "object" + }, + "arrayParam": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "basicblobs", + "location": "[parameters('stringParamA')]" + }, + { + "type": "Mock.Rp/mockResource", + "apiVersion": "2020-01-01", + "name": "myZone", + "location": "[parameters('stringParamB')]" + } + ], + "outputs": { + "stringOutputA": { + "type": "string", + "value": "[parameters('stringParamA')]" + }, + "stringOutputB": { + "type": "string", + "value": "[parameters('stringParamB')]" + }, + "objOutput": { + "type": "object", + "value": "[reference(resourceId('Mock.Rp/mockResource', 'basicblobs'))]" + }, + "arrayOutput": { + "type": "array", + "value": [ + "[resourceId('Mock.Rp/mockResource', 'basicblobs')]", + "[resourceId('Mock.Rp/mockResource', 'myZone')]" + ] + } + } + } + } } ], "outputs": { @@ -607,7 +1294,7 @@ "_generator": { "name": "bicep", "version": "dev", - "templateHash": "4541485523683189076" + "templateHash": "5916075395955971227" } } } \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.symbols.bicep index 1981a4064d7..50b28f89023 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.symbols.bicep +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.symbols.bicep @@ -121,3 +121,149 @@ output arrayOutput array = modATest.outputs.arrayOutput //@[7:18) Output arrayOutput. Type: array. Declaration start char: 0, length: 55 output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputObj //@[7:30) Output modCalculatedNameOutput. Type: object. Declaration start char: 0, length: 82 + +/* + valid loop cases +*/ +var myModules = [ +//@[4:13) Variable myModules. Type: array. Declaration start char: 0, length: 123 + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +var emptyArray = [] +//@[4:14) Variable emptyArray. Type: array. Declaration start char: 0, length: 19 + +// simple module loop +module storageResources 'modulea.bicep' = [for module in myModules: { +//@[47:53) Local module. Type: any. Declaration start char: 47, length: 6 +//@[7:23) Module storageResources. Type: module[]. Declaration start char: 0, length: 189 + name: module.name + params: { + arrayParam: [] + objParam: module + stringParamB: module.location + } +}] + +// nested module loop +module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { +//@[47:53) Local module. Type: any. Declaration start char: 47, length: 6 +//@[7:23) Module nestedModuleLoop. Type: module[]. Declaration start char: 0, length: 246 + name: module.name + params: { + arrayParam: [for i in range(0,3): concat('test-', i, '-', module.name)] +//@[21:22) Local i. Type: int. Declaration start char: 21, length: 1 + objParam: module + stringParamB: module.location + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ +//@[61:62) Local x. Type: any. Declaration start char: 61, length: 1 +//@[7:37) Module duplicateIdentifiersWithinLoop. Type: module[]. Declaration start char: 0, length: 234 + name: 'hello-${x}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] +//@[21:22) Local x. Type: any. Declaration start char: 21, length: 1 + } +}] + +// duplicate identifiers across scopes are allowed (inner hides the outer) +var duplicateAcrossScopes = 'hello' +//@[4:25) Variable duplicateAcrossScopes. Type: 'hello'. Declaration start char: 0, length: 35 +module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { +//@[58:79) Local duplicateAcrossScopes. Type: any. Declaration start char: 58, length: 21 +//@[7:34) Module duplicateInGlobalAndOneLoop. Type: module[]. Declaration start char: 0, length: 264 + name: 'hello-${duplicateAcrossScopes}' + params: { + objParam: {} + stringParamA: 'test' + stringParamB: 'test' + arrayParam: [for x in emptyArray: x] +//@[21:22) Local x. Type: any. Declaration start char: 21, length: 1 + } +}] + +var someDuplicate = true +//@[4:17) Variable someDuplicate. Type: bool. Declaration start char: 0, length: 24 +var otherDuplicate = false +//@[4:18) Variable otherDuplicate. Type: bool. Declaration start char: 0, length: 26 +module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { +//@[51:64) Local someDuplicate. Type: any. Declaration start char: 51, length: 13 +//@[7:27) Module duplicatesEverywhere. Type: module[]. Declaration start char: 0, length: 263 + name: 'hello-${someDuplicate}' + params: { + objParam: {} + stringParamB: 'test' + arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] +//@[21:35) Local otherDuplicate. Type: any. Declaration start char: 21, length: 14 + } +}] + +module propertyLoopInsideParameterValue 'modulea.bicep' = { +//@[7:39) Module propertyLoopInsideParameterValue. Type: module. Declaration start char: 0, length: 438 + name: 'propertyLoopInsideParameterValue' + params: { + objParam: { + a: [for i in range(0,10): i] +//@[14:15) Local i. Type: int. Declaration start char: 14, length: 1 + b: [for i in range(1,2): i] +//@[14:15) Local i. Type: int. Declaration start char: 14, length: 1 + c: { + d: [for j in range(2,3): j] +//@[16:17) Local j. Type: int. Declaration start char: 16, length: 1 + } + e: [for k in range(4,4): { +//@[14:15) Local k. Type: int. Declaration start char: 14, length: 1 + f: k + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7,7): j] +//@[16:17) Local j. Type: int. Declaration start char: 16, length: 1 + } + ] + } +} + +module propertyLoopInsideParameterValueInsideModuleLoop 'modulea.bicep' = [for thing in range(0,1): { +//@[79:84) Local thing. Type: int. Declaration start char: 79, length: 5 +//@[7:55) Module propertyLoopInsideParameterValueInsideModuleLoop. Type: module[]. Declaration start char: 0, length: 529 + name: 'propertyLoopInsideParameterValueInsideModuleLoop' + params: { + objParam: { + a: [for i in range(0,10): i + thing] +//@[14:15) Local i. Type: int. Declaration start char: 14, length: 1 + b: [for i in range(1,2): i * thing] +//@[14:15) Local i. Type: int. Declaration start char: 14, length: 1 + c: { + d: [for j in range(2,3): j] +//@[16:17) Local j. Type: int. Declaration start char: 16, length: 1 + } + e: [for k in range(4,4): { +//@[14:15) Local k. Type: int. Declaration start char: 14, length: 1 + f: k - thing + }] + } + stringParamB: '' + arrayParam: [ + { + e: [for j in range(7,7): j % thing] +//@[16:17) Local j. Type: int. Declaration start char: 16, length: 1 + } + ] + } +}] diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.syntax.bicep index 1790b25a103..334992b999e 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.syntax.bicep +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.syntax.bicep @@ -840,4 +840,1139 @@ output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputO //@[72:73) Dot |.| //@[73:82) IdentifierSyntax //@[73:82) Identifier |outputObj| -//@[82:82) EndOfFile || +//@[82:86) NewLine |\r\n\r\n| + +/* + valid loop cases +*/ +//@[3:5) NewLine |\r\n| +var myModules = [ +//@[0:123) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:13) IdentifierSyntax +//@[4:13) Identifier |myModules| +//@[14:15) Assignment |=| +//@[16:123) ArraySyntax +//@[16:17) LeftSquare |[| +//@[17:19) NewLine |\r\n| + { +//@[2:50) ArrayItemSyntax +//@[2:50) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'one' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'one'| +//@[15:17) NewLine |\r\n| + location: 'eastus2' +//@[4:23) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:23) StringSyntax +//@[14:23) StringComplete |'eastus2'| +//@[23:25) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + { +//@[2:49) ArrayItemSyntax +//@[2:49) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'two' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'two'| +//@[15:17) NewLine |\r\n| + location: 'westus' +//@[4:22) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:22) StringSyntax +//@[14:22) StringComplete |'westus'| +//@[22:24) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +] +//@[0:1) RightSquare |]| +//@[1:5) NewLine |\r\n\r\n| + +var emptyArray = [] +//@[0:19) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |emptyArray| +//@[15:16) Assignment |=| +//@[17:19) ArraySyntax +//@[17:18) LeftSquare |[| +//@[18:19) RightSquare |]| +//@[19:23) NewLine |\r\n\r\n| + +// simple module loop +//@[21:23) NewLine |\r\n| +module storageResources 'modulea.bicep' = [for module in myModules: { +//@[0:189) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:23) IdentifierSyntax +//@[7:23) Identifier |storageResources| +//@[24:39) StringSyntax +//@[24:39) StringComplete |'modulea.bicep'| +//@[40:41) Assignment |=| +//@[42:189) ForSyntax +//@[42:43) LeftSquare |[| +//@[43:46) Identifier |for| +//@[47:53) LocalVariableSyntax +//@[47:53) IdentifierSyntax +//@[47:53) Identifier |module| +//@[54:56) Identifier |in| +//@[57:66) VariableAccessSyntax +//@[57:66) IdentifierSyntax +//@[57:66) Identifier |myModules| +//@[66:67) Colon |:| +//@[68:188) ObjectSyntax +//@[68:69) LeftBrace |{| +//@[69:71) NewLine |\r\n| + name: module.name +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:19) PropertyAccessSyntax +//@[8:14) VariableAccessSyntax +//@[8:14) IdentifierSyntax +//@[8:14) Identifier |module| +//@[14:15) Dot |.| +//@[15:19) IdentifierSyntax +//@[15:19) Identifier |name| +//@[19:21) NewLine |\r\n| + params: { +//@[2:93) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:93) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + arrayParam: [] +//@[4:18) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:18) ArraySyntax +//@[16:17) LeftSquare |[| +//@[17:18) RightSquare |]| +//@[18:20) NewLine |\r\n| + objParam: module +//@[4:20) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:20) VariableAccessSyntax +//@[14:20) IdentifierSyntax +//@[14:20) Identifier |module| +//@[20:22) NewLine |\r\n| + stringParamB: module.location +//@[4:33) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:33) PropertyAccessSyntax +//@[18:24) VariableAccessSyntax +//@[18:24) IdentifierSyntax +//@[18:24) Identifier |module| +//@[24:25) Dot |.| +//@[25:33) IdentifierSyntax +//@[25:33) Identifier |location| +//@[33:35) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// nested module loop +//@[21:23) NewLine |\r\n| +module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { +//@[0:246) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:23) IdentifierSyntax +//@[7:23) Identifier |nestedModuleLoop| +//@[24:39) StringSyntax +//@[24:39) StringComplete |'modulea.bicep'| +//@[40:41) Assignment |=| +//@[42:246) ForSyntax +//@[42:43) LeftSquare |[| +//@[43:46) Identifier |for| +//@[47:53) LocalVariableSyntax +//@[47:53) IdentifierSyntax +//@[47:53) Identifier |module| +//@[54:56) Identifier |in| +//@[57:66) VariableAccessSyntax +//@[57:66) IdentifierSyntax +//@[57:66) Identifier |myModules| +//@[66:67) Colon |:| +//@[68:245) ObjectSyntax +//@[68:69) LeftBrace |{| +//@[69:71) NewLine |\r\n| + name: module.name +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:19) PropertyAccessSyntax +//@[8:14) VariableAccessSyntax +//@[8:14) IdentifierSyntax +//@[8:14) Identifier |module| +//@[14:15) Dot |.| +//@[15:19) IdentifierSyntax +//@[15:19) Identifier |name| +//@[19:21) NewLine |\r\n| + params: { +//@[2:150) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:150) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + arrayParam: [for i in range(0,3): concat('test-', i, '-', module.name)] +//@[4:75) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:75) ForSyntax +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:22) LocalVariableSyntax +//@[21:22) IdentifierSyntax +//@[21:22) Identifier |i| +//@[23:25) Identifier |in| +//@[26:36) FunctionCallSyntax +//@[26:31) IdentifierSyntax +//@[26:31) Identifier |range| +//@[31:32) LeftParen |(| +//@[32:34) FunctionArgumentSyntax +//@[32:33) IntegerLiteralSyntax +//@[32:33) Integer |0| +//@[33:34) Comma |,| +//@[34:35) FunctionArgumentSyntax +//@[34:35) IntegerLiteralSyntax +//@[34:35) Integer |3| +//@[35:36) RightParen |)| +//@[36:37) Colon |:| +//@[38:74) FunctionCallSyntax +//@[38:44) IdentifierSyntax +//@[38:44) Identifier |concat| +//@[44:45) LeftParen |(| +//@[45:53) FunctionArgumentSyntax +//@[45:52) StringSyntax +//@[45:52) StringComplete |'test-'| +//@[52:53) Comma |,| +//@[54:56) FunctionArgumentSyntax +//@[54:55) VariableAccessSyntax +//@[54:55) IdentifierSyntax +//@[54:55) Identifier |i| +//@[55:56) Comma |,| +//@[57:61) FunctionArgumentSyntax +//@[57:60) StringSyntax +//@[57:60) StringComplete |'-'| +//@[60:61) Comma |,| +//@[62:73) FunctionArgumentSyntax +//@[62:73) PropertyAccessSyntax +//@[62:68) VariableAccessSyntax +//@[62:68) IdentifierSyntax +//@[62:68) Identifier |module| +//@[68:69) Dot |.| +//@[69:73) IdentifierSyntax +//@[69:73) Identifier |name| +//@[73:74) RightParen |)| +//@[74:75) RightSquare |]| +//@[75:77) NewLine |\r\n| + objParam: module +//@[4:20) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:20) VariableAccessSyntax +//@[14:20) IdentifierSyntax +//@[14:20) Identifier |module| +//@[20:22) NewLine |\r\n| + stringParamB: module.location +//@[4:33) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:33) PropertyAccessSyntax +//@[18:24) VariableAccessSyntax +//@[18:24) IdentifierSyntax +//@[18:24) Identifier |module| +//@[24:25) Dot |.| +//@[25:33) IdentifierSyntax +//@[25:33) Identifier |location| +//@[33:35) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifiers across scopes are allowed (inner hides the outer) +//@[74:76) NewLine |\r\n| +module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ +//@[0:234) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:37) IdentifierSyntax +//@[7:37) Identifier |duplicateIdentifiersWithinLoop| +//@[38:53) StringSyntax +//@[38:53) StringComplete |'modulea.bicep'| +//@[54:55) Assignment |=| +//@[56:234) ForSyntax +//@[56:57) LeftSquare |[| +//@[57:60) Identifier |for| +//@[61:62) LocalVariableSyntax +//@[61:62) IdentifierSyntax +//@[61:62) Identifier |x| +//@[63:65) Identifier |in| +//@[66:76) VariableAccessSyntax +//@[66:76) IdentifierSyntax +//@[66:76) Identifier |emptyArray| +//@[76:77) Colon |:| +//@[77:233) ObjectSyntax +//@[77:78) LeftBrace |{| +//@[78:80) NewLine |\r\n| + name: 'hello-${x}' +//@[2:20) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:20) StringSyntax +//@[8:17) StringLeftPiece |'hello-${| +//@[17:18) VariableAccessSyntax +//@[17:18) IdentifierSyntax +//@[17:18) Identifier |x| +//@[18:20) StringRightPiece |}'| +//@[20:22) NewLine |\r\n| + params: { +//@[2:128) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:128) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: {} +//@[4:16) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:16) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:18) NewLine |\r\n| + stringParamA: 'test' +//@[4:24) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamA| +//@[16:17) Colon |:| +//@[18:24) StringSyntax +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + stringParamB: 'test' +//@[4:24) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) StringSyntax +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + arrayParam: [for x in emptyArray: x] +//@[4:40) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:40) ForSyntax +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:22) LocalVariableSyntax +//@[21:22) IdentifierSyntax +//@[21:22) Identifier |x| +//@[23:25) Identifier |in| +//@[26:36) VariableAccessSyntax +//@[26:36) IdentifierSyntax +//@[26:36) Identifier |emptyArray| +//@[36:37) Colon |:| +//@[38:39) VariableAccessSyntax +//@[38:39) IdentifierSyntax +//@[38:39) Identifier |x| +//@[39:40) RightSquare |]| +//@[40:42) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifiers across scopes are allowed (inner hides the outer) +//@[74:76) NewLine |\r\n| +var duplicateAcrossScopes = 'hello' +//@[0:35) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:25) IdentifierSyntax +//@[4:25) Identifier |duplicateAcrossScopes| +//@[26:27) Assignment |=| +//@[28:35) StringSyntax +//@[28:35) StringComplete |'hello'| +//@[35:37) NewLine |\r\n| +module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { +//@[0:264) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:34) IdentifierSyntax +//@[7:34) Identifier |duplicateInGlobalAndOneLoop| +//@[35:50) StringSyntax +//@[35:50) StringComplete |'modulea.bicep'| +//@[51:52) Assignment |=| +//@[53:264) ForSyntax +//@[53:54) LeftSquare |[| +//@[54:57) Identifier |for| +//@[58:79) LocalVariableSyntax +//@[58:79) IdentifierSyntax +//@[58:79) Identifier |duplicateAcrossScopes| +//@[80:82) Identifier |in| +//@[83:85) ArraySyntax +//@[83:84) LeftSquare |[| +//@[84:85) RightSquare |]| +//@[85:86) Colon |:| +//@[87:263) ObjectSyntax +//@[87:88) LeftBrace |{| +//@[88:90) NewLine |\r\n| + name: 'hello-${duplicateAcrossScopes}' +//@[2:40) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:40) StringSyntax +//@[8:17) StringLeftPiece |'hello-${| +//@[17:38) VariableAccessSyntax +//@[17:38) IdentifierSyntax +//@[17:38) Identifier |duplicateAcrossScopes| +//@[38:40) StringRightPiece |}'| +//@[40:42) NewLine |\r\n| + params: { +//@[2:128) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:128) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: {} +//@[4:16) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:16) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:18) NewLine |\r\n| + stringParamA: 'test' +//@[4:24) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamA| +//@[16:17) Colon |:| +//@[18:24) StringSyntax +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + stringParamB: 'test' +//@[4:24) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) StringSyntax +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + arrayParam: [for x in emptyArray: x] +//@[4:40) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:40) ForSyntax +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:22) LocalVariableSyntax +//@[21:22) IdentifierSyntax +//@[21:22) Identifier |x| +//@[23:25) Identifier |in| +//@[26:36) VariableAccessSyntax +//@[26:36) IdentifierSyntax +//@[26:36) Identifier |emptyArray| +//@[36:37) Colon |:| +//@[38:39) VariableAccessSyntax +//@[38:39) IdentifierSyntax +//@[38:39) Identifier |x| +//@[39:40) RightSquare |]| +//@[40:42) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +var someDuplicate = true +//@[0:24) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:17) IdentifierSyntax +//@[4:17) Identifier |someDuplicate| +//@[18:19) Assignment |=| +//@[20:24) BooleanLiteralSyntax +//@[20:24) TrueKeyword |true| +//@[24:26) NewLine |\r\n| +var otherDuplicate = false +//@[0:26) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:18) IdentifierSyntax +//@[4:18) Identifier |otherDuplicate| +//@[19:20) Assignment |=| +//@[21:26) BooleanLiteralSyntax +//@[21:26) FalseKeyword |false| +//@[26:28) NewLine |\r\n| +module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { +//@[0:263) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:27) IdentifierSyntax +//@[7:27) Identifier |duplicatesEverywhere| +//@[28:43) StringSyntax +//@[28:43) StringComplete |'modulea.bicep'| +//@[44:45) Assignment |=| +//@[46:263) ForSyntax +//@[46:47) LeftSquare |[| +//@[47:50) Identifier |for| +//@[51:64) LocalVariableSyntax +//@[51:64) IdentifierSyntax +//@[51:64) Identifier |someDuplicate| +//@[65:67) Identifier |in| +//@[68:70) ArraySyntax +//@[68:69) LeftSquare |[| +//@[69:70) RightSquare |]| +//@[70:71) Colon |:| +//@[72:262) ObjectSyntax +//@[72:73) LeftBrace |{| +//@[73:75) NewLine |\r\n| + name: 'hello-${someDuplicate}' +//@[2:32) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:32) StringSyntax +//@[8:17) StringLeftPiece |'hello-${| +//@[17:30) VariableAccessSyntax +//@[17:30) IdentifierSyntax +//@[17:30) Identifier |someDuplicate| +//@[30:32) StringRightPiece |}'| +//@[32:34) NewLine |\r\n| + params: { +//@[2:150) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:150) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: {} +//@[4:16) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:16) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:18) NewLine |\r\n| + stringParamB: 'test' +//@[4:24) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) StringSyntax +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] +//@[4:88) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:88) ForSyntax +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:35) LocalVariableSyntax +//@[21:35) IdentifierSyntax +//@[21:35) Identifier |otherDuplicate| +//@[36:38) Identifier |in| +//@[39:49) VariableAccessSyntax +//@[39:49) IdentifierSyntax +//@[39:49) Identifier |emptyArray| +//@[49:50) Colon |:| +//@[51:87) StringSyntax +//@[51:54) StringLeftPiece |'${| +//@[54:67) VariableAccessSyntax +//@[54:67) IdentifierSyntax +//@[54:67) Identifier |someDuplicate| +//@[67:71) StringMiddlePiece |}-${| +//@[71:85) VariableAccessSyntax +//@[71:85) IdentifierSyntax +//@[71:85) Identifier |otherDuplicate| +//@[85:87) StringRightPiece |}'| +//@[87:88) RightSquare |]| +//@[88:90) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +module propertyLoopInsideParameterValue 'modulea.bicep' = { +//@[0:438) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:39) IdentifierSyntax +//@[7:39) Identifier |propertyLoopInsideParameterValue| +//@[40:55) StringSyntax +//@[40:55) StringComplete |'modulea.bicep'| +//@[56:57) Assignment |=| +//@[58:438) ObjectSyntax +//@[58:59) LeftBrace |{| +//@[59:61) NewLine |\r\n| + name: 'propertyLoopInsideParameterValue' +//@[2:42) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:42) StringSyntax +//@[8:42) StringComplete |'propertyLoopInsideParameterValue'| +//@[42:44) NewLine |\r\n| + params: { +//@[2:330) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:330) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: { +//@[4:209) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:209) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + a: [for i in range(0,10): i] +//@[6:34) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |a| +//@[7:8) Colon |:| +//@[9:34) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) LocalVariableSyntax +//@[14:15) IdentifierSyntax +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:30) FunctionCallSyntax +//@[19:24) IdentifierSyntax +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:27) FunctionArgumentSyntax +//@[25:26) IntegerLiteralSyntax +//@[25:26) Integer |0| +//@[26:27) Comma |,| +//@[27:29) FunctionArgumentSyntax +//@[27:29) IntegerLiteralSyntax +//@[27:29) Integer |10| +//@[29:30) RightParen |)| +//@[30:31) Colon |:| +//@[32:33) VariableAccessSyntax +//@[32:33) IdentifierSyntax +//@[32:33) Identifier |i| +//@[33:34) RightSquare |]| +//@[34:36) NewLine |\r\n| + b: [for i in range(1,2): i] +//@[6:33) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |b| +//@[7:8) Colon |:| +//@[9:33) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) LocalVariableSyntax +//@[14:15) IdentifierSyntax +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:29) FunctionCallSyntax +//@[19:24) IdentifierSyntax +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:27) FunctionArgumentSyntax +//@[25:26) IntegerLiteralSyntax +//@[25:26) Integer |1| +//@[26:27) Comma |,| +//@[27:28) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |2| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:32) VariableAccessSyntax +//@[31:32) IdentifierSyntax +//@[31:32) Identifier |i| +//@[32:33) RightSquare |]| +//@[33:35) NewLine |\r\n| + c: { +//@[6:56) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |c| +//@[7:8) Colon |:| +//@[9:56) ObjectSyntax +//@[9:10) LeftBrace |{| +//@[10:12) NewLine |\r\n| + d: [for j in range(2,3): j] +//@[8:35) ObjectPropertySyntax +//@[8:9) IdentifierSyntax +//@[8:9) Identifier |d| +//@[9:10) Colon |:| +//@[11:35) ForSyntax +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) LocalVariableSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:31) FunctionCallSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:29) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |2| +//@[28:29) Comma |,| +//@[29:30) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |3| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) VariableAccessSyntax +//@[33:34) IdentifierSyntax +//@[33:34) Identifier |j| +//@[34:35) RightSquare |]| +//@[35:37) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + e: [for k in range(4,4): { +//@[6:56) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |e| +//@[7:8) Colon |:| +//@[9:56) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) LocalVariableSyntax +//@[14:15) IdentifierSyntax +//@[14:15) Identifier |k| +//@[16:18) Identifier |in| +//@[19:29) FunctionCallSyntax +//@[19:24) IdentifierSyntax +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:27) FunctionArgumentSyntax +//@[25:26) IntegerLiteralSyntax +//@[25:26) Integer |4| +//@[26:27) Comma |,| +//@[27:28) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |4| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:55) ObjectSyntax +//@[31:32) LeftBrace |{| +//@[32:34) NewLine |\r\n| + f: k +//@[8:12) ObjectPropertySyntax +//@[8:9) IdentifierSyntax +//@[8:9) Identifier |f| +//@[9:10) Colon |:| +//@[11:12) VariableAccessSyntax +//@[11:12) IdentifierSyntax +//@[11:12) Identifier |k| +//@[12:14) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| + stringParamB: '' +//@[4:20) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:20) StringSyntax +//@[18:20) StringComplete |''| +//@[20:22) NewLine |\r\n| + arrayParam: [ +//@[4:79) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:79) ArraySyntax +//@[16:17) LeftSquare |[| +//@[17:19) NewLine |\r\n| + { +//@[6:53) ArrayItemSyntax +//@[6:53) ObjectSyntax +//@[6:7) LeftBrace |{| +//@[7:9) NewLine |\r\n| + e: [for j in range(7,7): j] +//@[8:35) ObjectPropertySyntax +//@[8:9) IdentifierSyntax +//@[8:9) Identifier |e| +//@[9:10) Colon |:| +//@[11:35) ForSyntax +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) LocalVariableSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:31) FunctionCallSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:29) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |7| +//@[28:29) Comma |,| +//@[29:30) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |7| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) VariableAccessSyntax +//@[33:34) IdentifierSyntax +//@[33:34) Identifier |j| +//@[34:35) RightSquare |]| +//@[35:37) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + ] +//@[4:5) RightSquare |]| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +module propertyLoopInsideParameterValueInsideModuleLoop 'modulea.bicep' = [for thing in range(0,1): { +//@[0:529) ModuleDeclarationSyntax +//@[0:6) Identifier |module| +//@[7:55) IdentifierSyntax +//@[7:55) Identifier |propertyLoopInsideParameterValueInsideModuleLoop| +//@[56:71) StringSyntax +//@[56:71) StringComplete |'modulea.bicep'| +//@[72:73) Assignment |=| +//@[74:529) ForSyntax +//@[74:75) LeftSquare |[| +//@[75:78) Identifier |for| +//@[79:84) LocalVariableSyntax +//@[79:84) IdentifierSyntax +//@[79:84) Identifier |thing| +//@[85:87) Identifier |in| +//@[88:98) FunctionCallSyntax +//@[88:93) IdentifierSyntax +//@[88:93) Identifier |range| +//@[93:94) LeftParen |(| +//@[94:96) FunctionArgumentSyntax +//@[94:95) IntegerLiteralSyntax +//@[94:95) Integer |0| +//@[95:96) Comma |,| +//@[96:97) FunctionArgumentSyntax +//@[96:97) IntegerLiteralSyntax +//@[96:97) Integer |1| +//@[97:98) RightParen |)| +//@[98:99) Colon |:| +//@[100:528) ObjectSyntax +//@[100:101) LeftBrace |{| +//@[101:103) NewLine |\r\n| + name: 'propertyLoopInsideParameterValueInsideModuleLoop' +//@[2:58) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:58) StringSyntax +//@[8:58) StringComplete |'propertyLoopInsideParameterValueInsideModuleLoop'| +//@[58:60) NewLine |\r\n| + params: { +//@[2:362) ObjectPropertySyntax +//@[2:8) IdentifierSyntax +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:362) ObjectSyntax +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: { +//@[4:233) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:233) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + a: [for i in range(0,10): i + thing] +//@[6:42) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |a| +//@[7:8) Colon |:| +//@[9:42) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) LocalVariableSyntax +//@[14:15) IdentifierSyntax +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:30) FunctionCallSyntax +//@[19:24) IdentifierSyntax +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:27) FunctionArgumentSyntax +//@[25:26) IntegerLiteralSyntax +//@[25:26) Integer |0| +//@[26:27) Comma |,| +//@[27:29) FunctionArgumentSyntax +//@[27:29) IntegerLiteralSyntax +//@[27:29) Integer |10| +//@[29:30) RightParen |)| +//@[30:31) Colon |:| +//@[32:41) BinaryOperationSyntax +//@[32:33) VariableAccessSyntax +//@[32:33) IdentifierSyntax +//@[32:33) Identifier |i| +//@[34:35) Plus |+| +//@[36:41) VariableAccessSyntax +//@[36:41) IdentifierSyntax +//@[36:41) Identifier |thing| +//@[41:42) RightSquare |]| +//@[42:44) NewLine |\r\n| + b: [for i in range(1,2): i * thing] +//@[6:41) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |b| +//@[7:8) Colon |:| +//@[9:41) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) LocalVariableSyntax +//@[14:15) IdentifierSyntax +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:29) FunctionCallSyntax +//@[19:24) IdentifierSyntax +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:27) FunctionArgumentSyntax +//@[25:26) IntegerLiteralSyntax +//@[25:26) Integer |1| +//@[26:27) Comma |,| +//@[27:28) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |2| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:40) BinaryOperationSyntax +//@[31:32) VariableAccessSyntax +//@[31:32) IdentifierSyntax +//@[31:32) Identifier |i| +//@[33:34) Asterisk |*| +//@[35:40) VariableAccessSyntax +//@[35:40) IdentifierSyntax +//@[35:40) Identifier |thing| +//@[40:41) RightSquare |]| +//@[41:43) NewLine |\r\n| + c: { +//@[6:56) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |c| +//@[7:8) Colon |:| +//@[9:56) ObjectSyntax +//@[9:10) LeftBrace |{| +//@[10:12) NewLine |\r\n| + d: [for j in range(2,3): j] +//@[8:35) ObjectPropertySyntax +//@[8:9) IdentifierSyntax +//@[8:9) Identifier |d| +//@[9:10) Colon |:| +//@[11:35) ForSyntax +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) LocalVariableSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:31) FunctionCallSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:29) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |2| +//@[28:29) Comma |,| +//@[29:30) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |3| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) VariableAccessSyntax +//@[33:34) IdentifierSyntax +//@[33:34) Identifier |j| +//@[34:35) RightSquare |]| +//@[35:37) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + e: [for k in range(4,4): { +//@[6:64) ObjectPropertySyntax +//@[6:7) IdentifierSyntax +//@[6:7) Identifier |e| +//@[7:8) Colon |:| +//@[9:64) ForSyntax +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) LocalVariableSyntax +//@[14:15) IdentifierSyntax +//@[14:15) Identifier |k| +//@[16:18) Identifier |in| +//@[19:29) FunctionCallSyntax +//@[19:24) IdentifierSyntax +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:27) FunctionArgumentSyntax +//@[25:26) IntegerLiteralSyntax +//@[25:26) Integer |4| +//@[26:27) Comma |,| +//@[27:28) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |4| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:63) ObjectSyntax +//@[31:32) LeftBrace |{| +//@[32:34) NewLine |\r\n| + f: k - thing +//@[8:20) ObjectPropertySyntax +//@[8:9) IdentifierSyntax +//@[8:9) Identifier |f| +//@[9:10) Colon |:| +//@[11:20) BinaryOperationSyntax +//@[11:12) VariableAccessSyntax +//@[11:12) IdentifierSyntax +//@[11:12) Identifier |k| +//@[13:14) Minus |-| +//@[15:20) VariableAccessSyntax +//@[15:20) IdentifierSyntax +//@[15:20) Identifier |thing| +//@[20:22) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| + stringParamB: '' +//@[4:20) ObjectPropertySyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:20) StringSyntax +//@[18:20) StringComplete |''| +//@[20:22) NewLine |\r\n| + arrayParam: [ +//@[4:87) ObjectPropertySyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:87) ArraySyntax +//@[16:17) LeftSquare |[| +//@[17:19) NewLine |\r\n| + { +//@[6:61) ArrayItemSyntax +//@[6:61) ObjectSyntax +//@[6:7) LeftBrace |{| +//@[7:9) NewLine |\r\n| + e: [for j in range(7,7): j % thing] +//@[8:43) ObjectPropertySyntax +//@[8:9) IdentifierSyntax +//@[8:9) Identifier |e| +//@[9:10) Colon |:| +//@[11:43) ForSyntax +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) LocalVariableSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:31) FunctionCallSyntax +//@[21:26) IdentifierSyntax +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:29) FunctionArgumentSyntax +//@[27:28) IntegerLiteralSyntax +//@[27:28) Integer |7| +//@[28:29) Comma |,| +//@[29:30) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |7| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:42) BinaryOperationSyntax +//@[33:34) VariableAccessSyntax +//@[33:34) IdentifierSyntax +//@[33:34) Identifier |j| +//@[35:36) Modulo |%| +//@[37:42) VariableAccessSyntax +//@[37:42) IdentifierSyntax +//@[37:42) Identifier |thing| +//@[42:43) RightSquare |]| +//@[43:45) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + ] +//@[4:5) RightSquare |]| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.tokens.bicep index f0a49ab4172..41a0ff9bc5b 100644 --- a/src/Bicep.Core.Samples/Files/Modules_CRLF/main.tokens.bicep +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/main.tokens.bicep @@ -535,4 +535,716 @@ output modCalculatedNameOutput object = moduleWithCalculatedName.outputs.outputO //@[65:72) Identifier |outputs| //@[72:73) Dot |.| //@[73:82) Identifier |outputObj| -//@[82:82) EndOfFile || +//@[82:86) NewLine |\r\n\r\n| + +/* + valid loop cases +*/ +//@[3:5) NewLine |\r\n| +var myModules = [ +//@[0:3) Identifier |var| +//@[4:13) Identifier |myModules| +//@[14:15) Assignment |=| +//@[16:17) LeftSquare |[| +//@[17:19) NewLine |\r\n| + { +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'one' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'one'| +//@[15:17) NewLine |\r\n| + location: 'eastus2' +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:23) StringComplete |'eastus2'| +//@[23:25) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + { +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'two' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'two'| +//@[15:17) NewLine |\r\n| + location: 'westus' +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:22) StringComplete |'westus'| +//@[22:24) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +] +//@[0:1) RightSquare |]| +//@[1:5) NewLine |\r\n\r\n| + +var emptyArray = [] +//@[0:3) Identifier |var| +//@[4:14) Identifier |emptyArray| +//@[15:16) Assignment |=| +//@[17:18) LeftSquare |[| +//@[18:19) RightSquare |]| +//@[19:23) NewLine |\r\n\r\n| + +// simple module loop +//@[21:23) NewLine |\r\n| +module storageResources 'modulea.bicep' = [for module in myModules: { +//@[0:6) Identifier |module| +//@[7:23) Identifier |storageResources| +//@[24:39) StringComplete |'modulea.bicep'| +//@[40:41) Assignment |=| +//@[42:43) LeftSquare |[| +//@[43:46) Identifier |for| +//@[47:53) Identifier |module| +//@[54:56) Identifier |in| +//@[57:66) Identifier |myModules| +//@[66:67) Colon |:| +//@[68:69) LeftBrace |{| +//@[69:71) NewLine |\r\n| + name: module.name +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) Identifier |module| +//@[14:15) Dot |.| +//@[15:19) Identifier |name| +//@[19:21) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + arrayParam: [] +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:18) RightSquare |]| +//@[18:20) NewLine |\r\n| + objParam: module +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:20) Identifier |module| +//@[20:22) NewLine |\r\n| + stringParamB: module.location +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) Identifier |module| +//@[24:25) Dot |.| +//@[25:33) Identifier |location| +//@[33:35) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// nested module loop +//@[21:23) NewLine |\r\n| +module nestedModuleLoop 'modulea.bicep' = [for module in myModules: { +//@[0:6) Identifier |module| +//@[7:23) Identifier |nestedModuleLoop| +//@[24:39) StringComplete |'modulea.bicep'| +//@[40:41) Assignment |=| +//@[42:43) LeftSquare |[| +//@[43:46) Identifier |for| +//@[47:53) Identifier |module| +//@[54:56) Identifier |in| +//@[57:66) Identifier |myModules| +//@[66:67) Colon |:| +//@[68:69) LeftBrace |{| +//@[69:71) NewLine |\r\n| + name: module.name +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) Identifier |module| +//@[14:15) Dot |.| +//@[15:19) Identifier |name| +//@[19:21) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + arrayParam: [for i in range(0,3): concat('test-', i, '-', module.name)] +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:22) Identifier |i| +//@[23:25) Identifier |in| +//@[26:31) Identifier |range| +//@[31:32) LeftParen |(| +//@[32:33) Integer |0| +//@[33:34) Comma |,| +//@[34:35) Integer |3| +//@[35:36) RightParen |)| +//@[36:37) Colon |:| +//@[38:44) Identifier |concat| +//@[44:45) LeftParen |(| +//@[45:52) StringComplete |'test-'| +//@[52:53) Comma |,| +//@[54:55) Identifier |i| +//@[55:56) Comma |,| +//@[57:60) StringComplete |'-'| +//@[60:61) Comma |,| +//@[62:68) Identifier |module| +//@[68:69) Dot |.| +//@[69:73) Identifier |name| +//@[73:74) RightParen |)| +//@[74:75) RightSquare |]| +//@[75:77) NewLine |\r\n| + objParam: module +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:20) Identifier |module| +//@[20:22) NewLine |\r\n| + stringParamB: module.location +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) Identifier |module| +//@[24:25) Dot |.| +//@[25:33) Identifier |location| +//@[33:35) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifiers across scopes are allowed (inner hides the outer) +//@[74:76) NewLine |\r\n| +module duplicateIdentifiersWithinLoop 'modulea.bicep' = [for x in emptyArray:{ +//@[0:6) Identifier |module| +//@[7:37) Identifier |duplicateIdentifiersWithinLoop| +//@[38:53) StringComplete |'modulea.bicep'| +//@[54:55) Assignment |=| +//@[56:57) LeftSquare |[| +//@[57:60) Identifier |for| +//@[61:62) Identifier |x| +//@[63:65) Identifier |in| +//@[66:76) Identifier |emptyArray| +//@[76:77) Colon |:| +//@[77:78) LeftBrace |{| +//@[78:80) NewLine |\r\n| + name: 'hello-${x}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringLeftPiece |'hello-${| +//@[17:18) Identifier |x| +//@[18:20) StringRightPiece |}'| +//@[20:22) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: {} +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:18) NewLine |\r\n| + stringParamA: 'test' +//@[4:16) Identifier |stringParamA| +//@[16:17) Colon |:| +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + stringParamB: 'test' +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + arrayParam: [for x in emptyArray: x] +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:22) Identifier |x| +//@[23:25) Identifier |in| +//@[26:36) Identifier |emptyArray| +//@[36:37) Colon |:| +//@[38:39) Identifier |x| +//@[39:40) RightSquare |]| +//@[40:42) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifiers across scopes are allowed (inner hides the outer) +//@[74:76) NewLine |\r\n| +var duplicateAcrossScopes = 'hello' +//@[0:3) Identifier |var| +//@[4:25) Identifier |duplicateAcrossScopes| +//@[26:27) Assignment |=| +//@[28:35) StringComplete |'hello'| +//@[35:37) NewLine |\r\n| +module duplicateInGlobalAndOneLoop 'modulea.bicep' = [for duplicateAcrossScopes in []: { +//@[0:6) Identifier |module| +//@[7:34) Identifier |duplicateInGlobalAndOneLoop| +//@[35:50) StringComplete |'modulea.bicep'| +//@[51:52) Assignment |=| +//@[53:54) LeftSquare |[| +//@[54:57) Identifier |for| +//@[58:79) Identifier |duplicateAcrossScopes| +//@[80:82) Identifier |in| +//@[83:84) LeftSquare |[| +//@[84:85) RightSquare |]| +//@[85:86) Colon |:| +//@[87:88) LeftBrace |{| +//@[88:90) NewLine |\r\n| + name: 'hello-${duplicateAcrossScopes}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringLeftPiece |'hello-${| +//@[17:38) Identifier |duplicateAcrossScopes| +//@[38:40) StringRightPiece |}'| +//@[40:42) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: {} +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:18) NewLine |\r\n| + stringParamA: 'test' +//@[4:16) Identifier |stringParamA| +//@[16:17) Colon |:| +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + stringParamB: 'test' +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + arrayParam: [for x in emptyArray: x] +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:22) Identifier |x| +//@[23:25) Identifier |in| +//@[26:36) Identifier |emptyArray| +//@[36:37) Colon |:| +//@[38:39) Identifier |x| +//@[39:40) RightSquare |]| +//@[40:42) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +var someDuplicate = true +//@[0:3) Identifier |var| +//@[4:17) Identifier |someDuplicate| +//@[18:19) Assignment |=| +//@[20:24) TrueKeyword |true| +//@[24:26) NewLine |\r\n| +var otherDuplicate = false +//@[0:3) Identifier |var| +//@[4:18) Identifier |otherDuplicate| +//@[19:20) Assignment |=| +//@[21:26) FalseKeyword |false| +//@[26:28) NewLine |\r\n| +module duplicatesEverywhere 'modulea.bicep' = [for someDuplicate in []: { +//@[0:6) Identifier |module| +//@[7:27) Identifier |duplicatesEverywhere| +//@[28:43) StringComplete |'modulea.bicep'| +//@[44:45) Assignment |=| +//@[46:47) LeftSquare |[| +//@[47:50) Identifier |for| +//@[51:64) Identifier |someDuplicate| +//@[65:67) Identifier |in| +//@[68:69) LeftSquare |[| +//@[69:70) RightSquare |]| +//@[70:71) Colon |:| +//@[72:73) LeftBrace |{| +//@[73:75) NewLine |\r\n| + name: 'hello-${someDuplicate}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:17) StringLeftPiece |'hello-${| +//@[17:30) Identifier |someDuplicate| +//@[30:32) StringRightPiece |}'| +//@[32:34) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: {} +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:16) RightBrace |}| +//@[16:18) NewLine |\r\n| + stringParamB: 'test' +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:24) StringComplete |'test'| +//@[24:26) NewLine |\r\n| + arrayParam: [for otherDuplicate in emptyArray: '${someDuplicate}-${otherDuplicate}'] +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:20) Identifier |for| +//@[21:35) Identifier |otherDuplicate| +//@[36:38) Identifier |in| +//@[39:49) Identifier |emptyArray| +//@[49:50) Colon |:| +//@[51:54) StringLeftPiece |'${| +//@[54:67) Identifier |someDuplicate| +//@[67:71) StringMiddlePiece |}-${| +//@[71:85) Identifier |otherDuplicate| +//@[85:87) StringRightPiece |}'| +//@[87:88) RightSquare |]| +//@[88:90) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +module propertyLoopInsideParameterValue 'modulea.bicep' = { +//@[0:6) Identifier |module| +//@[7:39) Identifier |propertyLoopInsideParameterValue| +//@[40:55) StringComplete |'modulea.bicep'| +//@[56:57) Assignment |=| +//@[58:59) LeftBrace |{| +//@[59:61) NewLine |\r\n| + name: 'propertyLoopInsideParameterValue' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:42) StringComplete |'propertyLoopInsideParameterValue'| +//@[42:44) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: { +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + a: [for i in range(0,10): i] +//@[6:7) Identifier |a| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:26) Integer |0| +//@[26:27) Comma |,| +//@[27:29) Integer |10| +//@[29:30) RightParen |)| +//@[30:31) Colon |:| +//@[32:33) Identifier |i| +//@[33:34) RightSquare |]| +//@[34:36) NewLine |\r\n| + b: [for i in range(1,2): i] +//@[6:7) Identifier |b| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:26) Integer |1| +//@[26:27) Comma |,| +//@[27:28) Integer |2| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:32) Identifier |i| +//@[32:33) RightSquare |]| +//@[33:35) NewLine |\r\n| + c: { +//@[6:7) Identifier |c| +//@[7:8) Colon |:| +//@[9:10) LeftBrace |{| +//@[10:12) NewLine |\r\n| + d: [for j in range(2,3): j] +//@[8:9) Identifier |d| +//@[9:10) Colon |:| +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:28) Integer |2| +//@[28:29) Comma |,| +//@[29:30) Integer |3| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) Identifier |j| +//@[34:35) RightSquare |]| +//@[35:37) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + e: [for k in range(4,4): { +//@[6:7) Identifier |e| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) Identifier |k| +//@[16:18) Identifier |in| +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:26) Integer |4| +//@[26:27) Comma |,| +//@[27:28) Integer |4| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:32) LeftBrace |{| +//@[32:34) NewLine |\r\n| + f: k +//@[8:9) Identifier |f| +//@[9:10) Colon |:| +//@[11:12) Identifier |k| +//@[12:14) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| + stringParamB: '' +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:20) StringComplete |''| +//@[20:22) NewLine |\r\n| + arrayParam: [ +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:19) NewLine |\r\n| + { +//@[6:7) LeftBrace |{| +//@[7:9) NewLine |\r\n| + e: [for j in range(7,7): j] +//@[8:9) Identifier |e| +//@[9:10) Colon |:| +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:28) Integer |7| +//@[28:29) Comma |,| +//@[29:30) Integer |7| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) Identifier |j| +//@[34:35) RightSquare |]| +//@[35:37) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + ] +//@[4:5) RightSquare |]| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +module propertyLoopInsideParameterValueInsideModuleLoop 'modulea.bicep' = [for thing in range(0,1): { +//@[0:6) Identifier |module| +//@[7:55) Identifier |propertyLoopInsideParameterValueInsideModuleLoop| +//@[56:71) StringComplete |'modulea.bicep'| +//@[72:73) Assignment |=| +//@[74:75) LeftSquare |[| +//@[75:78) Identifier |for| +//@[79:84) Identifier |thing| +//@[85:87) Identifier |in| +//@[88:93) Identifier |range| +//@[93:94) LeftParen |(| +//@[94:95) Integer |0| +//@[95:96) Comma |,| +//@[96:97) Integer |1| +//@[97:98) RightParen |)| +//@[98:99) Colon |:| +//@[100:101) LeftBrace |{| +//@[101:103) NewLine |\r\n| + name: 'propertyLoopInsideParameterValueInsideModuleLoop' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:58) StringComplete |'propertyLoopInsideParameterValueInsideModuleLoop'| +//@[58:60) NewLine |\r\n| + params: { +//@[2:8) Identifier |params| +//@[8:9) Colon |:| +//@[10:11) LeftBrace |{| +//@[11:13) NewLine |\r\n| + objParam: { +//@[4:12) Identifier |objParam| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + a: [for i in range(0,10): i + thing] +//@[6:7) Identifier |a| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:26) Integer |0| +//@[26:27) Comma |,| +//@[27:29) Integer |10| +//@[29:30) RightParen |)| +//@[30:31) Colon |:| +//@[32:33) Identifier |i| +//@[34:35) Plus |+| +//@[36:41) Identifier |thing| +//@[41:42) RightSquare |]| +//@[42:44) NewLine |\r\n| + b: [for i in range(1,2): i * thing] +//@[6:7) Identifier |b| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) Identifier |i| +//@[16:18) Identifier |in| +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:26) Integer |1| +//@[26:27) Comma |,| +//@[27:28) Integer |2| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:32) Identifier |i| +//@[33:34) Asterisk |*| +//@[35:40) Identifier |thing| +//@[40:41) RightSquare |]| +//@[41:43) NewLine |\r\n| + c: { +//@[6:7) Identifier |c| +//@[7:8) Colon |:| +//@[9:10) LeftBrace |{| +//@[10:12) NewLine |\r\n| + d: [for j in range(2,3): j] +//@[8:9) Identifier |d| +//@[9:10) Colon |:| +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:28) Integer |2| +//@[28:29) Comma |,| +//@[29:30) Integer |3| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) Identifier |j| +//@[34:35) RightSquare |]| +//@[35:37) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + e: [for k in range(4,4): { +//@[6:7) Identifier |e| +//@[7:8) Colon |:| +//@[9:10) LeftSquare |[| +//@[10:13) Identifier |for| +//@[14:15) Identifier |k| +//@[16:18) Identifier |in| +//@[19:24) Identifier |range| +//@[24:25) LeftParen |(| +//@[25:26) Integer |4| +//@[26:27) Comma |,| +//@[27:28) Integer |4| +//@[28:29) RightParen |)| +//@[29:30) Colon |:| +//@[31:32) LeftBrace |{| +//@[32:34) NewLine |\r\n| + f: k - thing +//@[8:9) Identifier |f| +//@[9:10) Colon |:| +//@[11:12) Identifier |k| +//@[13:14) Minus |-| +//@[15:20) Identifier |thing| +//@[20:22) NewLine |\r\n| + }] +//@[6:7) RightBrace |}| +//@[7:8) RightSquare |]| +//@[8:10) NewLine |\r\n| + } +//@[4:5) RightBrace |}| +//@[5:7) NewLine |\r\n| + stringParamB: '' +//@[4:16) Identifier |stringParamB| +//@[16:17) Colon |:| +//@[18:20) StringComplete |''| +//@[20:22) NewLine |\r\n| + arrayParam: [ +//@[4:14) Identifier |arrayParam| +//@[14:15) Colon |:| +//@[16:17) LeftSquare |[| +//@[17:19) NewLine |\r\n| + { +//@[6:7) LeftBrace |{| +//@[7:9) NewLine |\r\n| + e: [for j in range(7,7): j % thing] +//@[8:9) Identifier |e| +//@[9:10) Colon |:| +//@[11:12) LeftSquare |[| +//@[12:15) Identifier |for| +//@[16:17) Identifier |j| +//@[18:20) Identifier |in| +//@[21:26) Identifier |range| +//@[26:27) LeftParen |(| +//@[27:28) Integer |7| +//@[28:29) Comma |,| +//@[29:30) Integer |7| +//@[30:31) RightParen |)| +//@[31:32) Colon |:| +//@[33:34) Identifier |j| +//@[35:36) Modulo |%| +//@[37:42) Identifier |thing| +//@[42:43) RightSquare |]| +//@[43:45) NewLine |\r\n| + } +//@[6:7) RightBrace |}| +//@[7:9) NewLine |\r\n| + ] +//@[4:5) RightSquare |]| +//@[5:7) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/Modules_CRLF/modulereprob.bicep b/src/Bicep.Core.Samples/Files/Modules_CRLF/modulereprob.bicep new file mode 100644 index 00000000000..00713bc4054 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/Modules_CRLF/modulereprob.bicep @@ -0,0 +1,22 @@ +var myModules = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +var emptyArray = [] + +// simple module loop +module storageResources 'modulea.bicep' = [for module in myModules: { + name: module.name + params: { + arrayParam: [] + objParam: module + stringParamB: module.location + } +}] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.bicep new file mode 100644 index 00000000000..803bb5be03b --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.bicep @@ -0,0 +1,38 @@ +targetScope = 'managementGroup' + +param ownerPrincipalId string + +param contributorPrincipals array +param readerPrincipals array + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] + diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.diagnostics.bicep new file mode 100644 index 00000000000..1ccb1bee4c4 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.diagnostics.bicep @@ -0,0 +1,39 @@ +targetScope = 'managementGroup' + +param ownerPrincipalId string + +param contributorPrincipals array +param readerPrincipals array + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] + + diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.formatted.bicep new file mode 100644 index 00000000000..f84e3c5fc07 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.formatted.bicep @@ -0,0 +1,37 @@ +targetScope = 'managementGroup' + +param ownerPrincipalId string + +param contributorPrincipals array +param readerPrincipals array + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.json b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.json new file mode 100644 index 00000000000..3f0e3f14db2 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "ownerPrincipalId": { + "type": "string" + }, + "contributorPrincipals": { + "type": "array" + }, + "readerPrincipals": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[guid('owner', parameters('ownerPrincipalId'))]", + "properties": { + "principalId": "[parameters('ownerPrincipalId')]", + "roleDefinitionId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635" + } + }, + { + "copy": { + "name": "contributors", + "count": "[length(parameters('contributorPrincipals'))]" + }, + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[guid('contributor', parameters('contributorPrincipals')[copyIndex()])]", + "properties": { + "principalId": "[parameters('contributorPrincipals')[copyIndex()]]", + "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" + }, + "dependsOn": [ + "[format('Microsoft.Authorization/roleAssignments/{0}', guid('owner', parameters('ownerPrincipalId')))]" + ] + }, + { + "copy": { + "name": "readers", + "count": "[length(parameters('readerPrincipals'))]" + }, + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[guid('reader', parameters('readerPrincipals')[copyIndex()])]", + "properties": { + "principalId": "[parameters('readerPrincipals')[copyIndex()]]", + "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" + }, + "dependsOn": [ + "[format('Microsoft.Authorization/roleAssignments/{0}', guid('contributor', parameters('contributorPrincipals')[0]))]", + "[format('Microsoft.Authorization/roleAssignments/{0}', guid('owner', parameters('ownerPrincipalId')))]" + ] + } + ], + "metadata": { + "_generator": { + "name": "bicep", + "version": "dev", + "templateHash": "11679287606461854693" + } + } +} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.symbols.bicep new file mode 100644 index 00000000000..2d51dd8e42e --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.symbols.bicep @@ -0,0 +1,47 @@ +targetScope = 'managementGroup' + +param ownerPrincipalId string +//@[6:22) Parameter ownerPrincipalId. Type: string. Declaration start char: 0, length: 29 + +param contributorPrincipals array +//@[6:27) Parameter contributorPrincipals. Type: array. Declaration start char: 0, length: 33 +param readerPrincipals array +//@[6:22) Parameter readerPrincipals. Type: array. Declaration start char: 0, length: 28 + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { +//@[9:14) Resource owner. Type: Microsoft.Authorization/roleAssignments@2020-04-01-preview. Declaration start char: 0, length: 242 + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { +//@[90:101) Local contributor. Type: any. Declaration start char: 90, length: 11 +//@[9:21) Resource contributors. Type: Microsoft.Authorization/roleAssignments@2020-04-01-preview[]. Declaration start char: 0, length: 321 + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { +//@[85:91) Local reader. Type: any. Declaration start char: 85, length: 6 +//@[9:16) Resource readers. Type: Microsoft.Authorization/roleAssignments@2020-04-01-preview[]. Declaration start char: 0, length: 312 + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] + + diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.syntax.bicep new file mode 100644 index 00000000000..0a5d616bde4 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.syntax.bicep @@ -0,0 +1,291 @@ +targetScope = 'managementGroup' +//@[0:31) TargetScopeSyntax +//@[0:11) Identifier |targetScope| +//@[12:13) Assignment |=| +//@[14:31) StringSyntax +//@[14:31) StringComplete |'managementGroup'| +//@[31:35) NewLine |\r\n\r\n| + +param ownerPrincipalId string +//@[0:29) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:22) IdentifierSyntax +//@[6:22) Identifier |ownerPrincipalId| +//@[23:29) TypeSyntax +//@[23:29) Identifier |string| +//@[29:33) NewLine |\r\n\r\n| + +param contributorPrincipals array +//@[0:33) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:27) IdentifierSyntax +//@[6:27) Identifier |contributorPrincipals| +//@[28:33) TypeSyntax +//@[28:33) Identifier |array| +//@[33:35) NewLine |\r\n| +param readerPrincipals array +//@[0:28) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:22) IdentifierSyntax +//@[6:22) Identifier |readerPrincipals| +//@[23:28) TypeSyntax +//@[23:28) Identifier |array| +//@[28:32) NewLine |\r\n\r\n| + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { +//@[0:242) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:14) IdentifierSyntax +//@[9:14) Identifier |owner| +//@[15:75) StringSyntax +//@[15:75) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[76:77) Assignment |=| +//@[78:242) ObjectSyntax +//@[78:79) LeftBrace |{| +//@[79:81) NewLine |\r\n| + name: guid('owner', ownerPrincipalId) +//@[2:39) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:39) FunctionCallSyntax +//@[8:12) IdentifierSyntax +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:21) FunctionArgumentSyntax +//@[13:20) StringSyntax +//@[13:20) StringComplete |'owner'| +//@[20:21) Comma |,| +//@[22:38) FunctionArgumentSyntax +//@[22:38) VariableAccessSyntax +//@[22:38) IdentifierSyntax +//@[22:38) Identifier |ownerPrincipalId| +//@[38:39) RightParen |)| +//@[39:41) NewLine |\r\n| + properties: { +//@[2:117) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:117) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: ownerPrincipalId +//@[4:33) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:33) VariableAccessSyntax +//@[17:33) IdentifierSyntax +//@[17:33) Identifier |ownerPrincipalId| +//@[33:35) NewLine |\r\n| + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' +//@[4:60) ObjectPropertySyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringSyntax +//@[22:60) StringComplete |'8e3af657-a8ff-443c-a75c-2fe8c4bcb635'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { +//@[0:321) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:21) IdentifierSyntax +//@[9:21) Identifier |contributors| +//@[22:82) StringSyntax +//@[22:82) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[83:84) Assignment |=| +//@[85:321) ForSyntax +//@[85:86) LeftSquare |[| +//@[86:89) Identifier |for| +//@[90:101) LocalVariableSyntax +//@[90:101) IdentifierSyntax +//@[90:101) Identifier |contributor| +//@[102:104) Identifier |in| +//@[105:126) VariableAccessSyntax +//@[105:126) IdentifierSyntax +//@[105:126) Identifier |contributorPrincipals| +//@[126:127) Colon |:| +//@[128:320) ObjectSyntax +//@[128:129) LeftBrace |{| +//@[129:131) NewLine |\r\n| + name: guid('contributor', contributor) +//@[2:40) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:40) FunctionCallSyntax +//@[8:12) IdentifierSyntax +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:27) FunctionArgumentSyntax +//@[13:26) StringSyntax +//@[13:26) StringComplete |'contributor'| +//@[26:27) Comma |,| +//@[28:39) FunctionArgumentSyntax +//@[28:39) VariableAccessSyntax +//@[28:39) IdentifierSyntax +//@[28:39) Identifier |contributor| +//@[39:40) RightParen |)| +//@[40:42) NewLine |\r\n| + properties: { +//@[2:112) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:112) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: contributor +//@[4:28) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:28) VariableAccessSyntax +//@[17:28) IdentifierSyntax +//@[17:28) Identifier |contributor| +//@[28:30) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:60) ObjectPropertySyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringSyntax +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:30) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:30) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) ArrayItemSyntax +//@[4:9) VariableAccessSyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { +//@[0:312) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:16) IdentifierSyntax +//@[9:16) Identifier |readers| +//@[17:77) StringSyntax +//@[17:77) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[78:79) Assignment |=| +//@[80:312) ForSyntax +//@[80:81) LeftSquare |[| +//@[81:84) Identifier |for| +//@[85:91) LocalVariableSyntax +//@[85:91) IdentifierSyntax +//@[85:91) Identifier |reader| +//@[92:94) Identifier |in| +//@[95:111) VariableAccessSyntax +//@[95:111) IdentifierSyntax +//@[95:111) Identifier |readerPrincipals| +//@[111:112) Colon |:| +//@[113:311) ObjectSyntax +//@[113:114) LeftBrace |{| +//@[114:116) NewLine |\r\n| + name: guid('reader', reader) +//@[2:30) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:30) FunctionCallSyntax +//@[8:12) IdentifierSyntax +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:22) FunctionArgumentSyntax +//@[13:21) StringSyntax +//@[13:21) StringComplete |'reader'| +//@[21:22) Comma |,| +//@[23:29) FunctionArgumentSyntax +//@[23:29) VariableAccessSyntax +//@[23:29) IdentifierSyntax +//@[23:29) Identifier |reader| +//@[29:30) RightParen |)| +//@[30:32) NewLine |\r\n| + properties: { +//@[2:107) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:107) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: reader +//@[4:23) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:23) VariableAccessSyntax +//@[17:23) IdentifierSyntax +//@[17:23) Identifier |reader| +//@[23:25) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:60) ObjectPropertySyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringSyntax +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:51) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:51) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) ArrayItemSyntax +//@[4:9) VariableAccessSyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + contributors[0] +//@[4:19) ArrayItemSyntax +//@[4:19) ArrayAccessSyntax +//@[4:16) VariableAccessSyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |contributors| +//@[16:17) LeftSquare |[| +//@[17:18) IntegerLiteralSyntax +//@[17:18) Integer |0| +//@[18:19) RightSquare |]| +//@[19:21) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + + +//@[0:0) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.tokens.bicep new file mode 100644 index 00000000000..82dab486bbd --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesManagementGroup_CRLF/main.tokens.bicep @@ -0,0 +1,184 @@ +targetScope = 'managementGroup' +//@[0:11) Identifier |targetScope| +//@[12:13) Assignment |=| +//@[14:31) StringComplete |'managementGroup'| +//@[31:35) NewLine |\r\n\r\n| + +param ownerPrincipalId string +//@[0:5) Identifier |param| +//@[6:22) Identifier |ownerPrincipalId| +//@[23:29) Identifier |string| +//@[29:33) NewLine |\r\n\r\n| + +param contributorPrincipals array +//@[0:5) Identifier |param| +//@[6:27) Identifier |contributorPrincipals| +//@[28:33) Identifier |array| +//@[33:35) NewLine |\r\n| +param readerPrincipals array +//@[0:5) Identifier |param| +//@[6:22) Identifier |readerPrincipals| +//@[23:28) Identifier |array| +//@[28:32) NewLine |\r\n\r\n| + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { +//@[0:8) Identifier |resource| +//@[9:14) Identifier |owner| +//@[15:75) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[76:77) Assignment |=| +//@[78:79) LeftBrace |{| +//@[79:81) NewLine |\r\n| + name: guid('owner', ownerPrincipalId) +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:20) StringComplete |'owner'| +//@[20:21) Comma |,| +//@[22:38) Identifier |ownerPrincipalId| +//@[38:39) RightParen |)| +//@[39:41) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: ownerPrincipalId +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:33) Identifier |ownerPrincipalId| +//@[33:35) NewLine |\r\n| + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringComplete |'8e3af657-a8ff-443c-a75c-2fe8c4bcb635'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { +//@[0:8) Identifier |resource| +//@[9:21) Identifier |contributors| +//@[22:82) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[83:84) Assignment |=| +//@[85:86) LeftSquare |[| +//@[86:89) Identifier |for| +//@[90:101) Identifier |contributor| +//@[102:104) Identifier |in| +//@[105:126) Identifier |contributorPrincipals| +//@[126:127) Colon |:| +//@[128:129) LeftBrace |{| +//@[129:131) NewLine |\r\n| + name: guid('contributor', contributor) +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:26) StringComplete |'contributor'| +//@[26:27) Comma |,| +//@[28:39) Identifier |contributor| +//@[39:40) RightParen |)| +//@[40:42) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: contributor +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:28) Identifier |contributor| +//@[28:30) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { +//@[0:8) Identifier |resource| +//@[9:16) Identifier |readers| +//@[17:77) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[78:79) Assignment |=| +//@[80:81) LeftSquare |[| +//@[81:84) Identifier |for| +//@[85:91) Identifier |reader| +//@[92:94) Identifier |in| +//@[95:111) Identifier |readerPrincipals| +//@[111:112) Colon |:| +//@[113:114) LeftBrace |{| +//@[114:116) NewLine |\r\n| + name: guid('reader', reader) +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:21) StringComplete |'reader'| +//@[21:22) Comma |,| +//@[23:29) Identifier |reader| +//@[29:30) RightParen |)| +//@[30:32) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: reader +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:23) Identifier |reader| +//@[23:25) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + contributors[0] +//@[4:16) Identifier |contributors| +//@[16:17) LeftSquare |[| +//@[17:18) Integer |0| +//@[18:19) RightSquare |]| +//@[19:21) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + + +//@[0:0) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.bicep new file mode 100644 index 00000000000..867973792b9 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +param ownerPrincipalId string + +param contributorPrincipals array +param readerPrincipals array + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.diagnostics.bicep new file mode 100644 index 00000000000..e4f47d92f62 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.diagnostics.bicep @@ -0,0 +1,38 @@ +targetScope = 'subscription' + +param ownerPrincipalId string + +param contributorPrincipals array +param readerPrincipals array + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] + diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.formatted.bicep new file mode 100644 index 00000000000..fc5d58aaaa7 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.formatted.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +param ownerPrincipalId string + +param contributorPrincipals array +param readerPrincipals array + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.json b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.json new file mode 100644 index 00000000000..ae1d7dcadca --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "ownerPrincipalId": { + "type": "string" + }, + "contributorPrincipals": { + "type": "array" + }, + "readerPrincipals": { + "type": "array" + } + }, + "functions": [], + "resources": [ + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[guid('owner', parameters('ownerPrincipalId'))]", + "properties": { + "principalId": "[parameters('ownerPrincipalId')]", + "roleDefinitionId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635" + } + }, + { + "copy": { + "name": "contributors", + "count": "[length(parameters('contributorPrincipals'))]" + }, + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[guid('contributor', parameters('contributorPrincipals')[copyIndex()])]", + "properties": { + "principalId": "[parameters('contributorPrincipals')[copyIndex()]]", + "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('owner', parameters('ownerPrincipalId')))]" + ] + }, + { + "copy": { + "name": "readers", + "count": "[length(parameters('readerPrincipals'))]" + }, + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[guid('reader', parameters('readerPrincipals')[copyIndex()])]", + "properties": { + "principalId": "[parameters('readerPrincipals')[copyIndex()]]", + "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" + }, + "dependsOn": [ + "[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('contributor', parameters('contributorPrincipals')[0]))]", + "[subscriptionResourceId('Microsoft.Authorization/roleAssignments', guid('owner', parameters('ownerPrincipalId')))]" + ] + } + ], + "metadata": { + "_generator": { + "name": "bicep", + "version": "dev", + "templateHash": "7667211657200818100" + } + } +} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.symbols.bicep new file mode 100644 index 00000000000..0a1ea5776e1 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.symbols.bicep @@ -0,0 +1,46 @@ +targetScope = 'subscription' + +param ownerPrincipalId string +//@[6:22) Parameter ownerPrincipalId. Type: string. Declaration start char: 0, length: 29 + +param contributorPrincipals array +//@[6:27) Parameter contributorPrincipals. Type: array. Declaration start char: 0, length: 33 +param readerPrincipals array +//@[6:22) Parameter readerPrincipals. Type: array. Declaration start char: 0, length: 28 + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { +//@[9:14) Resource owner. Type: Microsoft.Authorization/roleAssignments@2020-04-01-preview. Declaration start char: 0, length: 242 + name: guid('owner', ownerPrincipalId) + properties: { + principalId: ownerPrincipalId + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' + } +} + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { +//@[90:101) Local contributor. Type: any. Declaration start char: 90, length: 11 +//@[9:21) Resource contributors. Type: Microsoft.Authorization/roleAssignments@2020-04-01-preview[]. Declaration start char: 0, length: 321 + name: guid('contributor', contributor) + properties: { + principalId: contributor + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + ] +}] + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { +//@[85:91) Local reader. Type: any. Declaration start char: 85, length: 6 +//@[9:16) Resource readers. Type: Microsoft.Authorization/roleAssignments@2020-04-01-preview[]. Declaration start char: 0, length: 312 + name: guid('reader', reader) + properties: { + principalId: reader + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' + } + dependsOn: [ + owner + contributors[0] + ] +}] + diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.syntax.bicep new file mode 100644 index 00000000000..48d57e18ce3 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.syntax.bicep @@ -0,0 +1,290 @@ +targetScope = 'subscription' +//@[0:28) TargetScopeSyntax +//@[0:11) Identifier |targetScope| +//@[12:13) Assignment |=| +//@[14:28) StringSyntax +//@[14:28) StringComplete |'subscription'| +//@[28:32) NewLine |\r\n\r\n| + +param ownerPrincipalId string +//@[0:29) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:22) IdentifierSyntax +//@[6:22) Identifier |ownerPrincipalId| +//@[23:29) TypeSyntax +//@[23:29) Identifier |string| +//@[29:33) NewLine |\r\n\r\n| + +param contributorPrincipals array +//@[0:33) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:27) IdentifierSyntax +//@[6:27) Identifier |contributorPrincipals| +//@[28:33) TypeSyntax +//@[28:33) Identifier |array| +//@[33:35) NewLine |\r\n| +param readerPrincipals array +//@[0:28) ParameterDeclarationSyntax +//@[0:5) Identifier |param| +//@[6:22) IdentifierSyntax +//@[6:22) Identifier |readerPrincipals| +//@[23:28) TypeSyntax +//@[23:28) Identifier |array| +//@[28:32) NewLine |\r\n\r\n| + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { +//@[0:242) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:14) IdentifierSyntax +//@[9:14) Identifier |owner| +//@[15:75) StringSyntax +//@[15:75) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[76:77) Assignment |=| +//@[78:242) ObjectSyntax +//@[78:79) LeftBrace |{| +//@[79:81) NewLine |\r\n| + name: guid('owner', ownerPrincipalId) +//@[2:39) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:39) FunctionCallSyntax +//@[8:12) IdentifierSyntax +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:21) FunctionArgumentSyntax +//@[13:20) StringSyntax +//@[13:20) StringComplete |'owner'| +//@[20:21) Comma |,| +//@[22:38) FunctionArgumentSyntax +//@[22:38) VariableAccessSyntax +//@[22:38) IdentifierSyntax +//@[22:38) Identifier |ownerPrincipalId| +//@[38:39) RightParen |)| +//@[39:41) NewLine |\r\n| + properties: { +//@[2:117) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:117) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: ownerPrincipalId +//@[4:33) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:33) VariableAccessSyntax +//@[17:33) IdentifierSyntax +//@[17:33) Identifier |ownerPrincipalId| +//@[33:35) NewLine |\r\n| + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' +//@[4:60) ObjectPropertySyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringSyntax +//@[22:60) StringComplete |'8e3af657-a8ff-443c-a75c-2fe8c4bcb635'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { +//@[0:321) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:21) IdentifierSyntax +//@[9:21) Identifier |contributors| +//@[22:82) StringSyntax +//@[22:82) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[83:84) Assignment |=| +//@[85:321) ForSyntax +//@[85:86) LeftSquare |[| +//@[86:89) Identifier |for| +//@[90:101) LocalVariableSyntax +//@[90:101) IdentifierSyntax +//@[90:101) Identifier |contributor| +//@[102:104) Identifier |in| +//@[105:126) VariableAccessSyntax +//@[105:126) IdentifierSyntax +//@[105:126) Identifier |contributorPrincipals| +//@[126:127) Colon |:| +//@[128:320) ObjectSyntax +//@[128:129) LeftBrace |{| +//@[129:131) NewLine |\r\n| + name: guid('contributor', contributor) +//@[2:40) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:40) FunctionCallSyntax +//@[8:12) IdentifierSyntax +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:27) FunctionArgumentSyntax +//@[13:26) StringSyntax +//@[13:26) StringComplete |'contributor'| +//@[26:27) Comma |,| +//@[28:39) FunctionArgumentSyntax +//@[28:39) VariableAccessSyntax +//@[28:39) IdentifierSyntax +//@[28:39) Identifier |contributor| +//@[39:40) RightParen |)| +//@[40:42) NewLine |\r\n| + properties: { +//@[2:112) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:112) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: contributor +//@[4:28) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:28) VariableAccessSyntax +//@[17:28) IdentifierSyntax +//@[17:28) Identifier |contributor| +//@[28:30) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:60) ObjectPropertySyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringSyntax +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:30) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:30) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) ArrayItemSyntax +//@[4:9) VariableAccessSyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { +//@[0:312) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:16) IdentifierSyntax +//@[9:16) Identifier |readers| +//@[17:77) StringSyntax +//@[17:77) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[78:79) Assignment |=| +//@[80:312) ForSyntax +//@[80:81) LeftSquare |[| +//@[81:84) Identifier |for| +//@[85:91) LocalVariableSyntax +//@[85:91) IdentifierSyntax +//@[85:91) Identifier |reader| +//@[92:94) Identifier |in| +//@[95:111) VariableAccessSyntax +//@[95:111) IdentifierSyntax +//@[95:111) Identifier |readerPrincipals| +//@[111:112) Colon |:| +//@[113:311) ObjectSyntax +//@[113:114) LeftBrace |{| +//@[114:116) NewLine |\r\n| + name: guid('reader', reader) +//@[2:30) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:30) FunctionCallSyntax +//@[8:12) IdentifierSyntax +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:22) FunctionArgumentSyntax +//@[13:21) StringSyntax +//@[13:21) StringComplete |'reader'| +//@[21:22) Comma |,| +//@[23:29) FunctionArgumentSyntax +//@[23:29) VariableAccessSyntax +//@[23:29) IdentifierSyntax +//@[23:29) Identifier |reader| +//@[29:30) RightParen |)| +//@[30:32) NewLine |\r\n| + properties: { +//@[2:107) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:107) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: reader +//@[4:23) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:23) VariableAccessSyntax +//@[17:23) IdentifierSyntax +//@[17:23) Identifier |reader| +//@[23:25) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:60) ObjectPropertySyntax +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringSyntax +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:51) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:51) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) ArrayItemSyntax +//@[4:9) VariableAccessSyntax +//@[4:9) IdentifierSyntax +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + contributors[0] +//@[4:19) ArrayItemSyntax +//@[4:19) ArrayAccessSyntax +//@[4:16) VariableAccessSyntax +//@[4:16) IdentifierSyntax +//@[4:16) Identifier |contributors| +//@[16:17) LeftSquare |[| +//@[17:18) IntegerLiteralSyntax +//@[17:18) Integer |0| +//@[18:19) RightSquare |]| +//@[19:21) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\r\n| + +//@[0:0) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.tokens.bicep new file mode 100644 index 00000000000..4f139ac0900 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesSubscription_CRLF/main.tokens.bicep @@ -0,0 +1,183 @@ +targetScope = 'subscription' +//@[0:11) Identifier |targetScope| +//@[12:13) Assignment |=| +//@[14:28) StringComplete |'subscription'| +//@[28:32) NewLine |\r\n\r\n| + +param ownerPrincipalId string +//@[0:5) Identifier |param| +//@[6:22) Identifier |ownerPrincipalId| +//@[23:29) Identifier |string| +//@[29:33) NewLine |\r\n\r\n| + +param contributorPrincipals array +//@[0:5) Identifier |param| +//@[6:27) Identifier |contributorPrincipals| +//@[28:33) Identifier |array| +//@[33:35) NewLine |\r\n| +param readerPrincipals array +//@[0:5) Identifier |param| +//@[6:22) Identifier |readerPrincipals| +//@[23:28) Identifier |array| +//@[28:32) NewLine |\r\n\r\n| + +resource owner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { +//@[0:8) Identifier |resource| +//@[9:14) Identifier |owner| +//@[15:75) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[76:77) Assignment |=| +//@[78:79) LeftBrace |{| +//@[79:81) NewLine |\r\n| + name: guid('owner', ownerPrincipalId) +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:20) StringComplete |'owner'| +//@[20:21) Comma |,| +//@[22:38) Identifier |ownerPrincipalId| +//@[38:39) RightParen |)| +//@[39:41) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: ownerPrincipalId +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:33) Identifier |ownerPrincipalId| +//@[33:35) NewLine |\r\n| + roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635' +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringComplete |'8e3af657-a8ff-443c-a75c-2fe8c4bcb635'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource contributors 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for contributor in contributorPrincipals: { +//@[0:8) Identifier |resource| +//@[9:21) Identifier |contributors| +//@[22:82) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[83:84) Assignment |=| +//@[85:86) LeftSquare |[| +//@[86:89) Identifier |for| +//@[90:101) Identifier |contributor| +//@[102:104) Identifier |in| +//@[105:126) Identifier |contributorPrincipals| +//@[126:127) Colon |:| +//@[128:129) LeftBrace |{| +//@[129:131) NewLine |\r\n| + name: guid('contributor', contributor) +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:26) StringComplete |'contributor'| +//@[26:27) Comma |,| +//@[28:39) Identifier |contributor| +//@[39:40) RightParen |)| +//@[40:42) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: contributor +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:28) Identifier |contributor| +//@[28:30) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource readers 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for reader in readerPrincipals: { +//@[0:8) Identifier |resource| +//@[9:16) Identifier |readers| +//@[17:77) StringComplete |'Microsoft.Authorization/roleAssignments@2020-04-01-preview'| +//@[78:79) Assignment |=| +//@[80:81) LeftSquare |[| +//@[81:84) Identifier |for| +//@[85:91) Identifier |reader| +//@[92:94) Identifier |in| +//@[95:111) Identifier |readerPrincipals| +//@[111:112) Colon |:| +//@[113:114) LeftBrace |{| +//@[114:116) NewLine |\r\n| + name: guid('reader', reader) +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:12) Identifier |guid| +//@[12:13) LeftParen |(| +//@[13:21) StringComplete |'reader'| +//@[21:22) Comma |,| +//@[23:29) Identifier |reader| +//@[29:30) RightParen |)| +//@[30:32) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + principalId: reader +//@[4:15) Identifier |principalId| +//@[15:16) Colon |:| +//@[17:23) Identifier |reader| +//@[23:25) NewLine |\r\n| + roleDefinitionId: 'b24988ac-6180-42a0-ab88-20f7382dd24c' +//@[4:20) Identifier |roleDefinitionId| +//@[20:21) Colon |:| +//@[22:60) StringComplete |'b24988ac-6180-42a0-ab88-20f7382dd24c'| +//@[60:62) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + owner +//@[4:9) Identifier |owner| +//@[9:11) NewLine |\r\n| + contributors[0] +//@[4:16) Identifier |contributors| +//@[16:17) LeftSquare |[| +//@[17:18) Integer |0| +//@[18:19) RightSquare |]| +//@[19:21) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:4) NewLine |\r\n| + +//@[0:0) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.bicep new file mode 100644 index 00000000000..13804c363ee --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.bicep @@ -0,0 +1,46 @@ +targetScope = 'tenant' + +var managementGroups = [ + { + name: 'one' + displayName: 'The first' + } + { + name: 'two' + displayName: 'The second' + } +] + +resource singleGroup 'Microsoft.Management/managementGroups@2020-05-01' = { + name: 'myMG' + properties: { + displayName: 'This one is mine!' + } +} + +resource manyGroups 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: mg.name + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName})' + } +}] + +resource anotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: concat(mg.name, '-one') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 1)' + } + dependsOn: [ + manyGroups + ] +}] + +resource yetAnotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: concat(mg.name, '-two') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 2)' + } + dependsOn: [ + anotherSet[0] + ] +}] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.diagnostics.bicep new file mode 100644 index 00000000000..f92f2d84036 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.diagnostics.bicep @@ -0,0 +1,46 @@ +targetScope = 'tenant' + +var managementGroups = [ + { + name: 'one' + displayName: 'The first' + } + { + name: 'two' + displayName: 'The second' + } +] + +resource singleGroup 'Microsoft.Management/managementGroups@2020-05-01' = { + name: 'myMG' + properties: { + displayName: 'This one is mine!' + } +} + +resource manyGroups 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: mg.name + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName})' + } +}] + +resource anotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: concat(mg.name, '-one') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 1)' + } + dependsOn: [ + manyGroups + ] +}] + +resource yetAnotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: concat(mg.name, '-two') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 2)' + } + dependsOn: [ + anotherSet[0] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.formatted.bicep new file mode 100644 index 00000000000..f92f2d84036 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.formatted.bicep @@ -0,0 +1,46 @@ +targetScope = 'tenant' + +var managementGroups = [ + { + name: 'one' + displayName: 'The first' + } + { + name: 'two' + displayName: 'The second' + } +] + +resource singleGroup 'Microsoft.Management/managementGroups@2020-05-01' = { + name: 'myMG' + properties: { + displayName: 'This one is mine!' + } +} + +resource manyGroups 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: mg.name + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName})' + } +}] + +resource anotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: concat(mg.name, '-one') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 1)' + } + dependsOn: [ + manyGroups + ] +}] + +resource yetAnotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { + name: concat(mg.name, '-two') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 2)' + } + dependsOn: [ + anotherSet[0] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.json b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.json new file mode 100644 index 00000000000..4d794410927 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.json @@ -0,0 +1,81 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-08-01/tenantDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "functions": [], + "variables": { + "managementGroups": [ + { + "name": "one", + "displayName": "The first" + }, + { + "name": "two", + "displayName": "The second" + } + ] + }, + "resources": [ + { + "type": "Microsoft.Management/managementGroups", + "apiVersion": "2020-05-01", + "name": "myMG", + "properties": { + "displayName": "This one is mine!" + } + }, + { + "copy": { + "name": "manyGroups", + "count": "[length(variables('managementGroups'))]" + }, + "type": "Microsoft.Management/managementGroups", + "apiVersion": "2020-05-01", + "name": "[variables('managementGroups')[copyIndex()].name]", + "properties": { + "displayName": "[format('{0} ({1})', variables('managementGroups')[copyIndex()].displayName, reference(tenantResourceId('Microsoft.Management/managementGroups', 'myMG')).displayName)]" + }, + "dependsOn": [ + "[tenantResourceId('Microsoft.Management/managementGroups', 'myMG')]" + ] + }, + { + "copy": { + "name": "anotherSet", + "count": "[length(variables('managementGroups'))]" + }, + "type": "Microsoft.Management/managementGroups", + "apiVersion": "2020-05-01", + "name": "[concat(variables('managementGroups')[copyIndex()].name, '-one')]", + "properties": { + "displayName": "[format('{0} ({1}) (set 1)', variables('managementGroups')[copyIndex()].displayName, reference(tenantResourceId('Microsoft.Management/managementGroups', 'myMG')).displayName)]" + }, + "dependsOn": [ + "manyGroups", + "[tenantResourceId('Microsoft.Management/managementGroups', 'myMG')]" + ] + }, + { + "copy": { + "name": "yetAnotherSet", + "count": "[length(variables('managementGroups'))]" + }, + "type": "Microsoft.Management/managementGroups", + "apiVersion": "2020-05-01", + "name": "[concat(variables('managementGroups')[copyIndex()].name, '-two')]", + "properties": { + "displayName": "[format('{0} ({1}) (set 2)', variables('managementGroups')[copyIndex()].displayName, reference(tenantResourceId('Microsoft.Management/managementGroups', 'myMG')).displayName)]" + }, + "dependsOn": [ + "[tenantResourceId('Microsoft.Management/managementGroups', concat(variables('managementGroups')[0].name, '-one'))]", + "[tenantResourceId('Microsoft.Management/managementGroups', 'myMG')]" + ] + } + ], + "metadata": { + "_generator": { + "name": "bicep", + "version": "dev", + "templateHash": "16395904780268713330" + } + } +} \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.symbols.bicep new file mode 100644 index 00000000000..d84a52f6b9e --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.symbols.bicep @@ -0,0 +1,54 @@ +targetScope = 'tenant' + +var managementGroups = [ +//@[4:20) Variable managementGroups. Type: array. Declaration start char: 0, length: 142 + { + name: 'one' + displayName: 'The first' + } + { + name: 'two' + displayName: 'The second' + } +] + +resource singleGroup 'Microsoft.Management/managementGroups@2020-05-01' = { +//@[9:20) Resource singleGroup. Type: Microsoft.Management/managementGroups@2020-05-01. Declaration start char: 0, length: 154 + name: 'myMG' + properties: { + displayName: 'This one is mine!' + } +} + +resource manyGroups 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[78:80) Local mg. Type: any. Declaration start char: 78, length: 2 +//@[9:19) Resource manyGroups. Type: Microsoft.Management/managementGroups@2020-05-01[]. Declaration start char: 0, length: 224 + name: mg.name + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName})' + } +}] + +resource anotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[78:80) Local mg. Type: any. Declaration start char: 78, length: 2 +//@[9:19) Resource anotherSet. Type: Microsoft.Management/managementGroups@2020-05-01[]. Declaration start char: 0, length: 285 + name: concat(mg.name, '-one') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 1)' + } + dependsOn: [ + manyGroups + ] +}] + +resource yetAnotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[81:83) Local mg. Type: any. Declaration start char: 81, length: 2 +//@[9:22) Resource yetAnotherSet. Type: Microsoft.Management/managementGroups@2020-05-01[]. Declaration start char: 0, length: 291 + name: concat(mg.name, '-two') + properties: { + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 2)' + } + dependsOn: [ + anotherSet[0] + ] +}] diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.syntax.bicep new file mode 100644 index 00000000000..b7c33f41c74 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.syntax.bicep @@ -0,0 +1,406 @@ +targetScope = 'tenant' +//@[0:22) TargetScopeSyntax +//@[0:11) Identifier |targetScope| +//@[12:13) Assignment |=| +//@[14:22) StringSyntax +//@[14:22) StringComplete |'tenant'| +//@[22:26) NewLine |\r\n\r\n| + +var managementGroups = [ +//@[0:142) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:20) IdentifierSyntax +//@[4:20) Identifier |managementGroups| +//@[21:22) Assignment |=| +//@[23:142) ArraySyntax +//@[23:24) LeftSquare |[| +//@[24:26) NewLine |\r\n| + { +//@[2:55) ArrayItemSyntax +//@[2:55) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'one' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'one'| +//@[15:17) NewLine |\r\n| + displayName: 'The first' +//@[4:28) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:28) StringSyntax +//@[17:28) StringComplete |'The first'| +//@[28:30) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + { +//@[2:56) ArrayItemSyntax +//@[2:56) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'two' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'two'| +//@[15:17) NewLine |\r\n| + displayName: 'The second' +//@[4:29) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:29) StringSyntax +//@[17:29) StringComplete |'The second'| +//@[29:31) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +] +//@[0:1) RightSquare |]| +//@[1:5) NewLine |\r\n\r\n| + +resource singleGroup 'Microsoft.Management/managementGroups@2020-05-01' = { +//@[0:154) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:20) IdentifierSyntax +//@[9:20) Identifier |singleGroup| +//@[21:71) StringSyntax +//@[21:71) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[72:73) Assignment |=| +//@[74:154) ObjectSyntax +//@[74:75) LeftBrace |{| +//@[75:77) NewLine |\r\n| + name: 'myMG' +//@[2:14) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) StringSyntax +//@[8:14) StringComplete |'myMG'| +//@[14:16) NewLine |\r\n| + properties: { +//@[2:58) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:58) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: 'This one is mine!' +//@[4:36) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:36) StringSyntax +//@[17:36) StringComplete |'This one is mine!'| +//@[36:38) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource manyGroups 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[0:224) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:19) IdentifierSyntax +//@[9:19) Identifier |manyGroups| +//@[20:70) StringSyntax +//@[20:70) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[71:72) Assignment |=| +//@[73:224) ForSyntax +//@[73:74) LeftSquare |[| +//@[74:77) Identifier |for| +//@[78:80) LocalVariableSyntax +//@[78:80) IdentifierSyntax +//@[78:80) Identifier |mg| +//@[81:83) Identifier |in| +//@[84:100) VariableAccessSyntax +//@[84:100) IdentifierSyntax +//@[84:100) Identifier |managementGroups| +//@[100:101) Colon |:| +//@[102:223) ObjectSyntax +//@[102:103) LeftBrace |{| +//@[103:105) NewLine |\r\n| + name: mg.name +//@[2:15) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) PropertyAccessSyntax +//@[8:10) VariableAccessSyntax +//@[8:10) IdentifierSyntax +//@[8:10) Identifier |mg| +//@[10:11) Dot |.| +//@[11:15) IdentifierSyntax +//@[11:15) Identifier |name| +//@[15:17) NewLine |\r\n| + properties: { +//@[2:98) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:98) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: '${mg.displayName} (${singleGroup.properties.displayName})' +//@[4:76) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:76) StringSyntax +//@[17:20) StringLeftPiece |'${| +//@[20:34) PropertyAccessSyntax +//@[20:22) VariableAccessSyntax +//@[20:22) IdentifierSyntax +//@[20:22) Identifier |mg| +//@[22:23) Dot |.| +//@[23:34) IdentifierSyntax +//@[23:34) Identifier |displayName| +//@[34:39) StringMiddlePiece |} (${| +//@[39:73) PropertyAccessSyntax +//@[39:61) PropertyAccessSyntax +//@[39:50) VariableAccessSyntax +//@[39:50) IdentifierSyntax +//@[39:50) Identifier |singleGroup| +//@[50:51) Dot |.| +//@[51:61) IdentifierSyntax +//@[51:61) Identifier |properties| +//@[61:62) Dot |.| +//@[62:73) IdentifierSyntax +//@[62:73) Identifier |displayName| +//@[73:76) StringRightPiece |})'| +//@[76:78) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource anotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[0:285) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:19) IdentifierSyntax +//@[9:19) Identifier |anotherSet| +//@[20:70) StringSyntax +//@[20:70) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[71:72) Assignment |=| +//@[73:285) ForSyntax +//@[73:74) LeftSquare |[| +//@[74:77) Identifier |for| +//@[78:80) LocalVariableSyntax +//@[78:80) IdentifierSyntax +//@[78:80) Identifier |mg| +//@[81:83) Identifier |in| +//@[84:100) VariableAccessSyntax +//@[84:100) IdentifierSyntax +//@[84:100) Identifier |managementGroups| +//@[100:101) Colon |:| +//@[102:284) ObjectSyntax +//@[102:103) LeftBrace |{| +//@[103:105) NewLine |\r\n| + name: concat(mg.name, '-one') +//@[2:31) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:31) FunctionCallSyntax +//@[8:14) IdentifierSyntax +//@[8:14) Identifier |concat| +//@[14:15) LeftParen |(| +//@[15:23) FunctionArgumentSyntax +//@[15:22) PropertyAccessSyntax +//@[15:17) VariableAccessSyntax +//@[15:17) IdentifierSyntax +//@[15:17) Identifier |mg| +//@[17:18) Dot |.| +//@[18:22) IdentifierSyntax +//@[18:22) Identifier |name| +//@[22:23) Comma |,| +//@[24:30) FunctionArgumentSyntax +//@[24:30) StringSyntax +//@[24:30) StringComplete |'-one'| +//@[30:31) RightParen |)| +//@[31:33) NewLine |\r\n| + properties: { +//@[2:106) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:106) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 1)' +//@[4:84) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:84) StringSyntax +//@[17:20) StringLeftPiece |'${| +//@[20:34) PropertyAccessSyntax +//@[20:22) VariableAccessSyntax +//@[20:22) IdentifierSyntax +//@[20:22) Identifier |mg| +//@[22:23) Dot |.| +//@[23:34) IdentifierSyntax +//@[23:34) Identifier |displayName| +//@[34:39) StringMiddlePiece |} (${| +//@[39:73) PropertyAccessSyntax +//@[39:61) PropertyAccessSyntax +//@[39:50) VariableAccessSyntax +//@[39:50) IdentifierSyntax +//@[39:50) Identifier |singleGroup| +//@[50:51) Dot |.| +//@[51:61) IdentifierSyntax +//@[51:61) Identifier |properties| +//@[61:62) Dot |.| +//@[62:73) IdentifierSyntax +//@[62:73) Identifier |displayName| +//@[73:84) StringRightPiece |}) (set 1)'| +//@[84:86) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:35) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:35) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + manyGroups +//@[4:14) ArrayItemSyntax +//@[4:14) VariableAccessSyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |manyGroups| +//@[14:16) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource yetAnotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[0:291) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:22) IdentifierSyntax +//@[9:22) Identifier |yetAnotherSet| +//@[23:73) StringSyntax +//@[23:73) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[74:75) Assignment |=| +//@[76:291) ForSyntax +//@[76:77) LeftSquare |[| +//@[77:80) Identifier |for| +//@[81:83) LocalVariableSyntax +//@[81:83) IdentifierSyntax +//@[81:83) Identifier |mg| +//@[84:86) Identifier |in| +//@[87:103) VariableAccessSyntax +//@[87:103) IdentifierSyntax +//@[87:103) Identifier |managementGroups| +//@[103:104) Colon |:| +//@[105:290) ObjectSyntax +//@[105:106) LeftBrace |{| +//@[106:108) NewLine |\r\n| + name: concat(mg.name, '-two') +//@[2:31) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:31) FunctionCallSyntax +//@[8:14) IdentifierSyntax +//@[8:14) Identifier |concat| +//@[14:15) LeftParen |(| +//@[15:23) FunctionArgumentSyntax +//@[15:22) PropertyAccessSyntax +//@[15:17) VariableAccessSyntax +//@[15:17) IdentifierSyntax +//@[15:17) Identifier |mg| +//@[17:18) Dot |.| +//@[18:22) IdentifierSyntax +//@[18:22) Identifier |name| +//@[22:23) Comma |,| +//@[24:30) FunctionArgumentSyntax +//@[24:30) StringSyntax +//@[24:30) StringComplete |'-two'| +//@[30:31) RightParen |)| +//@[31:33) NewLine |\r\n| + properties: { +//@[2:106) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:106) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 2)' +//@[4:84) ObjectPropertySyntax +//@[4:15) IdentifierSyntax +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:84) StringSyntax +//@[17:20) StringLeftPiece |'${| +//@[20:34) PropertyAccessSyntax +//@[20:22) VariableAccessSyntax +//@[20:22) IdentifierSyntax +//@[20:22) Identifier |mg| +//@[22:23) Dot |.| +//@[23:34) IdentifierSyntax +//@[23:34) Identifier |displayName| +//@[34:39) StringMiddlePiece |} (${| +//@[39:73) PropertyAccessSyntax +//@[39:61) PropertyAccessSyntax +//@[39:50) VariableAccessSyntax +//@[39:50) IdentifierSyntax +//@[39:50) Identifier |singleGroup| +//@[50:51) Dot |.| +//@[51:61) IdentifierSyntax +//@[51:61) Identifier |properties| +//@[61:62) Dot |.| +//@[62:73) IdentifierSyntax +//@[62:73) Identifier |displayName| +//@[73:84) StringRightPiece |}) (set 2)'| +//@[84:86) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:38) ObjectPropertySyntax +//@[2:11) IdentifierSyntax +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:38) ArraySyntax +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + anotherSet[0] +//@[4:17) ArrayItemSyntax +//@[4:17) ArrayAccessSyntax +//@[4:14) VariableAccessSyntax +//@[4:14) IdentifierSyntax +//@[4:14) Identifier |anotherSet| +//@[14:15) LeftSquare |[| +//@[15:16) IntegerLiteralSyntax +//@[15:16) Integer |0| +//@[16:17) RightSquare |]| +//@[17:19) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.tokens.bicep new file mode 100644 index 00000000000..932d7992de5 --- /dev/null +++ b/src/Bicep.Core.Samples/Files/ResourcesTenant_CRLF/main.tokens.bicep @@ -0,0 +1,255 @@ +targetScope = 'tenant' +//@[0:11) Identifier |targetScope| +//@[12:13) Assignment |=| +//@[14:22) StringComplete |'tenant'| +//@[22:26) NewLine |\r\n\r\n| + +var managementGroups = [ +//@[0:3) Identifier |var| +//@[4:20) Identifier |managementGroups| +//@[21:22) Assignment |=| +//@[23:24) LeftSquare |[| +//@[24:26) NewLine |\r\n| + { +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'one' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'one'| +//@[15:17) NewLine |\r\n| + displayName: 'The first' +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:28) StringComplete |'The first'| +//@[28:30) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + { +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'two' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'two'| +//@[15:17) NewLine |\r\n| + displayName: 'The second' +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:29) StringComplete |'The second'| +//@[29:31) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +] +//@[0:1) RightSquare |]| +//@[1:5) NewLine |\r\n\r\n| + +resource singleGroup 'Microsoft.Management/managementGroups@2020-05-01' = { +//@[0:8) Identifier |resource| +//@[9:20) Identifier |singleGroup| +//@[21:71) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[72:73) Assignment |=| +//@[74:75) LeftBrace |{| +//@[75:77) NewLine |\r\n| + name: 'myMG' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) StringComplete |'myMG'| +//@[14:16) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: 'This one is mine!' +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:36) StringComplete |'This one is mine!'| +//@[36:38) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +} +//@[0:1) RightBrace |}| +//@[1:5) NewLine |\r\n\r\n| + +resource manyGroups 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[0:8) Identifier |resource| +//@[9:19) Identifier |manyGroups| +//@[20:70) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[71:72) Assignment |=| +//@[73:74) LeftSquare |[| +//@[74:77) Identifier |for| +//@[78:80) Identifier |mg| +//@[81:83) Identifier |in| +//@[84:100) Identifier |managementGroups| +//@[100:101) Colon |:| +//@[102:103) LeftBrace |{| +//@[103:105) NewLine |\r\n| + name: mg.name +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:10) Identifier |mg| +//@[10:11) Dot |.| +//@[11:15) Identifier |name| +//@[15:17) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: '${mg.displayName} (${singleGroup.properties.displayName})' +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:20) StringLeftPiece |'${| +//@[20:22) Identifier |mg| +//@[22:23) Dot |.| +//@[23:34) Identifier |displayName| +//@[34:39) StringMiddlePiece |} (${| +//@[39:50) Identifier |singleGroup| +//@[50:51) Dot |.| +//@[51:61) Identifier |properties| +//@[61:62) Dot |.| +//@[62:73) Identifier |displayName| +//@[73:76) StringRightPiece |})'| +//@[76:78) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource anotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[0:8) Identifier |resource| +//@[9:19) Identifier |anotherSet| +//@[20:70) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[71:72) Assignment |=| +//@[73:74) LeftSquare |[| +//@[74:77) Identifier |for| +//@[78:80) Identifier |mg| +//@[81:83) Identifier |in| +//@[84:100) Identifier |managementGroups| +//@[100:101) Colon |:| +//@[102:103) LeftBrace |{| +//@[103:105) NewLine |\r\n| + name: concat(mg.name, '-one') +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) Identifier |concat| +//@[14:15) LeftParen |(| +//@[15:17) Identifier |mg| +//@[17:18) Dot |.| +//@[18:22) Identifier |name| +//@[22:23) Comma |,| +//@[24:30) StringComplete |'-one'| +//@[30:31) RightParen |)| +//@[31:33) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 1)' +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:20) StringLeftPiece |'${| +//@[20:22) Identifier |mg| +//@[22:23) Dot |.| +//@[23:34) Identifier |displayName| +//@[34:39) StringMiddlePiece |} (${| +//@[39:50) Identifier |singleGroup| +//@[50:51) Dot |.| +//@[51:61) Identifier |properties| +//@[61:62) Dot |.| +//@[62:73) Identifier |displayName| +//@[73:84) StringRightPiece |}) (set 1)'| +//@[84:86) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + manyGroups +//@[4:14) Identifier |manyGroups| +//@[14:16) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +resource yetAnotherSet 'Microsoft.Management/managementGroups@2020-05-01' = [for mg in managementGroups: { +//@[0:8) Identifier |resource| +//@[9:22) Identifier |yetAnotherSet| +//@[23:73) StringComplete |'Microsoft.Management/managementGroups@2020-05-01'| +//@[74:75) Assignment |=| +//@[76:77) LeftSquare |[| +//@[77:80) Identifier |for| +//@[81:83) Identifier |mg| +//@[84:86) Identifier |in| +//@[87:103) Identifier |managementGroups| +//@[103:104) Colon |:| +//@[105:106) LeftBrace |{| +//@[106:108) NewLine |\r\n| + name: concat(mg.name, '-two') +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:14) Identifier |concat| +//@[14:15) LeftParen |(| +//@[15:17) Identifier |mg| +//@[17:18) Dot |.| +//@[18:22) Identifier |name| +//@[22:23) Comma |,| +//@[24:30) StringComplete |'-two'| +//@[30:31) RightParen |)| +//@[31:33) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + displayName: '${mg.displayName} (${singleGroup.properties.displayName}) (set 2)' +//@[4:15) Identifier |displayName| +//@[15:16) Colon |:| +//@[17:20) StringLeftPiece |'${| +//@[20:22) Identifier |mg| +//@[22:23) Dot |.| +//@[23:34) Identifier |displayName| +//@[34:39) StringMiddlePiece |} (${| +//@[39:50) Identifier |singleGroup| +//@[50:51) Dot |.| +//@[51:61) Identifier |properties| +//@[61:62) Dot |.| +//@[62:73) Identifier |displayName| +//@[73:84) StringRightPiece |}) (set 2)'| +//@[84:86) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + dependsOn: [ +//@[2:11) Identifier |dependsOn| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:16) NewLine |\r\n| + anotherSet[0] +//@[4:14) Identifier |anotherSet| +//@[14:15) LeftSquare |[| +//@[15:16) Integer |0| +//@[16:17) RightSquare |]| +//@[17:19) NewLine |\r\n| + ] +//@[2:3) RightSquare |]| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/subnetIdAndProperties.json b/src/Bicep.Core.Samples/Files/Resources_CRLF/Completions/subnetIdAndProperties.json similarity index 100% rename from src/Bicep.Core.Samples/Files/InvalidResources_CRLF/Completions/subnetIdAndProperties.json rename to src/Bicep.Core.Samples/Files/Resources_CRLF/Completions/subnetIdAndProperties.json diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.bicep b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.bicep index e5831399467..b0e2784b527 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.bicep +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.bicep @@ -265,4 +265,71 @@ resource existing2 'Mock.Rp/existingExtensionResource@2020-01-01' existing = { resource extension3 'My.Rp/extensionResource@2020-12-01' = { name: 'extension3' scope: existing1 -} \ No newline at end of file +} + +/* + valid loop cases +*/ +var storageAccounts = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +// just a storage account loop +resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' +}] + +// basic nested loop +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: [for j in range(0, 4): { + // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties + name: 'subnet-${i}-${j}' + }] + } +}] + +// duplicate identifiers within the loop are allowed +resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: [for i in range(0, 4): { + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) +var canHaveDuplicatesAcrossScopes = 'hello' +resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { + name: 'vnet-${canHaveDuplicatesAcrossScopes}' + properties: { + subnets: [for i in range(0, 4): { + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate in global and multiple loop scopes are allowed (inner hides the outer) +var duplicatesEverywhere = 'hello' +resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { + name: 'vnet-${duplicatesEverywhere}' + properties: { + subnets: [for duplicatesEverywhere in range(0, 4): { + name: 'subnet-${duplicatesEverywhere}' + }] + } +}] \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.diagnostics.bicep b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.diagnostics.bicep index 9ece22b1dd4..073a71008e2 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.diagnostics.bicep +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.diagnostics.bicep @@ -282,3 +282,70 @@ resource extension3 'My.Rp/extensionResource@2020-12-01' = { name: 'extension3' scope: existing1 } + +/* + valid loop cases +*/ +var storageAccounts = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +// just a storage account loop +resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' +}] + +// basic nested loop +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: [for j in range(0, 4): { + // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties + name: 'subnet-${i}-${j}' + }] + } +}] + +// duplicate identifiers within the loop are allowed +resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: [for i in range(0, 4): { + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) +var canHaveDuplicatesAcrossScopes = 'hello' +resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { + name: 'vnet-${canHaveDuplicatesAcrossScopes}' + properties: { + subnets: [for i in range(0, 4): { + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate in global and multiple loop scopes are allowed (inner hides the outer) +var duplicatesEverywhere = 'hello' +resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { + name: 'vnet-${duplicatesEverywhere}' + properties: { + subnets: [for duplicatesEverywhere in range(0, 4): { + name: 'subnet-${duplicatesEverywhere}' + }] + } +}] diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.formatted.bicep b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.formatted.bicep index 5e26386af6a..4439d988382 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.formatted.bicep +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.formatted.bicep @@ -265,3 +265,70 @@ resource extension3 'My.Rp/extensionResource@2020-12-01' = { name: 'extension3' scope: existing1 } + +/* + valid loop cases +*/ +var storageAccounts = [ + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +// just a storage account loop +resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' +}] + +// basic nested loop +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: [for j in range(0, 4): { + // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties + name: 'subnet-${i}-${j}' + }] + } +}] + +// duplicate identifiers within the loop are allowed +resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { + name: 'vnet-${i}' + properties: { + subnets: [for i in range(0, 4): { + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) +var canHaveDuplicatesAcrossScopes = 'hello' +resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { + name: 'vnet-${canHaveDuplicatesAcrossScopes}' + properties: { + subnets: [for i in range(0, 4): { + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate in global and multiple loop scopes are allowed (inner hides the outer) +var duplicatesEverywhere = 'hello' +resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { + name: 'vnet-${duplicatesEverywhere}' + properties: { + subnets: [for duplicatesEverywhere in range(0, 4): { + name: 'subnet-${duplicatesEverywhere}' + }] + } +}] diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.json b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.json index b683f4bf65a..09de7c0a2c2 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.json +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.json @@ -34,7 +34,19 @@ "id": "[resourceId('My.Rp/typeA/typeB', split(format('{0}/myName', 'resourceA'), '/')[0], split(format('{0}/myName', 'resourceA'), '/')[1])]" }, "setResourceCRef": true, - "myInterpKey": "abc" + "myInterpKey": "abc", + "storageAccounts": [ + { + "name": "one", + "location": "eastus2" + }, + { + "name": "two", + "location": "westus" + } + ], + "canHaveDuplicatesAcrossScopes": "hello", + "duplicatesEverywhere": "hello" }, "resources": [ { @@ -300,6 +312,100 @@ "scope": "[extensionResourceId(extensionResourceId(format('Microsoft.Compute/virtualMachines/{0}', 'vmName'), 'My.Rp/extensionResource', 'extension'), 'Mock.Rp/existingExtensionResource', 'existing1')]", "name": "extension3", "dependsOn": [] + }, + { + "copy": { + "name": "storageResources", + "count": "[length(variables('storageAccounts'))]" + }, + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[variables('storageAccounts')[copyIndex()].name]", + "location": "[variables('storageAccounts')[copyIndex()].location]", + "sku": { + "name": "Standard_LRS" + }, + "kind": "StorageV2" + }, + { + "copy": { + "name": "vnet", + "count": "[length(range(0, 3))]" + }, + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-06-01", + "name": "[format('vnet-{0}', range(0, 3)[copyIndex()])]", + "properties": { + "copy": [ + { + "name": "subnets", + "count": "[length(range(0, 4))]", + "input": { + "name": "[format('subnet-{0}-{1}', range(0, 3)[copyIndex()], range(0, 4)[copyIndex('subnets')])]" + } + } + ] + } + }, + { + "copy": { + "name": "duplicateIdentifiersWithinLoop", + "count": "[length(range(0, 3))]" + }, + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-06-01", + "name": "[format('vnet-{0}', range(0, 3)[copyIndex()])]", + "properties": { + "copy": [ + { + "name": "subnets", + "count": "[length(range(0, 4))]", + "input": { + "name": "[format('subnet-{0}-{1}', range(0, 4)[copyIndex('subnets')], range(0, 4)[copyIndex('subnets')])]" + } + } + ] + } + }, + { + "copy": { + "name": "duplicateInGlobalAndOneLoop", + "count": "[length(range(0, 3))]" + }, + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-06-01", + "name": "[format('vnet-{0}', range(0, 3)[copyIndex()])]", + "properties": { + "copy": [ + { + "name": "subnets", + "count": "[length(range(0, 4))]", + "input": { + "name": "[format('subnet-{0}-{1}', range(0, 4)[copyIndex('subnets')], range(0, 4)[copyIndex('subnets')])]" + } + } + ] + } + }, + { + "copy": { + "name": "duplicateInGlobalAndTwoLoops", + "count": "[length(range(0, 3))]" + }, + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-06-01", + "name": "[format('vnet-{0}', range(0, 3)[copyIndex()])]", + "properties": { + "copy": [ + { + "name": "subnets", + "count": "[length(range(0, 4))]", + "input": { + "name": "[format('subnet-{0}', range(0, 4)[copyIndex('subnets')])]" + } + } + ] + } } ], "outputs": { @@ -316,7 +422,7 @@ "_generator": { "name": "bicep", "version": "dev", - "templateHash": "1404093395982421705" + "templateHash": "14814389154615864983" } } } \ No newline at end of file diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.symbols.bicep b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.symbols.bicep index 38b6434f8d8..b84582ad2ae 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.symbols.bicep +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.symbols.bicep @@ -307,3 +307,87 @@ resource extension3 'My.Rp/extensionResource@2020-12-01' = { name: 'extension3' scope: existing1 } + +/* + valid loop cases +*/ +var storageAccounts = [ +//@[4:19) Variable storageAccounts. Type: array. Declaration start char: 0, length: 129 + { + name: 'one' + location: 'eastus2' + } + { + name: 'two' + location: 'westus' + } +] + +// just a storage account loop +resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[80:87) Local account. Type: any. Declaration start char: 80, length: 7 +//@[9:25) Resource storageResources. Type: Microsoft.Storage/storageAccounts@2019-06-01[]. Declaration start char: 0, length: 227 + name: account.name + location: account.location + sku: { + name: 'Standard_LRS' + } + kind: 'StorageV2' +}] + +// basic nested loop +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[68:69) Local i. Type: int. Declaration start char: 68, length: 1 +//@[9:13) Resource vnet. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 279 + name: 'vnet-${i}' + properties: { + subnets: [for j in range(0, 4): { +//@[18:19) Local j. Type: int. Declaration start char: 18, length: 1 + // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties + name: 'subnet-${i}-${j}' + }] + } +}] + +// duplicate identifiers within the loop are allowed +resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[94:95) Local i. Type: int. Declaration start char: 94, length: 1 +//@[9:39) Resource duplicateIdentifiersWithinLoop. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 239 + name: 'vnet-${i}' + properties: { + subnets: [for i in range(0, 4): { +//@[18:19) Local i. Type: int. Declaration start char: 18, length: 1 + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) +var canHaveDuplicatesAcrossScopes = 'hello' +//@[4:33) Variable canHaveDuplicatesAcrossScopes. Type: 'hello'. Declaration start char: 0, length: 43 +resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { +//@[91:120) Local canHaveDuplicatesAcrossScopes. Type: int. Declaration start char: 91, length: 29 +//@[9:36) Resource duplicateInGlobalAndOneLoop. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 292 + name: 'vnet-${canHaveDuplicatesAcrossScopes}' + properties: { + subnets: [for i in range(0, 4): { +//@[18:19) Local i. Type: int. Declaration start char: 18, length: 1 + name: 'subnet-${i}-${i}' + }] + } +}] + +// duplicate in global and multiple loop scopes are allowed (inner hides the outer) +var duplicatesEverywhere = 'hello' +//@[4:24) Variable duplicatesEverywhere. Type: 'hello'. Declaration start char: 0, length: 34 +resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { +//@[92:112) Local duplicatesEverywhere. Type: int. Declaration start char: 92, length: 20 +//@[9:37) Resource duplicateInGlobalAndTwoLoops. Type: Microsoft.Network/virtualNetworks@2020-06-01[]. Declaration start char: 0, length: 308 + name: 'vnet-${duplicatesEverywhere}' + properties: { + subnets: [for duplicatesEverywhere in range(0, 4): { +//@[18:38) Local duplicatesEverywhere. Type: int. Declaration start char: 18, length: 20 + name: 'subnet-${duplicatesEverywhere}' + }] + } +}] diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.syntax.bicep b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.syntax.bicep index 5a291f38a7d..82a227c6fdf 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.syntax.bicep +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.syntax.bicep @@ -1968,4 +1968,603 @@ resource extension3 'My.Rp/extensionResource@2020-12-01' = { //@[18:20) NewLine |\r\n| } //@[0:1) RightBrace |}| -//@[1:1) EndOfFile || +//@[1:5) NewLine |\r\n\r\n| + +/* + valid loop cases +*/ +//@[3:5) NewLine |\r\n| +var storageAccounts = [ +//@[0:129) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:19) IdentifierSyntax +//@[4:19) Identifier |storageAccounts| +//@[20:21) Assignment |=| +//@[22:129) ArraySyntax +//@[22:23) LeftSquare |[| +//@[23:25) NewLine |\r\n| + { +//@[2:50) ArrayItemSyntax +//@[2:50) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'one' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'one'| +//@[15:17) NewLine |\r\n| + location: 'eastus2' +//@[4:23) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:23) StringSyntax +//@[14:23) StringComplete |'eastus2'| +//@[23:25) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + { +//@[2:49) ArrayItemSyntax +//@[2:49) ObjectSyntax +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'two' +//@[4:15) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringSyntax +//@[10:15) StringComplete |'two'| +//@[15:17) NewLine |\r\n| + location: 'westus' +//@[4:22) ObjectPropertySyntax +//@[4:12) IdentifierSyntax +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:22) StringSyntax +//@[14:22) StringComplete |'westus'| +//@[22:24) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +] +//@[0:1) RightSquare |]| +//@[1:5) NewLine |\r\n\r\n| + +// just a storage account loop +//@[30:32) NewLine |\r\n| +resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[0:227) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:25) IdentifierSyntax +//@[9:25) Identifier |storageResources| +//@[26:72) StringSyntax +//@[26:72) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[73:74) Assignment |=| +//@[75:227) ForSyntax +//@[75:76) LeftSquare |[| +//@[76:79) Identifier |for| +//@[80:87) LocalVariableSyntax +//@[80:87) IdentifierSyntax +//@[80:87) Identifier |account| +//@[88:90) Identifier |in| +//@[91:106) VariableAccessSyntax +//@[91:106) IdentifierSyntax +//@[91:106) Identifier |storageAccounts| +//@[106:107) Colon |:| +//@[108:226) ObjectSyntax +//@[108:109) LeftBrace |{| +//@[109:111) NewLine |\r\n| + name: account.name +//@[2:20) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:20) PropertyAccessSyntax +//@[8:15) VariableAccessSyntax +//@[8:15) IdentifierSyntax +//@[8:15) Identifier |account| +//@[15:16) Dot |.| +//@[16:20) IdentifierSyntax +//@[16:20) Identifier |name| +//@[20:22) NewLine |\r\n| + location: account.location +//@[2:28) ObjectPropertySyntax +//@[2:10) IdentifierSyntax +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:28) PropertyAccessSyntax +//@[12:19) VariableAccessSyntax +//@[12:19) IdentifierSyntax +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) IdentifierSyntax +//@[20:28) Identifier |location| +//@[28:30) NewLine |\r\n| + sku: { +//@[2:39) ObjectPropertySyntax +//@[2:5) IdentifierSyntax +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:39) ObjectSyntax +//@[7:8) LeftBrace |{| +//@[8:10) NewLine |\r\n| + name: 'Standard_LRS' +//@[4:24) ObjectPropertySyntax +//@[4:8) IdentifierSyntax +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringSyntax +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:26) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + kind: 'StorageV2' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:19) StringComplete |'StorageV2'| +//@[19:21) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// basic nested loop +//@[20:22) NewLine |\r\n| +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:279) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:13) IdentifierSyntax +//@[9:13) Identifier |vnet| +//@[14:60) StringSyntax +//@[14:60) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[61:62) Assignment |=| +//@[63:279) ForSyntax +//@[63:64) LeftSquare |[| +//@[64:67) Identifier |for| +//@[68:69) LocalVariableSyntax +//@[68:69) IdentifierSyntax +//@[68:69) Identifier |i| +//@[70:72) Identifier |in| +//@[73:84) FunctionCallSyntax +//@[73:78) IdentifierSyntax +//@[73:78) Identifier |range| +//@[78:79) LeftParen |(| +//@[79:81) FunctionArgumentSyntax +//@[79:80) IntegerLiteralSyntax +//@[79:80) Integer |0| +//@[80:81) Comma |,| +//@[82:83) FunctionArgumentSyntax +//@[82:83) IntegerLiteralSyntax +//@[82:83) Integer |3| +//@[83:84) RightParen |)| +//@[84:85) Colon |:| +//@[86:278) ObjectSyntax +//@[86:87) LeftBrace |{| +//@[87:89) NewLine |\r\n| + name: 'vnet-${i}' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:17) VariableAccessSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:21) NewLine |\r\n| + properties: { +//@[2:165) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:165) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for j in range(0, 4): { +//@[4:143) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:143) ForSyntax +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:19) LocalVariableSyntax +//@[18:19) IdentifierSyntax +//@[18:19) Identifier |j| +//@[20:22) Identifier |in| +//@[23:34) FunctionCallSyntax +//@[23:28) IdentifierSyntax +//@[23:28) Identifier |range| +//@[28:29) LeftParen |(| +//@[29:31) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |0| +//@[30:31) Comma |,| +//@[32:33) FunctionArgumentSyntax +//@[32:33) IntegerLiteralSyntax +//@[32:33) Integer |4| +//@[33:34) RightParen |)| +//@[34:35) Colon |:| +//@[36:142) ObjectSyntax +//@[36:37) LeftBrace |{| +//@[37:39) NewLine |\r\n| + // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties +//@[64:66) NewLine |\r\n| + name: 'subnet-${i}-${j}' +//@[6:30) ObjectPropertySyntax +//@[6:10) IdentifierSyntax +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:30) StringSyntax +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:23) VariableAccessSyntax +//@[22:23) IdentifierSyntax +//@[22:23) Identifier |i| +//@[23:27) StringMiddlePiece |}-${| +//@[27:28) VariableAccessSyntax +//@[27:28) IdentifierSyntax +//@[27:28) Identifier |j| +//@[28:30) StringRightPiece |}'| +//@[30:32) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifiers within the loop are allowed +//@[52:54) NewLine |\r\n| +resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:239) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:39) IdentifierSyntax +//@[9:39) Identifier |duplicateIdentifiersWithinLoop| +//@[40:86) StringSyntax +//@[40:86) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[87:88) Assignment |=| +//@[89:239) ForSyntax +//@[89:90) LeftSquare |[| +//@[90:93) Identifier |for| +//@[94:95) LocalVariableSyntax +//@[94:95) IdentifierSyntax +//@[94:95) Identifier |i| +//@[96:98) Identifier |in| +//@[99:110) FunctionCallSyntax +//@[99:104) IdentifierSyntax +//@[99:104) Identifier |range| +//@[104:105) LeftParen |(| +//@[105:107) FunctionArgumentSyntax +//@[105:106) IntegerLiteralSyntax +//@[105:106) Integer |0| +//@[106:107) Comma |,| +//@[108:109) FunctionArgumentSyntax +//@[108:109) IntegerLiteralSyntax +//@[108:109) Integer |3| +//@[109:110) RightParen |)| +//@[110:111) Colon |:| +//@[112:238) ObjectSyntax +//@[112:113) LeftBrace |{| +//@[113:115) NewLine |\r\n| + name: 'vnet-${i}' +//@[2:19) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:19) StringSyntax +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:17) VariableAccessSyntax +//@[16:17) IdentifierSyntax +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:21) NewLine |\r\n| + properties: { +//@[2:99) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:99) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for i in range(0, 4): { +//@[4:77) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:77) ForSyntax +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:19) LocalVariableSyntax +//@[18:19) IdentifierSyntax +//@[18:19) Identifier |i| +//@[20:22) Identifier |in| +//@[23:34) FunctionCallSyntax +//@[23:28) IdentifierSyntax +//@[23:28) Identifier |range| +//@[28:29) LeftParen |(| +//@[29:31) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |0| +//@[30:31) Comma |,| +//@[32:33) FunctionArgumentSyntax +//@[32:33) IntegerLiteralSyntax +//@[32:33) Integer |4| +//@[33:34) RightParen |)| +//@[34:35) Colon |:| +//@[36:76) ObjectSyntax +//@[36:37) LeftBrace |{| +//@[37:39) NewLine |\r\n| + name: 'subnet-${i}-${i}' +//@[6:30) ObjectPropertySyntax +//@[6:10) IdentifierSyntax +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:30) StringSyntax +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:23) VariableAccessSyntax +//@[22:23) IdentifierSyntax +//@[22:23) Identifier |i| +//@[23:27) StringMiddlePiece |}-${| +//@[27:28) VariableAccessSyntax +//@[27:28) IdentifierSyntax +//@[27:28) Identifier |i| +//@[28:30) StringRightPiece |}'| +//@[30:32) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) +//@[100:102) NewLine |\r\n| +var canHaveDuplicatesAcrossScopes = 'hello' +//@[0:43) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:33) IdentifierSyntax +//@[4:33) Identifier |canHaveDuplicatesAcrossScopes| +//@[34:35) Assignment |=| +//@[36:43) StringSyntax +//@[36:43) StringComplete |'hello'| +//@[43:45) NewLine |\r\n| +resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { +//@[0:292) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:36) IdentifierSyntax +//@[9:36) Identifier |duplicateInGlobalAndOneLoop| +//@[37:83) StringSyntax +//@[37:83) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[84:85) Assignment |=| +//@[86:292) ForSyntax +//@[86:87) LeftSquare |[| +//@[87:90) Identifier |for| +//@[91:120) LocalVariableSyntax +//@[91:120) IdentifierSyntax +//@[91:120) Identifier |canHaveDuplicatesAcrossScopes| +//@[121:123) Identifier |in| +//@[124:135) FunctionCallSyntax +//@[124:129) IdentifierSyntax +//@[124:129) Identifier |range| +//@[129:130) LeftParen |(| +//@[130:132) FunctionArgumentSyntax +//@[130:131) IntegerLiteralSyntax +//@[130:131) Integer |0| +//@[131:132) Comma |,| +//@[133:134) FunctionArgumentSyntax +//@[133:134) IntegerLiteralSyntax +//@[133:134) Integer |3| +//@[134:135) RightParen |)| +//@[135:136) Colon |:| +//@[137:291) ObjectSyntax +//@[137:138) LeftBrace |{| +//@[138:140) NewLine |\r\n| + name: 'vnet-${canHaveDuplicatesAcrossScopes}' +//@[2:47) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:47) StringSyntax +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:45) VariableAccessSyntax +//@[16:45) IdentifierSyntax +//@[16:45) Identifier |canHaveDuplicatesAcrossScopes| +//@[45:47) StringRightPiece |}'| +//@[47:49) NewLine |\r\n| + properties: { +//@[2:99) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:99) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for i in range(0, 4): { +//@[4:77) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:77) ForSyntax +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:19) LocalVariableSyntax +//@[18:19) IdentifierSyntax +//@[18:19) Identifier |i| +//@[20:22) Identifier |in| +//@[23:34) FunctionCallSyntax +//@[23:28) IdentifierSyntax +//@[23:28) Identifier |range| +//@[28:29) LeftParen |(| +//@[29:31) FunctionArgumentSyntax +//@[29:30) IntegerLiteralSyntax +//@[29:30) Integer |0| +//@[30:31) Comma |,| +//@[32:33) FunctionArgumentSyntax +//@[32:33) IntegerLiteralSyntax +//@[32:33) Integer |4| +//@[33:34) RightParen |)| +//@[34:35) Colon |:| +//@[36:76) ObjectSyntax +//@[36:37) LeftBrace |{| +//@[37:39) NewLine |\r\n| + name: 'subnet-${i}-${i}' +//@[6:30) ObjectPropertySyntax +//@[6:10) IdentifierSyntax +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:30) StringSyntax +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:23) VariableAccessSyntax +//@[22:23) IdentifierSyntax +//@[22:23) Identifier |i| +//@[23:27) StringMiddlePiece |}-${| +//@[27:28) VariableAccessSyntax +//@[27:28) IdentifierSyntax +//@[27:28) Identifier |i| +//@[28:30) StringRightPiece |}'| +//@[30:32) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate in global and multiple loop scopes are allowed (inner hides the outer) +//@[83:85) NewLine |\r\n| +var duplicatesEverywhere = 'hello' +//@[0:34) VariableDeclarationSyntax +//@[0:3) Identifier |var| +//@[4:24) IdentifierSyntax +//@[4:24) Identifier |duplicatesEverywhere| +//@[25:26) Assignment |=| +//@[27:34) StringSyntax +//@[27:34) StringComplete |'hello'| +//@[34:36) NewLine |\r\n| +resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { +//@[0:308) ResourceDeclarationSyntax +//@[0:8) Identifier |resource| +//@[9:37) IdentifierSyntax +//@[9:37) Identifier |duplicateInGlobalAndTwoLoops| +//@[38:84) StringSyntax +//@[38:84) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[85:86) Assignment |=| +//@[87:308) ForSyntax +//@[87:88) LeftSquare |[| +//@[88:91) Identifier |for| +//@[92:112) LocalVariableSyntax +//@[92:112) IdentifierSyntax +//@[92:112) Identifier |duplicatesEverywhere| +//@[113:115) Identifier |in| +//@[116:127) FunctionCallSyntax +//@[116:121) IdentifierSyntax +//@[116:121) Identifier |range| +//@[121:122) LeftParen |(| +//@[122:124) FunctionArgumentSyntax +//@[122:123) IntegerLiteralSyntax +//@[122:123) Integer |0| +//@[123:124) Comma |,| +//@[125:126) FunctionArgumentSyntax +//@[125:126) IntegerLiteralSyntax +//@[125:126) Integer |3| +//@[126:127) RightParen |)| +//@[127:128) Colon |:| +//@[129:307) ObjectSyntax +//@[129:130) LeftBrace |{| +//@[130:132) NewLine |\r\n| + name: 'vnet-${duplicatesEverywhere}' +//@[2:38) ObjectPropertySyntax +//@[2:6) IdentifierSyntax +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:38) StringSyntax +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:36) VariableAccessSyntax +//@[16:36) IdentifierSyntax +//@[16:36) Identifier |duplicatesEverywhere| +//@[36:38) StringRightPiece |}'| +//@[38:40) NewLine |\r\n| + properties: { +//@[2:132) ObjectPropertySyntax +//@[2:12) IdentifierSyntax +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:132) ObjectSyntax +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for duplicatesEverywhere in range(0, 4): { +//@[4:110) ObjectPropertySyntax +//@[4:11) IdentifierSyntax +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:110) ForSyntax +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:38) LocalVariableSyntax +//@[18:38) IdentifierSyntax +//@[18:38) Identifier |duplicatesEverywhere| +//@[39:41) Identifier |in| +//@[42:53) FunctionCallSyntax +//@[42:47) IdentifierSyntax +//@[42:47) Identifier |range| +//@[47:48) LeftParen |(| +//@[48:50) FunctionArgumentSyntax +//@[48:49) IntegerLiteralSyntax +//@[48:49) Integer |0| +//@[49:50) Comma |,| +//@[51:52) FunctionArgumentSyntax +//@[51:52) IntegerLiteralSyntax +//@[51:52) Integer |4| +//@[52:53) RightParen |)| +//@[53:54) Colon |:| +//@[55:109) ObjectSyntax +//@[55:56) LeftBrace |{| +//@[56:58) NewLine |\r\n| + name: 'subnet-${duplicatesEverywhere}' +//@[6:44) ObjectPropertySyntax +//@[6:10) IdentifierSyntax +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:44) StringSyntax +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:42) VariableAccessSyntax +//@[22:42) IdentifierSyntax +//@[22:42) Identifier |duplicatesEverywhere| +//@[42:44) StringRightPiece |}'| +//@[44:46) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.tokens.bicep b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.tokens.bicep index 8b7ea09bad6..0975908278f 100644 --- a/src/Bicep.Core.Samples/Files/Resources_CRLF/main.tokens.bicep +++ b/src/Bicep.Core.Samples/Files/Resources_CRLF/main.tokens.bicep @@ -1257,4 +1257,390 @@ resource extension3 'My.Rp/extensionResource@2020-12-01' = { //@[18:20) NewLine |\r\n| } //@[0:1) RightBrace |}| -//@[1:1) EndOfFile || +//@[1:5) NewLine |\r\n\r\n| + +/* + valid loop cases +*/ +//@[3:5) NewLine |\r\n| +var storageAccounts = [ +//@[0:3) Identifier |var| +//@[4:19) Identifier |storageAccounts| +//@[20:21) Assignment |=| +//@[22:23) LeftSquare |[| +//@[23:25) NewLine |\r\n| + { +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'one' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'one'| +//@[15:17) NewLine |\r\n| + location: 'eastus2' +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:23) StringComplete |'eastus2'| +//@[23:25) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + { +//@[2:3) LeftBrace |{| +//@[3:5) NewLine |\r\n| + name: 'two' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:15) StringComplete |'two'| +//@[15:17) NewLine |\r\n| + location: 'westus' +//@[4:12) Identifier |location| +//@[12:13) Colon |:| +//@[14:22) StringComplete |'westus'| +//@[22:24) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +] +//@[0:1) RightSquare |]| +//@[1:5) NewLine |\r\n\r\n| + +// just a storage account loop +//@[30:32) NewLine |\r\n| +resource storageResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for account in storageAccounts: { +//@[0:8) Identifier |resource| +//@[9:25) Identifier |storageResources| +//@[26:72) StringComplete |'Microsoft.Storage/storageAccounts@2019-06-01'| +//@[73:74) Assignment |=| +//@[75:76) LeftSquare |[| +//@[76:79) Identifier |for| +//@[80:87) Identifier |account| +//@[88:90) Identifier |in| +//@[91:106) Identifier |storageAccounts| +//@[106:107) Colon |:| +//@[108:109) LeftBrace |{| +//@[109:111) NewLine |\r\n| + name: account.name +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:15) Identifier |account| +//@[15:16) Dot |.| +//@[16:20) Identifier |name| +//@[20:22) NewLine |\r\n| + location: account.location +//@[2:10) Identifier |location| +//@[10:11) Colon |:| +//@[12:19) Identifier |account| +//@[19:20) Dot |.| +//@[20:28) Identifier |location| +//@[28:30) NewLine |\r\n| + sku: { +//@[2:5) Identifier |sku| +//@[5:6) Colon |:| +//@[7:8) LeftBrace |{| +//@[8:10) NewLine |\r\n| + name: 'Standard_LRS' +//@[4:8) Identifier |name| +//@[8:9) Colon |:| +//@[10:24) StringComplete |'Standard_LRS'| +//@[24:26) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| + kind: 'StorageV2' +//@[2:6) Identifier |kind| +//@[6:7) Colon |:| +//@[8:19) StringComplete |'StorageV2'| +//@[19:21) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// basic nested loop +//@[20:22) NewLine |\r\n| +resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:8) Identifier |resource| +//@[9:13) Identifier |vnet| +//@[14:60) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[61:62) Assignment |=| +//@[63:64) LeftSquare |[| +//@[64:67) Identifier |for| +//@[68:69) Identifier |i| +//@[70:72) Identifier |in| +//@[73:78) Identifier |range| +//@[78:79) LeftParen |(| +//@[79:80) Integer |0| +//@[80:81) Comma |,| +//@[82:83) Integer |3| +//@[83:84) RightParen |)| +//@[84:85) Colon |:| +//@[86:87) LeftBrace |{| +//@[87:89) NewLine |\r\n| + name: 'vnet-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:21) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for j in range(0, 4): { +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:19) Identifier |j| +//@[20:22) Identifier |in| +//@[23:28) Identifier |range| +//@[28:29) LeftParen |(| +//@[29:30) Integer |0| +//@[30:31) Comma |,| +//@[32:33) Integer |4| +//@[33:34) RightParen |)| +//@[34:35) Colon |:| +//@[36:37) LeftBrace |{| +//@[37:39) NewLine |\r\n| + // #completionTest(0,1,2,3,4,5,6) -> subnetIdAndProperties +//@[64:66) NewLine |\r\n| + name: 'subnet-${i}-${j}' +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:23) Identifier |i| +//@[23:27) StringMiddlePiece |}-${| +//@[27:28) Identifier |j| +//@[28:30) StringRightPiece |}'| +//@[30:32) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifiers within the loop are allowed +//@[52:54) NewLine |\r\n| +resource duplicateIdentifiersWithinLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for i in range(0, 3): { +//@[0:8) Identifier |resource| +//@[9:39) Identifier |duplicateIdentifiersWithinLoop| +//@[40:86) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[87:88) Assignment |=| +//@[89:90) LeftSquare |[| +//@[90:93) Identifier |for| +//@[94:95) Identifier |i| +//@[96:98) Identifier |in| +//@[99:104) Identifier |range| +//@[104:105) LeftParen |(| +//@[105:106) Integer |0| +//@[106:107) Comma |,| +//@[108:109) Integer |3| +//@[109:110) RightParen |)| +//@[110:111) Colon |:| +//@[112:113) LeftBrace |{| +//@[113:115) NewLine |\r\n| + name: 'vnet-${i}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:17) Identifier |i| +//@[17:19) StringRightPiece |}'| +//@[19:21) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for i in range(0, 4): { +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:19) Identifier |i| +//@[20:22) Identifier |in| +//@[23:28) Identifier |range| +//@[28:29) LeftParen |(| +//@[29:30) Integer |0| +//@[30:31) Comma |,| +//@[32:33) Integer |4| +//@[33:34) RightParen |)| +//@[34:35) Colon |:| +//@[36:37) LeftBrace |{| +//@[37:39) NewLine |\r\n| + name: 'subnet-${i}-${i}' +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:23) Identifier |i| +//@[23:27) StringMiddlePiece |}-${| +//@[27:28) Identifier |i| +//@[28:30) StringRightPiece |}'| +//@[30:32) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate identifers in global and single loop scope are allowed (inner variable hides the outer) +//@[100:102) NewLine |\r\n| +var canHaveDuplicatesAcrossScopes = 'hello' +//@[0:3) Identifier |var| +//@[4:33) Identifier |canHaveDuplicatesAcrossScopes| +//@[34:35) Assignment |=| +//@[36:43) StringComplete |'hello'| +//@[43:45) NewLine |\r\n| +resource duplicateInGlobalAndOneLoop 'Microsoft.Network/virtualNetworks@2020-06-01' = [for canHaveDuplicatesAcrossScopes in range(0, 3): { +//@[0:8) Identifier |resource| +//@[9:36) Identifier |duplicateInGlobalAndOneLoop| +//@[37:83) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[84:85) Assignment |=| +//@[86:87) LeftSquare |[| +//@[87:90) Identifier |for| +//@[91:120) Identifier |canHaveDuplicatesAcrossScopes| +//@[121:123) Identifier |in| +//@[124:129) Identifier |range| +//@[129:130) LeftParen |(| +//@[130:131) Integer |0| +//@[131:132) Comma |,| +//@[133:134) Integer |3| +//@[134:135) RightParen |)| +//@[135:136) Colon |:| +//@[137:138) LeftBrace |{| +//@[138:140) NewLine |\r\n| + name: 'vnet-${canHaveDuplicatesAcrossScopes}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:45) Identifier |canHaveDuplicatesAcrossScopes| +//@[45:47) StringRightPiece |}'| +//@[47:49) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for i in range(0, 4): { +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:19) Identifier |i| +//@[20:22) Identifier |in| +//@[23:28) Identifier |range| +//@[28:29) LeftParen |(| +//@[29:30) Integer |0| +//@[30:31) Comma |,| +//@[32:33) Integer |4| +//@[33:34) RightParen |)| +//@[34:35) Colon |:| +//@[36:37) LeftBrace |{| +//@[37:39) NewLine |\r\n| + name: 'subnet-${i}-${i}' +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:23) Identifier |i| +//@[23:27) StringMiddlePiece |}-${| +//@[27:28) Identifier |i| +//@[28:30) StringRightPiece |}'| +//@[30:32) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:6) NewLine |\r\n\r\n| + +// duplicate in global and multiple loop scopes are allowed (inner hides the outer) +//@[83:85) NewLine |\r\n| +var duplicatesEverywhere = 'hello' +//@[0:3) Identifier |var| +//@[4:24) Identifier |duplicatesEverywhere| +//@[25:26) Assignment |=| +//@[27:34) StringComplete |'hello'| +//@[34:36) NewLine |\r\n| +resource duplicateInGlobalAndTwoLoops 'Microsoft.Network/virtualNetworks@2020-06-01' = [for duplicatesEverywhere in range(0, 3): { +//@[0:8) Identifier |resource| +//@[9:37) Identifier |duplicateInGlobalAndTwoLoops| +//@[38:84) StringComplete |'Microsoft.Network/virtualNetworks@2020-06-01'| +//@[85:86) Assignment |=| +//@[87:88) LeftSquare |[| +//@[88:91) Identifier |for| +//@[92:112) Identifier |duplicatesEverywhere| +//@[113:115) Identifier |in| +//@[116:121) Identifier |range| +//@[121:122) LeftParen |(| +//@[122:123) Integer |0| +//@[123:124) Comma |,| +//@[125:126) Integer |3| +//@[126:127) RightParen |)| +//@[127:128) Colon |:| +//@[129:130) LeftBrace |{| +//@[130:132) NewLine |\r\n| + name: 'vnet-${duplicatesEverywhere}' +//@[2:6) Identifier |name| +//@[6:7) Colon |:| +//@[8:16) StringLeftPiece |'vnet-${| +//@[16:36) Identifier |duplicatesEverywhere| +//@[36:38) StringRightPiece |}'| +//@[38:40) NewLine |\r\n| + properties: { +//@[2:12) Identifier |properties| +//@[12:13) Colon |:| +//@[14:15) LeftBrace |{| +//@[15:17) NewLine |\r\n| + subnets: [for duplicatesEverywhere in range(0, 4): { +//@[4:11) Identifier |subnets| +//@[11:12) Colon |:| +//@[13:14) LeftSquare |[| +//@[14:17) Identifier |for| +//@[18:38) Identifier |duplicatesEverywhere| +//@[39:41) Identifier |in| +//@[42:47) Identifier |range| +//@[47:48) LeftParen |(| +//@[48:49) Integer |0| +//@[49:50) Comma |,| +//@[51:52) Integer |4| +//@[52:53) RightParen |)| +//@[53:54) Colon |:| +//@[55:56) LeftBrace |{| +//@[56:58) NewLine |\r\n| + name: 'subnet-${duplicatesEverywhere}' +//@[6:10) Identifier |name| +//@[10:11) Colon |:| +//@[12:22) StringLeftPiece |'subnet-${| +//@[22:42) Identifier |duplicatesEverywhere| +//@[42:44) StringRightPiece |}'| +//@[44:46) NewLine |\r\n| + }] +//@[4:5) RightBrace |}| +//@[5:6) RightSquare |]| +//@[6:8) NewLine |\r\n| + } +//@[2:3) RightBrace |}| +//@[3:5) NewLine |\r\n| +}] +//@[0:1) RightBrace |}| +//@[1:2) RightSquare |]| +//@[2:2) EndOfFile || diff --git a/src/Bicep.Core.UnitTests/TypeSystem/ArrayTypeTests.cs b/src/Bicep.Core.UnitTests/TypeSystem/ArrayTypeTests.cs new file mode 100644 index 00000000000..59b08161a8c --- /dev/null +++ b/src/Bicep.Core.UnitTests/TypeSystem/ArrayTypeTests.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Bicep.Core.TypeSystem; +using FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Bicep.Core.UnitTests.TypeSystem +{ + [TestClass] + public class ArrayTypeTests + { + [TestMethod] + public void ArraysOfSimpleTypesShouldHaveExpectedDisplayString() + { + Create(LanguageConstants.Int).Name.Should().Be("int[]"); + Create(LanguageConstants.String).Name.Should().Be("string[]"); + } + + [TestMethod] + public void ArraysOfCompoundTypesShouldHaveExpectedDisplayString() + { + Create(UnionType.Create(new StringLiteralType("one"), new StringLiteralType("two"))).Name.Should().Be("('one' | 'two')[]"); + + Create(UnionType.Create(LanguageConstants.CreateResourceScopeReference(ResourceScope.ManagementGroup), new StringLiteralType("test"))).Name + .Should().Be("('test' | managementGroup)[]"); + + Create(UnionType.Create(LanguageConstants.CreateResourceScopeReference(ResourceScope.ManagementGroup | ResourceScope.Tenant), new StringLiteralType("test"))).Name + .Should().Be("('test' | (tenant | managementGroup))[]"); + } + + private static TypedArrayType Create(TypeSymbol itemType) => new TypedArrayType(itemType, TypeSymbolValidationFlags.Default); + } +} diff --git a/src/Bicep.Core.UnitTests/TypeSystem/UnionTypeTests.cs b/src/Bicep.Core.UnitTests/TypeSystem/UnionTypeTests.cs index ff308456667..cbb208cc9fe 100644 --- a/src/Bicep.Core.UnitTests/TypeSystem/UnionTypeTests.cs +++ b/src/Bicep.Core.UnitTests/TypeSystem/UnionTypeTests.cs @@ -83,6 +83,18 @@ public void UnionTypeShouldDisplayStringLiteralsCorrectly() unionType.Name.Should().Be("'Error' | 'Info' | 'Warning'"); } + [TestMethod] + public void UnionTypeInvolvingResourceScopeTypesShouldProduceExpectedDisplayString() + { + var unionType = UnionType.Create( + new StringLiteralType("Test"), + LanguageConstants.CreateResourceScopeReference(ResourceScope.Resource), + LanguageConstants.CreateResourceScopeReference(ResourceScope.Subscription | ResourceScope.Tenant) + ); + + unionType.Name.Should().Be("'Test' | resource | (tenant | subscription)"); + } + [TestMethod] public void SingletonUnionCreationShouldProduceSingletonType() { diff --git a/src/Bicep.Core/DataFlow/DataFlowAnalyzer.cs b/src/Bicep.Core/DataFlow/DataFlowAnalyzer.cs new file mode 100644 index 00000000000..95639bbcee9 --- /dev/null +++ b/src/Bicep.Core/DataFlow/DataFlowAnalyzer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Bicep.Core.Semantics; +using Bicep.Core.Syntax; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Bicep.Core.DataFlow +{ + public class DataFlowAnalyzer + { + private readonly SemanticModel semanticModel; + + public DataFlowAnalyzer(SemanticModel semanticModel) + { + this.semanticModel = semanticModel; + } + + public IList GetInaccessibleLocalsAfterSyntaxMove(SyntaxBase syntax, SyntaxBase newParent) + { + var symbolDependencies = LocalSymbolDependencyVisitor.GetLocalSymbolDependencies(this.semanticModel, syntax); + + return symbolDependencies + .Where(symbol => !IsLocalAccessibleAfterMove(symbol, newParent)) + .ToList(); + } + + private bool IsLocalAccessibleAfterMove(LocalVariableSymbol symbol, SyntaxBase newParent) + { + // find out the scope where the local symbol starts being accessible + // (the declaration is outside of that node) + var bindingContainer = GetScopeBindingContainer(symbol); + + // the symbol remains accessible IFF the newParent is below the binding container + return this.semanticModel.SyntaxTree.Hierarchy.IsDescendant(node: newParent, potentialAncestor: bindingContainer); + } + + /// + /// Gets the syntax in which the specified symbol starts being accessible. + /// + /// the local variable symbol + private SyntaxBase GetScopeBindingContainer(LocalVariableSymbol symbol) + { + var parent = this.semanticModel.GetSymbolParent(symbol); + if(parent is LocalScope scope) + { + return scope.BindingSyntax; + } + + throw new InvalidOperationException($"Unexpected local variable parent type '{parent?.GetType().Name}'"); + } + } +} diff --git a/src/Bicep.Core/DataFlow/LocalSymbolDependencyVisitor.cs b/src/Bicep.Core/DataFlow/LocalSymbolDependencyVisitor.cs new file mode 100644 index 00000000000..52c22744583 --- /dev/null +++ b/src/Bicep.Core/DataFlow/LocalSymbolDependencyVisitor.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Bicep.Core.Semantics; +using Bicep.Core.Syntax; +using System.Collections.Generic; +using System.Collections.Immutable; + +namespace Bicep.Core.DataFlow +{ + public sealed class LocalSymbolDependencyVisitor : SyntaxVisitor + { + private readonly SemanticModel semanticModel; + + private LocalSymbolDependencyVisitor(SemanticModel semanticModel) + { + this.semanticModel = semanticModel; + } + + private HashSet SymbolDependencies { get; } = new(); + + public static ImmutableHashSet GetLocalSymbolDependencies(SemanticModel semanticModel, SyntaxBase syntax) + { + var visitor = new LocalSymbolDependencyVisitor(semanticModel); + visitor.Visit(syntax); + + return visitor.SymbolDependencies.ToImmutableHashSet(); + } + + public override void VisitVariableAccessSyntax(VariableAccessSyntax syntax) + { + var symbol = this.semanticModel.GetSymbolInfo(syntax); + if(symbol is LocalVariableSymbol local) + { + this.SymbolDependencies.Add(local); + } + + base.VisitVariableAccessSyntax(syntax); + } + } +} diff --git a/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs b/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs index 271a8a5ed89..e448be90907 100644 --- a/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs +++ b/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs @@ -280,7 +280,7 @@ public ErrorDiagnostic CannotResolveFunctionOverload(IList overloadSigna for (int i = 0; i < overloadCount; i++) { messageBuilder - .Append("\n") + .Append('\n') .Append($" Overload {i + 1} of {overloadCount}, \"{overloadSignatures[i]}\", gave the following error:\n") .Append($" Argument of type \"{argumentType}\" is not assignable to parameter of type \"{parameterTypes[i]}\"."); } @@ -789,10 +789,10 @@ public Diagnostic RuntimePropertyNotAllowed(string property, IEnumerable "BCP137", $"Loop expected an expression of type \"{LanguageConstants.Array}\" but the provided value is of type \"{actualType}\"."); - public ErrorDiagnostic LoopsNotSupported() => new( + public ErrorDiagnostic ForExpressionsNotSupportedHere() => new( TextSpan, "BCP138", - "Loops are not currently supported."); + "For-expressions are not supported in this context. For-expressions may be used as values of resource and module declarations or as values of resource and module properties."); public Diagnostic InvalidCrossResourceScope() => new( TextSpan, @@ -809,6 +809,21 @@ public Diagnostic RuntimePropertyNotAllowed(string property, IEnumerable TextSpan, "BCP141", "The expression cannot be used as a decorator as it is not callable."); + + public ErrorDiagnostic TooManyPropertyForExpressions() => new( + TextSpan, + "BCP142", + "Property value for-expressions cannot be nested."); + + public ErrorDiagnostic ExpressionedPropertiesNotAllowedWithLoops() => new( + TextSpan, + "BCP143", + "For-expressions cannot be used with properties whose names are also expressions."); + + public ErrorDiagnostic DirectAccessToCollectionNotSupported() => new( + TextSpan, + "BCP144", + "Directly referencing a resource or module collection is not currently supported. Apply an array indexer to the expression."); } public static DiagnosticBuilderInternal ForPosition(TextSpan span) diff --git a/src/Bicep.Core/Emit/EmitHelpers.cs b/src/Bicep.Core/Emit/EmitHelpers.cs index bbd7a52aeac..f55fda9570d 100644 --- a/src/Bicep.Core/Emit/EmitHelpers.cs +++ b/src/Bicep.Core/Emit/EmitHelpers.cs @@ -11,20 +11,22 @@ public static class EmitHelpers { /// /// Gets the resource type reference from a resource symbol, assuming it has already been type-checked. + /// Works for single resources and resource collections. /// /// The resource symbol /// If the resource symbol is not for a valid resource type. public static ResourceTypeReference GetTypeReference(ResourceSymbol resourceSymbol) { // TODO: come up with safety mechanism to ensure type checking has already occurred - if (!(resourceSymbol.Type is ResourceType resourceType)) + return resourceSymbol.Type switch { + ResourceType resourceType => resourceType.TypeReference, + ArrayType { Item: ResourceType resourceType } => resourceType.TypeReference, + // throw here because the semantic model should be completely valid at this point // (it's a code defect if it some errors were not emitted) - throw new ArgumentException($"Resource symbol does not have a valid type (found {resourceSymbol.Type.Name})"); - } - - return resourceType.TypeReference; + _ => throw new ArgumentException($"Resource symbol does not have a valid type (found {resourceSymbol.Type.Name})") + }; } } } diff --git a/src/Bicep.Core/Emit/EmitLimitationCalculator.cs b/src/Bicep.Core/Emit/EmitLimitationCalculator.cs index c0b83c7c167..5ac6988effa 100644 --- a/src/Bicep.Core/Emit/EmitLimitationCalculator.cs +++ b/src/Bicep.Core/Emit/EmitLimitationCalculator.cs @@ -21,6 +21,8 @@ public static EmitLimitationInfo Calculate(SemanticModel model) var resourceScopeData = ScopeHelper.GetResoureScopeInfo(model, diagnosticWriter); DeployTimeConstantVisitor.ValidateDeployTimeConstants(model, diagnosticWriter); + ForSyntaxValidatorVisitor.Validate(model, diagnosticWriter); + diagnosticWriter.WriteMultiple(DetectDuplicateNames(model, resourceScopeData, moduleScopeData)); return new EmitLimitationInfo(diagnosticWriter.GetDiagnostics(), moduleScopeData, resourceScopeData); diff --git a/src/Bicep.Core/Emit/EmitterContext.cs b/src/Bicep.Core/Emit/EmitterContext.cs index fba0ea21d55..5eaee22ffcb 100644 --- a/src/Bicep.Core/Emit/EmitterContext.cs +++ b/src/Bicep.Core/Emit/EmitterContext.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Immutable; +using Bicep.Core.DataFlow; using Bicep.Core.Semantics; -using Bicep.Core.Syntax; namespace Bicep.Core.Emit { @@ -11,15 +11,18 @@ public class EmitterContext public EmitterContext(SemanticModel semanticModel) { this.SemanticModel = semanticModel; + this.DataFlowAnalyzer = new(semanticModel); this.VariablesToInline = InlineDependencyVisitor.GetVariablesToInline(semanticModel); this.ResourceDependencies = ResourceDependencyVisitor.GetResourceDependencies(semanticModel); } public SemanticModel SemanticModel { get; } + public DataFlowAnalyzer DataFlowAnalyzer { get; } + public ImmutableHashSet VariablesToInline { get; } - public ImmutableDictionary> ResourceDependencies { get; } + public ImmutableDictionary> ResourceDependencies { get; } public ImmutableDictionary ModuleScopeData => SemanticModel.EmitLimitationInfo.ModuleScopeData; diff --git a/src/Bicep.Core/Emit/ExpressionConverter.cs b/src/Bicep.Core/Emit/ExpressionConverter.cs index 699afeee488..218996187c5 100644 --- a/src/Bicep.Core/Emit/ExpressionConverter.cs +++ b/src/Bicep.Core/Emit/ExpressionConverter.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; using System.Linq; using Azure.Deployments.Core.Extensions; @@ -19,11 +20,22 @@ public class ExpressionConverter { private readonly EmitterContext context; + private readonly ImmutableDictionary localReplacements; + public ExpressionConverter(EmitterContext context) + : this(context, ImmutableDictionary.Empty) + { + } + + private ExpressionConverter(EmitterContext context, ImmutableDictionary localReplacements) { this.context = context; + this.localReplacements = localReplacements; } + public ExpressionConverter AppendReplacement(LocalVariableSymbol symbol, LanguageExpression replacement) => + new(this.context, this.localReplacements.Add(symbol, replacement)); + /// /// Converts the specified bicep expression tree into an ARM template expression tree. /// The returned tree may be rooted at either a function expression or jtoken expression. @@ -84,47 +96,10 @@ public LanguageExpression ConvertExpression(SyntaxBase expression) instanceFunctionCall.Arguments.Select(a => ConvertExpression(a.Expression))); case ArrayAccessSyntax arrayAccess: - return AppendProperties( - ToFunctionExpression(arrayAccess.BaseExpression), - ConvertExpression(arrayAccess.IndexExpression)); + return ConvertArrayAccess(arrayAccess); case PropertyAccessSyntax propertyAccess: - if (propertyAccess.BaseExpression is VariableAccessSyntax propVariableAccess && - context.SemanticModel.GetSymbolInfo(propVariableAccess) is ResourceSymbol resourceSymbol) - { - // special cases for certain resource property access. if we recurse normally, we'll end up - // generating statements like reference(resourceId(...)).id which are not accepted by ARM - - var typeReference = EmitHelpers.GetTypeReference(resourceSymbol); - switch (propertyAccess.PropertyName.IdentifierName) - { - case "id": - return GetFullyQualifiedResourceId(resourceSymbol); - case "name": - return GetResourceNameExpression(resourceSymbol); - case "type": - return new JTokenExpression(typeReference.FullyQualifiedType); - case "apiVersion": - return new JTokenExpression(typeReference.ApiVersion); - case "properties": - // use the reference() overload without "full" to generate a shorter expression - return GetReferenceExpression(resourceSymbol, typeReference, false); - } - } - - var moduleAccess = TryGetModulePropertyAccess(propertyAccess); - if (moduleAccess != null) - { - var (moduleSymbol, outputName) = moduleAccess.Value; - return AppendProperties( - GetModuleOutputsReferenceExpression(moduleSymbol), - new JTokenExpression(outputName), - new JTokenExpression("value")); - } - - return AppendProperties( - ToFunctionExpression(propertyAccess.BaseExpression), - new JTokenExpression(propertyAccess.PropertyName.IdentifierName)); + return ConvertPropertyAccess(propertyAccess); case VariableAccessSyntax variableAccess: return ConvertVariableAccess(variableAccess); @@ -134,37 +109,178 @@ public LanguageExpression ConvertExpression(SyntaxBase expression) } } - private (ModuleSymbol moduleSymbol, string outputName)? TryGetModulePropertyAccess(PropertyAccessSyntax propertyAccess) + public ExpressionConverter CreateConverterForIndexReplacement(SyntaxBase nameSyntax, SyntaxBase? indexExpression, SyntaxBase newContext) { - // is this a (.outputs). propertyAccess? - if (propertyAccess.BaseExpression is not PropertyAccessSyntax childPropertyAccess || childPropertyAccess.PropertyName.IdentifierName != LanguageConstants.ModuleOutputsPropertyName) + // local function + SyntaxBase GetArrayExpression(LocalVariableSymbol localVariable) { - return null; + var parent = this.context.SemanticModel.Binder.GetParent(localVariable.DeclaringLocalVariable); + return parent switch + { + ForSyntax @for => @for.Expression, + _ => throw new NotImplementedException($"Local variable has an unexpected parent of type '{parent?.GetType().Name}") + }; + } + + var inaccessibleLocals = this.context.DataFlowAnalyzer.GetInaccessibleLocalsAfterSyntaxMove(nameSyntax, newContext); + switch(inaccessibleLocals.Count) + { + case 0: + // moving the name expression does not produce any inaccessible locals + // we don't need to append replacements regardless if there is an index expression or not + return this; + + case 1 when indexExpression != null: + // TODO: Run dataflow analysis on the array expression as well. (Will be needed for nested resource loops) + LocalVariableSymbol local = inaccessibleLocals.Single(); + var replacementValue = ExpressionConverter.AppendProperties(this.ToFunctionExpression(GetArrayExpression(local)), this.ConvertExpression(indexExpression)); + return this.AppendReplacement(local, replacementValue); + + default: + throw new NotImplementedException("Mismatch between count of index expressions and inaccessible symbols during array access index replacement."); } + } - // is a variable which points to a module symbol? - if (childPropertyAccess.BaseExpression is not VariableAccessSyntax grandChildVariableAccess || context.SemanticModel.GetSymbolInfo(grandChildVariableAccess) is not ModuleSymbol moduleSymbol) + private LanguageExpression ConvertArrayAccess(ArrayAccessSyntax arrayAccess) + { + // if there is an array access on a resource/module reference, we have to generate differently + // when constructing the reference() function call, the resource name expression needs to have its local + // variable replaced with [this array access' index expression] + if (arrayAccess.BaseExpression is VariableAccessSyntax variableAccess) { + switch (this.context.SemanticModel.GetSymbolInfo(variableAccess)) + { + case ResourceSymbol {IsCollection: true} resourceSymbol: + var resourceConverter = this.CreateConverterForIndexReplacement(ExpressionConverter.GetResourceNameSyntax(resourceSymbol), arrayAccess.IndexExpression, arrayAccess); + + // TODO: Can this return a language expression? + return resourceConverter.ToFunctionExpression(arrayAccess.BaseExpression); + + case ModuleSymbol { IsCollection: true } moduleSymbol: + var moduleConverter = this.CreateConverterForIndexReplacement(ExpressionConverter.GetModuleNameSyntax(moduleSymbol), arrayAccess.IndexExpression, arrayAccess); + + // TODO: Can this return a language expression? + return moduleConverter.ToFunctionExpression(arrayAccess.BaseExpression); + } + } + + return AppendProperties( + ToFunctionExpression(arrayAccess.BaseExpression), + ConvertExpression(arrayAccess.IndexExpression)); + } + + private LanguageExpression ConvertPropertyAccess(PropertyAccessSyntax propertyAccess) + { + // local function + LanguageExpression? ConvertResourcePropertyAccess(ResourceSymbol resourceSymbol, SyntaxBase? indexExpression) + { + var typeReference = EmitHelpers.GetTypeReference(resourceSymbol); + + // special cases for certain resource property access. if we recurse normally, we'll end up + // generating statements like reference(resourceId(...)).id which are not accepted by ARM + + switch (propertyAccess.PropertyName.IdentifierName) + { + case "id": + // the ID is dependent on the name expression which could involve locals in case of a resource collection + return this + .CreateConverterForIndexReplacement(GetResourceNameSyntax(resourceSymbol), indexExpression, propertyAccess) + .GetFullyQualifiedResourceId(resourceSymbol); + case "name": + // the name is dependent on the name expression which could involve locals in case of a resource collection + return this + .CreateConverterForIndexReplacement(GetResourceNameSyntax(resourceSymbol), indexExpression, propertyAccess) + .GetResourceNameExpression(resourceSymbol); + case "type": + return new JTokenExpression(typeReference.FullyQualifiedType); + case "apiVersion": + return new JTokenExpression(typeReference.ApiVersion); + case "properties": + // use the reference() overload without "full" to generate a shorter expression + // this is dependent on the name expression which could involve locals in case of a resource collection + return this + .CreateConverterForIndexReplacement(GetResourceNameSyntax(resourceSymbol), indexExpression, propertyAccess) + .GetReferenceExpression(resourceSymbol, typeReference, false); + } + return null; } - return (moduleSymbol, propertyAccess.PropertyName.IdentifierName); + if (propertyAccess.BaseExpression is VariableAccessSyntax propVariableAccess && + context.SemanticModel.GetSymbolInfo(propVariableAccess) is ResourceSymbol resourceSymbol && + ConvertResourcePropertyAccess(resourceSymbol, indexExpression: null) is { } convertedSingle) + { + // we are doing property access on a single resource + // and we are dealing with special case properties + return convertedSingle; + } + + if(propertyAccess.BaseExpression is ArrayAccessSyntax propArrayAccess && + propArrayAccess.BaseExpression is VariableAccessSyntax arrayVariableAccess && + context.SemanticModel.GetSymbolInfo(arrayVariableAccess) is ResourceSymbol resourceCollectionSymbol && + ConvertResourcePropertyAccess(resourceCollectionSymbol, propArrayAccess.IndexExpression) is { } convertedCollection) + { + + // we are doing property access on an array access of a resource collection + // and we are dealing with special case properties + return convertedCollection; + } + + // is this a (.outputs). propertyAccess? + if (propertyAccess.BaseExpression is PropertyAccessSyntax childPropertyAccess && childPropertyAccess.PropertyName.IdentifierName == LanguageConstants.ModuleOutputsPropertyName) + { + // is a variable which points to a non-collection module symbol? + if (childPropertyAccess.BaseExpression is VariableAccessSyntax grandChildVariableAccess && + context.SemanticModel.GetSymbolInfo(grandChildVariableAccess) is ModuleSymbol { IsCollection: false } moduleSymbol) + { + return AppendProperties( + this.GetModuleOutputsReferenceExpression(moduleSymbol), + new JTokenExpression(propertyAccess.PropertyName.IdentifierName), + new JTokenExpression("value")); + } + + // is an array access operating on a module collection + if (childPropertyAccess.BaseExpression is ArrayAccessSyntax grandChildArrayAccess && + grandChildArrayAccess.BaseExpression is VariableAccessSyntax grandGrandChildVariableAccess && + context.SemanticModel.GetSymbolInfo(grandGrandChildVariableAccess) is ModuleSymbol { IsCollection: true } moduleCollectionSymbol) + { + var updatedConverter = this.CreateConverterForIndexReplacement(GetModuleNameSyntax(moduleCollectionSymbol), grandChildArrayAccess.IndexExpression, propertyAccess); + return AppendProperties( + updatedConverter.GetModuleOutputsReferenceExpression(moduleCollectionSymbol), + new JTokenExpression(propertyAccess.PropertyName.IdentifierName), + new JTokenExpression("value")); + } + } + + return AppendProperties( + ToFunctionExpression(propertyAccess.BaseExpression), + new JTokenExpression(propertyAccess.PropertyName.IdentifierName)); } private LanguageExpression GetResourceNameExpression(ResourceSymbol resourceSymbol) + { + SyntaxBase nameValueSyntax = GetResourceNameSyntax(resourceSymbol); + return this.ConvertExpression(nameValueSyntax); + } + + public static SyntaxBase GetResourceNameSyntax(ResourceSymbol resourceSymbol) { // this condition should have already been validated by the type checker - var nameValueSyntax = resourceSymbol.SafeGetBodyPropertyValue(LanguageConstants.ResourceNamePropertyName) ?? throw new ArgumentException($"Expected resource syntax body to contain property 'name'"); - return ConvertExpression(nameValueSyntax); + return resourceSymbol.SafeGetBodyPropertyValue(LanguageConstants.ResourceNamePropertyName) ?? throw new ArgumentException($"Expected resource syntax body to contain property 'name'"); } private LanguageExpression GetModuleNameExpression(ModuleSymbol moduleSymbol) { - // this condition should have already been validated by the type checker - var nameValueSyntax = moduleSymbol.SafeGetBodyPropertyValue(LanguageConstants.ResourceNamePropertyName) ?? throw new ArgumentException($"Expected module syntax body to contain property 'name'"); + SyntaxBase nameValueSyntax = GetModuleNameSyntax(moduleSymbol); return ConvertExpression(nameValueSyntax); } + public static SyntaxBase GetModuleNameSyntax(ModuleSymbol moduleSymbol) + { + // this condition should have already been validated by the type checker + return moduleSymbol.SafeGetBodyPropertyValue(LanguageConstants.ResourceNamePropertyName) ?? throw new ArgumentException($"Expected module syntax body to contain property 'name'"); + } + public IEnumerable GetResourceNameSegments(ResourceSymbol resourceSymbol, ResourceTypeReference typeReference) { if (typeReference.Types.Length == 1) @@ -215,8 +331,8 @@ public LanguageExpression GetFullyQualifiedResourceId(ModuleSymbol moduleSymbol) GetModuleNameExpression(moduleSymbol).AsEnumerable()); } - public FunctionExpression GetModuleOutputsReferenceExpression(ModuleSymbol moduleSymbol) - => AppendProperties( + public FunctionExpression GetModuleOutputsReferenceExpression(ModuleSymbol moduleSymbol) => + AppendProperties( CreateFunction( "reference", GetFullyQualifiedResourceId(moduleSymbol), @@ -249,6 +365,45 @@ public FunctionExpression GetReferenceExpression(ResourceSymbol resourceSymbol, GetFullyQualifiedResourceId(resourceSymbol)); } + private LanguageExpression GetLocalVariableExpression(LocalVariableSymbol localVariableSymbol) + { + var parent = this.context.SemanticModel.Binder.GetParent(localVariableSymbol.DeclaringLocalVariable); + + switch (parent) + { + case ForSyntax @for when ReferenceEquals(@for.ItemVariable, localVariableSymbol.DeclaringLocalVariable): + // this is the "item" variable of a for-expression + // to emit this we need to basically index the array expression by the copyIndex() function + + if(this.localReplacements.TryGetValue(localVariableSymbol, out var replacement)) + { + // the current context has specified an expression to be used for this local variable symbol + // to override the regular conversion to copyIndex() + return replacement; + } + + var arrayExpression = ToFunctionExpression(@for.Expression); + + var copyIndexName = this.context.SemanticModel.Binder.GetParent(@for) switch + { + // copyIndex without name resolves to module/resource loop index in the runtime + ResourceDeclarationSyntax => null, + ModuleDeclarationSyntax => null, + + ObjectPropertySyntax property when property.TryGetKeyText() is { } key && ReferenceEquals(property.Value, @for) => key, + + _ => throw new NotImplementedException("Unexpected for-expression grandparent.") + }; + + var copyIndexFunction = copyIndexName == null ? CreateFunction("copyIndex") : CreateFunction("copyIndex", new JTokenExpression(copyIndexName)); + + return AppendProperties(arrayExpression, copyIndexFunction); + + default: + throw new NotImplementedException($"Encountered a local variable with parent of unexpected type '{parent?.GetType().Name}'."); + } + } + private LanguageExpression ConvertVariableAccess(VariableAccessSyntax variableAccessSyntax) { string name = variableAccessSyntax.Name.IdentifierName; @@ -276,6 +431,9 @@ private LanguageExpression ConvertVariableAccess(VariableAccessSyntax variableAc case ModuleSymbol moduleSymbol: return GetModuleOutputsReferenceExpression(moduleSymbol); + case LocalVariableSymbol localVariableSymbol: + return GetLocalVariableExpression(localVariableSymbol); + default: throw new NotImplementedException($"Encountered an unexpected symbol kind '{symbol?.Kind}' when generating a variable access expression."); } @@ -532,10 +690,10 @@ private static FunctionExpression CreateFunction(string name, params LanguageExp private static FunctionExpression CreateFunction(string name, IEnumerable parameters) => new(name, parameters.ToArray(), Array.Empty()); - private static FunctionExpression AppendProperties(FunctionExpression function, params LanguageExpression[] properties) + public static FunctionExpression AppendProperties(FunctionExpression function, params LanguageExpression[] properties) => AppendProperties(function, properties as IEnumerable); - private static FunctionExpression AppendProperties(FunctionExpression function, IEnumerable properties) + public static FunctionExpression AppendProperties(FunctionExpression function, IEnumerable properties) => new(function.Function, function.Parameters, function.Properties.Concat(properties).ToArray()); protected static void Assert(bool predicate, string message) diff --git a/src/Bicep.Core/Emit/ExpressionEmitter.cs b/src/Bicep.Core/Emit/ExpressionEmitter.cs index 32c1ba62e0d..62a6da3c373 100644 --- a/src/Bicep.Core/Emit/ExpressionEmitter.cs +++ b/src/Bicep.Core/Emit/ExpressionEmitter.cs @@ -6,10 +6,8 @@ using Azure.Deployments.Expression.Configuration; using Azure.Deployments.Expression.Expressions; using Azure.Deployments.Expression.Serializers; -using Bicep.Core.Resources; using Bicep.Core.Semantics; using Bicep.Core.Syntax; -using Bicep.Core.TypeSystem; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -99,17 +97,21 @@ public void EmitUnqualifiedResourceId(ResourceSymbol resourceSymbol) writer.WriteValue(serialized); } - public void EmitResourceIdReference(ResourceSymbol resourceSymbol) + public void EmitResourceIdReference(ResourceSymbol resourceSymbol, SyntaxBase? indexExpression, SyntaxBase newContext) { - var resourceIdExpression = converter.GetFullyQualifiedResourceId(resourceSymbol); + var converterForContext = this.converter.CreateConverterForIndexReplacement(ExpressionConverter.GetResourceNameSyntax(resourceSymbol), indexExpression, newContext); + + var resourceIdExpression = converterForContext.GetFullyQualifiedResourceId(resourceSymbol); var serialized = ExpressionSerializer.SerializeExpression(resourceIdExpression); writer.WriteValue(serialized); } - public void EmitResourceIdReference(ModuleSymbol moduleSymbol) + public void EmitResourceIdReference(ModuleSymbol moduleSymbol, SyntaxBase? indexExpression, SyntaxBase newContext) { - var resourceIdExpression = converter.GetFullyQualifiedResourceId(moduleSymbol); + var converterForContext = this.converter.CreateConverterForIndexReplacement(ExpressionConverter.GetModuleNameSyntax(moduleSymbol), indexExpression, newContext); + + var resourceIdExpression = converterForContext.GetFullyQualifiedResourceId(moduleSymbol); var serialized = ExpressionSerializer.SerializeExpression(resourceIdExpression); writer.WriteValue(serialized); @@ -162,10 +164,91 @@ symbol is FunctionSymbol functionSymbol && writer.WriteValue(serialized); } + public void EmitCopyObject(string name, ForSyntax syntax, SyntaxBase? input, string? copyIndexOverride = null) + { + writer.WriteStartObject(); + + this.EmitProperty("name", name); + // construct the length ARM expression from the Bicep array expression + // type check has already ensured that the array expression is an array + this.EmitPropertyWithTransform( + "count", + syntax.Expression, + arrayExpression => new FunctionExpression("length", new[] { arrayExpression }, Array.Empty())); + + if (input != null) + { + if (copyIndexOverride == null) + { + this.EmitProperty("input", input); + } + else + { + this.EmitPropertyWithTransform("input", input, expression => + { + // the named copy index in the serialized expression is incorrect + // because the object syntax here does not match the JSON equivalent due to the presence of { "value": ... } wrappers + // for now, we will manually replace the copy index in the converted expression + // this approach will not work for nested property loops + var visitor = new LanguageExpressionVisitor + { + OnFunctionExpression = function => + { + if (string.Equals(function.Function, "copyIndex") && + function.Parameters.Length == 1 && + function.Parameters[0] is JTokenExpression) + { + // it's an invocation of the copyIndex function with 1 argument with a literal value + // replace the argument with the correct value + function.Parameters = new LanguageExpression[] {new JTokenExpression("value")}; + } + } + }; + + // mutate the expression + expression.Accept(visitor); + + return expression; + }); + } + } + + writer.WriteEndObject(); + } + public void EmitObjectProperties(ObjectSyntax objectSyntax, ISet? propertiesToOmit = null) { - foreach (ObjectPropertySyntax propertySyntax in objectSyntax.Properties) + var propertyLookup = objectSyntax.Properties.ToLookup(property => property.Value is ForSyntax); + + // emit loop properties first (if any) + if (propertyLookup.Contains(true)) + { + // we have properties whose value is a for-expression + this.EmitProperty("copy", () => + { + this.writer.WriteStartArray(); + + foreach (var property in propertyLookup[true]) + { + var key = property.TryGetKeyText(); + if (key is null || property.Value is not ForSyntax @for) + { + // should be caught by loop emit limitation checks + throw new InvalidOperationException("Encountered a property with an expression-based key whose value is a for-expression."); + } + + this.EmitCopyObject(key, @for, @for.Body); + } + + this.writer.WriteEndArray(); + }); + } + + // emit non-loop properties + foreach (ObjectPropertySyntax propertySyntax in propertyLookup[false]) { + // property whose value is not a for-expression + if (propertySyntax.TryGetKeyText() is string keyName) { if (propertiesToOmit?.Contains(keyName) == true) @@ -189,6 +272,16 @@ public void EmitProperty(string name, LanguageExpression expressionValue) writer.WriteValue(propertyValue); }); + public void EmitPropertyWithTransform(string name, SyntaxBase value, Func convertedValueTransform) + => EmitPropertyInternal(new JTokenExpression(name), () => + { + var converted = converter.ConvertExpression(value); + var transformed = convertedValueTransform(converted); + var serialized = ExpressionSerializer.SerializeExpression(transformed); + + this.writer.WriteValue(serialized); + }); + public void EmitProperty(string name, Action valueFunc) => EmitPropertyInternal(new JTokenExpression(name), valueFunc); diff --git a/src/Bicep.Core/Emit/ForSyntaxValidatorVisitor.cs b/src/Bicep.Core/Emit/ForSyntaxValidatorVisitor.cs new file mode 100644 index 00000000000..5efa47baa8a --- /dev/null +++ b/src/Bicep.Core/Emit/ForSyntaxValidatorVisitor.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Diagnostics; +using Bicep.Core.Diagnostics; +using Bicep.Core.Semantics; +using Bicep.Core.Syntax; + +namespace Bicep.Core.Emit +{ + public sealed class ForSyntaxValidatorVisitor : SyntaxVisitor + { + private readonly IDiagnosticWriter diagnosticWriter; + + private readonly SemanticModel semanticModel; + + private readonly Stack loopParents; + + // points to the top level dependsOn property in the resource/module declaration currently being processed + private ObjectPropertySyntax? currentDependsOnProperty = null; + + private bool insideTopLevelDependsOn = false; + + private ForSyntaxValidatorVisitor(SemanticModel semanticModel, IDiagnosticWriter diagnosticWriter) + { + this.semanticModel = semanticModel; + this.diagnosticWriter = diagnosticWriter; + + this.loopParents = new Stack(); + } + + public static void Validate(SemanticModel semanticModel, IDiagnosticWriter diagnosticWriter) + { + var visitor = new ForSyntaxValidatorVisitor(semanticModel, diagnosticWriter); + + // visiting writes diagnostics in some cases + visitor.Visit(semanticModel.SyntaxTree.ProgramSyntax); + } + + public override void VisitObjectPropertySyntax(ObjectPropertySyntax syntax) + { + if (syntax.TryGetKeyText() == null && syntax.Value is ForSyntax) + { + // block loop usage with properties whose names are expressions + this.diagnosticWriter.Write(DiagnosticBuilder.ForPosition(syntax.Key).ExpressionedPropertiesNotAllowedWithLoops()); + } + + bool insideDependsOnInThisScope = ReferenceEquals(this.currentDependsOnProperty, syntax); + + // set this to true if the current property is the top-level dependsOn property + // leave it true if already set to true + this.insideTopLevelDependsOn = this.insideTopLevelDependsOn || insideDependsOnInThisScope; + + // visit children + base.VisitObjectPropertySyntax(syntax); + + // clear the flag after we leave the dependsOn property + if(insideDependsOnInThisScope) + { + this.insideTopLevelDependsOn = false; + } + } + + public override void VisitForSyntax(ForSyntax syntax) + { + var item = CreateValidationItem(syntax); + + if (!item.IsValidParent) + { + // this loop was used incorrectly + this.diagnosticWriter.Write(DiagnosticBuilder.ForPosition(syntax.ForKeyword).ForExpressionsNotSupportedHere()); + } + else if (item.PropertyLoopCount > 1) + { + // too many property loops + this.diagnosticWriter.Write(DiagnosticBuilder.ForPosition(syntax.ForKeyword).TooManyPropertyForExpressions()); + } + + // push the parent to the stack + this.loopParents.Push(item); + + // visit children + base.VisitForSyntax(syntax); + + // pop the parent + var lastPopped = this.loopParents.Pop(); + Debug.Assert(ReferenceEquals(lastPopped, item), "ReferenceEquals(lastPopped, item)"); + } + + public override void VisitVariableAccessSyntax(VariableAccessSyntax syntax) + { + var symbol = this.semanticModel.GetSymbolInfo(syntax); + if (symbol is ResourceSymbol { IsCollection: true } || symbol is ModuleSymbol { IsCollection: true }) + { + // we are inside a dependsOn property and the referenced symbol is a resource/module collection + var parent = this.semanticModel.Binder.GetParent(syntax); + if (!this.insideTopLevelDependsOn && parent is not ArrayAccessSyntax) + { + // the parent is not array access, which means that someone is doing a direct reference to the collection + // which is not allowed outside of the dependsOn properties + this.diagnosticWriter.Write(DiagnosticBuilder.ForPosition(syntax).DirectAccessToCollectionNotSupported()); + } + } + + // visit children + base.VisitVariableAccessSyntax(syntax); + } + + public override void VisitResourceDeclarationSyntax(ResourceDeclarationSyntax syntax) + { + // stash the body (handles loops and conditions as well) + this.currentDependsOnProperty = TryGetDependsOnProperty(syntax.TryGetBody()); + + // visit children + base.VisitResourceDeclarationSyntax(syntax); + + // clear the stash + this.currentDependsOnProperty = null; + } + + public override void VisitModuleDeclarationSyntax(ModuleDeclarationSyntax syntax) + { + // stash the body (handles loops and conditions as well) + this.currentDependsOnProperty = TryGetDependsOnProperty(syntax.TryGetBody()); + + // visit children + base.VisitModuleDeclarationSyntax(syntax); + + // clear the stash + this.currentDependsOnProperty = null; + } + + private LoopValidationItem CreateValidationItem(ForSyntax syntax) + { + var (lastParentValid, lastPropertyLoopCount) = this.loopParents.TryPeek(out var lastStatus) + ? (lastStatus.IsValidParent, lastStatus.PropertyLoopCount) + : (true, 0); + + var parent = this.semanticModel.SyntaxTree.Hierarchy.GetParent(syntax); + + // keep the cases in sync with the error message in the default case + switch (parent) + { + // loops are allowed in top-level module/resource values + case ResourceDeclarationSyntax resource when ReferenceEquals(resource.Value, syntax): + case ModuleDeclarationSyntax module when ReferenceEquals(module.Value, syntax): + return new LoopValidationItem(parent, lastParentValid, lastPropertyLoopCount); + + // loops are generally allowed in property values + case ObjectPropertySyntax property when ReferenceEquals(property.Value, syntax): + return new LoopValidationItem(parent, lastParentValid, lastPropertyLoopCount + 1); + + default: + return new LoopValidationItem(parent, false, lastPropertyLoopCount); + } + } + + private static ObjectPropertySyntax? TryGetDependsOnProperty(ObjectSyntax? body) => body?.SafeGetPropertyByName("dependsOn"); + + private class LoopValidationItem + { + public LoopValidationItem(SyntaxBase? parent, bool isValidParent, int propertyLoopCount) + { + this.Parent = parent; + this.IsValidParent = isValidParent; + this.PropertyLoopCount = propertyLoopCount; + } + + public SyntaxBase? Parent { get; } + + public bool IsValidParent { get; } + + public int PropertyLoopCount { get; } + } + } +} diff --git a/src/Bicep.Core/Emit/ResourceDependency.cs b/src/Bicep.Core/Emit/ResourceDependency.cs new file mode 100644 index 00000000000..025f6cd901a --- /dev/null +++ b/src/Bicep.Core/Emit/ResourceDependency.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using Bicep.Core.Semantics; +using Bicep.Core.Syntax; + +namespace Bicep.Core.Emit +{ + public class ResourceDependency + { + public ResourceDependency(DeclaredSymbol resource, SyntaxBase? indexExpression) + { + this.Resource = resource; + this.IndexExpression = indexExpression; + } + + public DeclaredSymbol Resource { get; } + + /// + /// The optional index expression to address a single Target resource when the Target represents a collection of resources. + /// + public SyntaxBase? IndexExpression { get; } + + public override bool Equals(object obj) + { + if (obj is not ResourceDependency other) + { + return false; + } + + return ReferenceEquals(this.Resource, other.Resource) && ReferenceEquals(this.IndexExpression, other.IndexExpression); + } + + public override int GetHashCode() => HashCode.Combine(this.Resource, this.IndexExpression); + } +} diff --git a/src/Bicep.Core/Emit/ResourceDependencyVisitor.cs b/src/Bicep.Core/Emit/ResourceDependencyVisitor.cs index 76b4f98395e..7464efcc320 100644 --- a/src/Bicep.Core/Emit/ResourceDependencyVisitor.cs +++ b/src/Bicep.Core/Emit/ResourceDependencyVisitor.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; +using Bicep.Core.Extensions; using Bicep.Core.Semantics; using Bicep.Core.Syntax; @@ -11,33 +13,37 @@ namespace Bicep.Core.Emit public class ResourceDependencyVisitor : SyntaxVisitor { private readonly SemanticModel model; - private IDictionary> resourceDependencies; + private readonly IDictionary> resourceDependencies; private DeclaredSymbol? currentDeclaration; - public static ImmutableDictionary> GetResourceDependencies(SemanticModel model) + public static ImmutableDictionary> GetResourceDependencies(SemanticModel model) { var visitor = new ResourceDependencyVisitor(model); visitor.Visit(model.Root.Syntax); - var output = new Dictionary>(); + var output = new Dictionary>(); foreach (var kvp in visitor.resourceDependencies) { - if (kvp.Key is ResourceSymbol resourceSymbol) + if (kvp.Key is ResourceSymbol || kvp.Key is ModuleSymbol) { - output[resourceSymbol] = kvp.Value.ToImmutableHashSet(); - } - if (kvp.Key is ModuleSymbol moduleSymbol) - { - output[moduleSymbol] = kvp.Value.ToImmutableHashSet(); + output[kvp.Key] = OptimizeDependencies(kvp.Value); } } return output.ToImmutableDictionary(); } + private static ImmutableHashSet OptimizeDependencies(HashSet dependencies) => + dependencies + .GroupBy(dep => dep.Resource) + .SelectMany(group => @group.FirstOrDefault(dep => dep.IndexExpression == null) is { } dependencyWithoutIndex + ? dependencyWithoutIndex.AsEnumerable() + : @group) + .ToImmutableHashSet(); + private ResourceDependencyVisitor(SemanticModel model) { this.model = model; - this.resourceDependencies = new Dictionary>(); + this.resourceDependencies = new Dictionary>(); this.currentDeclaration = null; } @@ -52,7 +58,7 @@ public override void VisitResourceDeclarationSyntax(ResourceDeclarationSyntax sy var prevDeclaration = this.currentDeclaration; this.currentDeclaration = resourceSymbol; - this.resourceDependencies[resourceSymbol] = new HashSet(); + this.resourceDependencies[resourceSymbol] = new HashSet(); base.VisitResourceDeclarationSyntax(syntax); // restore previous declaration @@ -70,7 +76,7 @@ public override void VisitModuleDeclarationSyntax(ModuleDeclarationSyntax syntax var prevDeclaration = this.currentDeclaration; this.currentDeclaration = moduleSymbol; - this.resourceDependencies[moduleSymbol] = new HashSet(); + this.resourceDependencies[moduleSymbol] = new HashSet(); base.VisitModuleDeclarationSyntax(syntax); // restore previous declaration @@ -88,7 +94,7 @@ public override void VisitVariableDeclarationSyntax(VariableDeclarationSyntax sy var prevDeclaration = this.currentDeclaration; this.currentDeclaration = variableSymbol; - this.resourceDependencies[variableSymbol] = new HashSet(); + this.resourceDependencies[variableSymbol] = new HashSet(); base.VisitVariableDeclarationSyntax(syntax); // restore previous declaration @@ -103,6 +109,12 @@ public override void VisitVariableAccessSyntax(VariableAccessSyntax syntax) private void VisitVariableAccessSyntaxInternal(VariableAccessSyntax syntax) { + // local function + SyntaxBase? GetIndexExpression(bool isCollection) => + isCollection && this.model.Binder.GetParent(syntax) is ArrayAccessSyntax arrayAccess && ReferenceEquals(arrayAccess.BaseExpression, syntax) + ? arrayAccess.IndexExpression + : null; + if (currentDeclaration == null) { return; @@ -123,12 +135,15 @@ private void VisitVariableAccessSyntaxInternal(VariableAccessSyntax syntax) { resourceDependencies[currentDeclaration].Add(dependency); } + return; + case ResourceSymbol resourceSymbol: - resourceDependencies[currentDeclaration].Add(resourceSymbol); + resourceDependencies[currentDeclaration].Add(new ResourceDependency(resourceSymbol, GetIndexExpression(resourceSymbol.IsCollection))); return; + case ModuleSymbol moduleSymbol: - resourceDependencies[currentDeclaration].Add(moduleSymbol); + resourceDependencies[currentDeclaration].Add(new ResourceDependency(moduleSymbol, GetIndexExpression(moduleSymbol.IsCollection))); return; } } diff --git a/src/Bicep.Core/Emit/ScopeHelper.cs b/src/Bicep.Core/Emit/ScopeHelper.cs index 1a60963bb57..c4e18d6938f 100644 --- a/src/Bicep.Core/Emit/ScopeHelper.cs +++ b/src/Bicep.Core/Emit/ScopeHelper.cs @@ -46,7 +46,15 @@ public class ScopeData return null; } - var scopeSymbol = semanticModel.GetSymbolInfo(scopeProperty.Value); + var scopeSymbol = scopeProperty.Value switch + { + // scope indexing can only happen with references to module or resource collections + ArrayAccessSyntax { BaseExpression: VariableAccessSyntax baseVariableAccess } => semanticModel.GetSymbolInfo(baseVariableAccess), + + // all other scope expressions + _ => semanticModel.GetSymbolInfo(scopeProperty.Value) + }; + var scopeType = semanticModel.GetTypeInfo(scopeProperty.Value); switch (scopeType) @@ -336,11 +344,20 @@ public static ImmutableDictionary GetResoureScopeInfo void logInvalidScopeDiagnostic(IPositionable positionable, ResourceScope suppliedScope, ResourceScope supportedScopes) => diagnosticWriter.Write(positionable, x => x.UnsupportedResourceScope(suppliedScope, supportedScopes)); + // local function + ResourceType? GetResourceType(ResourceSymbol resourceSymbol) => resourceSymbol.Type switch + { + ResourceType resourceType => resourceType, + ArrayType { Item: ResourceType resourceType } => resourceType, + _ => null + }; + var scopeInfo = new Dictionary(); foreach (var resourceSymbol in semanticModel.Root.ResourceDeclarations) { - if (resourceSymbol.Type is not ResourceType resourceType) + var resourceType = GetResourceType(resourceSymbol); + if (resourceType is null) { // missing type should be caught during type validation continue; @@ -422,21 +439,30 @@ ResourceScope.ResourceGroup when scopeData.ResourceGroupProperty is not null public static ImmutableDictionary GetModuleScopeInfo(SemanticModel semanticModel, IDiagnosticWriter diagnosticWriter) { - void logInvalidScopeDiagnostic(IPositionable positionable, ResourceScope suppliedScope, ResourceScope supportedScopes) + void LogInvalidScopeDiagnostic(IPositionable positionable, ResourceScope suppliedScope, ResourceScope supportedScopes) => diagnosticWriter.Write(positionable, x => x.UnsupportedModuleScope(suppliedScope, supportedScopes)); + // local function + ModuleType? GetModuleType(ModuleSymbol symbol) => symbol.Type switch + { + ModuleType moduleType => moduleType, + ArrayType {Item: ModuleType moduleType} => moduleType, + _ => null + }; + var scopeInfo = new Dictionary(); foreach (var moduleSymbol in semanticModel.Root.ModuleDeclarations) { - if (moduleSymbol.Type is not ModuleType moduleType) + var moduleType = GetModuleType(moduleSymbol); + if (moduleType is null) { // missing type should be caught during type validation continue; } var scopeProperty = moduleSymbol.SafeGetBodyProperty(LanguageConstants.ResourceScopePropertyName); - var scopeData = ScopeHelper.ValidateScope(semanticModel, logInvalidScopeDiagnostic, moduleType.ValidParentScopes, moduleSymbol.DeclaringModule.Value, scopeProperty); + var scopeData = ScopeHelper.ValidateScope(semanticModel, LogInvalidScopeDiagnostic, moduleType.ValidParentScopes, moduleSymbol.DeclaringModule.Value, scopeProperty); if (scopeData is null) { diff --git a/src/Bicep.Core/Emit/TemplateWriter.cs b/src/Bicep.Core/Emit/TemplateWriter.cs index ca3cdd98227..1053f0b68d0 100644 --- a/src/Bicep.Core/Emit/TemplateWriter.cs +++ b/src/Bicep.Core/Emit/TemplateWriter.cs @@ -33,12 +33,12 @@ public class TemplateWriter "metadata" }.ToImmutableArray(); - private static ImmutableHashSet ResourcePropertiesToOmit = new[] { + private static readonly ImmutableHashSet ResourcePropertiesToOmit = new [] { LanguageConstants.ResourceScopePropertyName, LanguageConstants.ResourceDependsOnPropertyName, }.ToImmutableHashSet(); - private static ImmutableHashSet ModulePropertiesToOmit = new[] { + private static readonly ImmutableHashSet ModulePropertiesToOmit = new [] { LanguageConstants.ModuleParamsPropertyName, LanguageConstants.ResourceScopePropertyName, LanguageConstants.ResourceDependsOnPropertyName, @@ -279,7 +279,6 @@ private void EmitVariablesIfPresent(JsonTextWriter memoryWriter, ExpressionEmitt private void EmitVariable(VariableSymbol variableSymbol, ExpressionEmitter emitter) { - // TODO: When we have expressions, only expressions without runtime functions can be emitted this way. Everything else will need to be inlined. emitter.EmitExpression(variableSymbol.Value); } @@ -311,11 +310,18 @@ private void EmitResource(JsonTextWriter memoryWriter, ResourceSymbol resourceSy memoryWriter.WriteStartObject(); var typeReference = EmitHelpers.GetTypeReference(resourceSymbol); - var body = resourceSymbol.DeclaringResource.Value; - if (body is IfConditionSyntax ifCondition) + SyntaxBase body = resourceSymbol.DeclaringResource.Value; + switch (body) { - body = ifCondition.Body; - emitter.EmitProperty("condition", ifCondition.ConditionExpression); + case IfConditionSyntax ifCondition: + body = ifCondition.Body; + emitter.EmitProperty("condition", ifCondition.ConditionExpression); + break; + + case ForSyntax @for: + body = @for.Body; + emitter.EmitProperty("copy", () => emitter.EmitCopyObject(resourceSymbol.Name, @for, input: null)); + break; } emitter.EmitProperty("type", typeReference.FullyQualifiedType); @@ -326,9 +332,7 @@ private void EmitResource(JsonTextWriter memoryWriter, ResourceSymbol resourceSy } emitter.EmitObjectProperties((ObjectSyntax)body, ResourcePropertiesToOmit); - // dependsOn is currently not allowed as a top-level resource property in bicep - // we will need to revisit this and probably merge the two if we decide to allow it - this.EmitDependsOn(memoryWriter, resourceSymbol, emitter); + this.EmitDependsOn(memoryWriter, resourceSymbol, emitter, body); memoryWriter.WriteEndObject(); } @@ -354,12 +358,28 @@ private void EmitModuleParameters(JsonTextWriter memoryWriter, ModuleSymbol modu throw new ArgumentException("Disallowed interpolation in module parameter"); } + // we can't just call EmitObjectProperties here because the ObjectSyntax is flatter than the structure we're generating + // because nested deployment parameters are objects with a single value property memoryWriter.WritePropertyName(keyName); + memoryWriter.WriteStartObject(); + if (propertySyntax.Value is ForSyntax @for) { - memoryWriter.WriteStartObject(); + // the value is a for-expression + // write a single property copy loop + emitter.EmitProperty("copy", () => + { + memoryWriter.WriteStartArray(); + emitter.EmitCopyObject("value", @for, @for.Body, "value"); + memoryWriter.WriteEndArray(); + }); + } + else + { + // the value is not a for-expression - can emit normally emitter.EmitProperty("value", propertySyntax.Value); - memoryWriter.WriteEndObject(); } + + memoryWriter.WriteEndObject(); } memoryWriter.WriteEndObject(); @@ -370,10 +390,17 @@ private void EmitModule(JsonTextWriter memoryWriter, ModuleSymbol moduleSymbol, memoryWriter.WriteStartObject(); var body = moduleSymbol.DeclaringModule.Value; - if (body is IfConditionSyntax ifCondition) + switch (body) { - body = ifCondition.Body; - emitter.EmitProperty("condition", ifCondition.ConditionExpression); + case IfConditionSyntax ifCondition: + body = ifCondition.Body; + emitter.EmitProperty("condition", ifCondition.ConditionExpression); + break; + + case ForSyntax @for: + body = @for.Body; + emitter.EmitProperty("copy", () => emitter.EmitCopyObject(moduleSymbol.Name, @for, input: null)); + break; } emitter.EmitProperty("type", NestedDeploymentResourceType); @@ -433,12 +460,12 @@ private void EmitModule(JsonTextWriter memoryWriter, ModuleSymbol moduleSymbol, memoryWriter.WriteEndObject(); } - this.EmitDependsOn(memoryWriter, moduleSymbol, emitter); + this.EmitDependsOn(memoryWriter, moduleSymbol, emitter, body); memoryWriter.WriteEndObject(); } - private void EmitDependsOn(JsonTextWriter memoryWriter, DeclaredSymbol declaredSymbol, ExpressionEmitter emitter) + private void EmitDependsOn(JsonTextWriter memoryWriter, DeclaredSymbol declaredSymbol, ExpressionEmitter emitter, SyntaxBase newContext) { var dependencies = context.ResourceDependencies[declaredSymbol]; if (!dependencies.Any()) @@ -449,21 +476,41 @@ private void EmitDependsOn(JsonTextWriter memoryWriter, DeclaredSymbol declaredS memoryWriter.WritePropertyName("dependsOn"); memoryWriter.WriteStartArray(); // need to put dependencies in a deterministic order to generate a deterministic template - foreach (var dependency in dependencies.OrderBy(x => x.Name)) + foreach (var dependency in dependencies.OrderBy(x => x.Resource.Name)) { - switch (dependency) + switch (dependency.Resource) { case ResourceSymbol resourceDependency: + if (resourceDependency.IsCollection && dependency.IndexExpression == null) + { + // dependency is on the entire resource collection + // write the name of the resource collection as the dependency + memoryWriter.WriteValue(resourceDependency.DeclaringResource.Name.IdentifierName); + + break; + } + if (!resourceDependency.DeclaringResource.IsExistingResource()) { - emitter.EmitResourceIdReference(resourceDependency); + emitter.EmitResourceIdReference(resourceDependency, dependency.IndexExpression, newContext); } + break; case ModuleSymbol moduleDependency: - emitter.EmitResourceIdReference(moduleDependency); + if (moduleDependency.IsCollection && dependency.IndexExpression == null) + { + // dependency is on the entire module collection + // write the name of the module collection as the dependency + memoryWriter.WriteValue(moduleDependency.DeclaringModule.Name.IdentifierName); + + break; + } + + emitter.EmitResourceIdReference(moduleDependency, dependency.IndexExpression, newContext); + break; default: - throw new InvalidOperationException($"Found dependency '{dependency.Name}' of unexpected type {dependency.GetType()}"); + throw new InvalidOperationException($"Found dependency '{dependency.Resource.Name}' of unexpected type {dependency.GetType()}"); } } memoryWriter.WriteEndArray(); diff --git a/src/Bicep.Core/LanguageConstants.cs b/src/Bicep.Core/LanguageConstants.cs index 5c00bd14350..b7d7eea794c 100644 --- a/src/Bicep.Core/LanguageConstants.cs +++ b/src/Bicep.Core/LanguageConstants.cs @@ -79,7 +79,16 @@ public static class LanguageConstants public static readonly TypeSymbol Any = new AnyType(); public static readonly TypeSymbol ResourceRef = CreateResourceScopeReference(ResourceScope.Module | ResourceScope.Resource); - public static readonly TypeSymbol ResourceRefArray = new TypedArrayType(ResourceRef, TypeSymbolValidationFlags.Default); + + // type used for the item type in the dependsOn array type + public static readonly TypeSymbol ResourceOrResourceCollectionRefItem = UnionType.Create( + ResourceRef, + new TypedArrayType(CreateResourceScopeReference(ResourceScope.Module), TypeSymbolValidationFlags.Default), + new TypedArrayType(CreateResourceScopeReference(ResourceScope.Resource), TypeSymbolValidationFlags.Default)); + + // the type of the dependsOn property in module and resource bodies + public static readonly TypeSymbol ResourceOrResourceCollectionRefArray = new TypedArrayType(ResourceOrResourceCollectionRefItem, TypeSymbolValidationFlags.Default); + public static readonly TypeSymbol String = new PrimitiveType("string", TypeSymbolValidationFlags.Default); // LooseString should be regarded as equal to the 'string' type, but with different validation behavior public static readonly TypeSymbol LooseString = new PrimitiveType("string", TypeSymbolValidationFlags.AllowLooseStringAssignment); @@ -224,7 +233,7 @@ public static TypeSymbol CreateModuleType(IEnumerable paramsProper new TypeProperty(ResourceScopePropertyName, CreateResourceScopeReference(moduleScope), scopePropertyFlags), new TypeProperty(ModuleParamsPropertyName, paramsType, paramsRequiredFlag | TypePropertyFlags.WriteOnly), new TypeProperty(ModuleOutputsPropertyName, outputsType, TypePropertyFlags.ReadOnly), - new TypeProperty(ResourceDependsOnPropertyName, ResourceRefArray, TypePropertyFlags.WriteOnly), + new TypeProperty(ResourceDependsOnPropertyName, ResourceOrResourceCollectionRefArray, TypePropertyFlags.WriteOnly), }, null); diff --git a/src/Bicep.Core/Parsing/Parser.cs b/src/Bicep.Core/Parsing/Parser.cs index 80163201429..0c8b0707a33 100644 --- a/src/Bicep.Core/Parsing/Parser.cs +++ b/src/Bicep.Core/Parsing/Parser.cs @@ -314,7 +314,7 @@ private SyntaxBase ResourceDeclaration(IEnumerable leadingNodes) { TokenType.Identifier when current.Text == LanguageConstants.IfKeyword => this.IfCondition(), TokenType.LeftBrace => this.Object(), - TokenType.LeftSquare => this.ForExpression(), + TokenType.LeftSquare => this.ForExpression(requireObjectLiteral: true), _ => throw new ExpectedTokenException(current, b => b.ExpectBodyStartOrIfOrLoopStart()) }; }, @@ -343,7 +343,7 @@ private SyntaxBase ModuleDeclaration(IEnumerable leadingNodes) { TokenType.Identifier when current.Text == LanguageConstants.IfKeyword => this.IfCondition(), TokenType.LeftBrace => this.Object(), - TokenType.LeftSquare => this.ForExpression(), + TokenType.LeftSquare => this.ForExpression(requireObjectLiteral: true), _ => throw new ExpectedTokenException(current, b => b.ExpectBodyStartOrIfOrLoopStart()) }; }, @@ -515,7 +515,7 @@ private SyntaxBase PrimaryExpression(bool allowComplexLiterals) case TokenType.LeftSquare when allowComplexLiterals: return CheckKeyword(this.reader.PeekAhead(), LanguageConstants.ForKeyword) - ? this.ForExpression() + ? this.ForExpression(requireObjectLiteral: false) : this.Array(); case TokenType.LeftBrace: @@ -896,7 +896,7 @@ private SyntaxBase LiteralValue() } } - private SyntaxBase ForExpression() + private SyntaxBase ForExpression(bool requireObjectLiteral) { var openBracket = this.Expect(TokenType.LeftSquare, b => b.ExpectedCharacter("[")); var forKeyword = this.ExpectKeyword(LanguageConstants.ForKeyword); @@ -904,7 +904,10 @@ private SyntaxBase ForExpression() var inKeyword = this.WithRecovery(() => this.ExpectKeyword(LanguageConstants.InKeyword), GetSuppressionFlag(identifier.Name), TokenType.RightSquare, TokenType.NewLine); var expression = this.WithRecovery(() => this.Expression(allowComplexLiterals: true), GetSuppressionFlag(inKeyword), TokenType.Colon, TokenType.RightSquare, TokenType.NewLine); var colon = this.WithRecovery(() => this.Expect(TokenType.Colon, b => b.ExpectedCharacter(":")), GetSuppressionFlag(expression), TokenType.RightSquare, TokenType.NewLine); - var body = this.WithRecovery(() => this.Expression(allowComplexLiterals: true), GetSuppressionFlag(colon), TokenType.RightSquare, TokenType.NewLine); + var body = this.WithRecovery( + () => requireObjectLiteral ? this.Object() : this.Expression(allowComplexLiterals: true), + GetSuppressionFlag(colon), + TokenType.RightSquare, TokenType.NewLine); var closeBracket = this.WithRecovery(() => this.Expect(TokenType.RightSquare, b => b.ExpectedCharacter("]")), GetSuppressionFlag(body), TokenType.RightSquare, TokenType.NewLine); return new ForSyntax(openBracket, forKeyword, identifier, inKeyword, expression, colon, body, closeBracket); diff --git a/src/Bicep.Core/Semantics/DeclarationVisitor.cs b/src/Bicep.Core/Semantics/DeclarationVisitor.cs index a874c53b904..e769e24f6b7 100644 --- a/src/Bicep.Core/Semantics/DeclarationVisitor.cs +++ b/src/Bicep.Core/Semantics/DeclarationVisitor.cs @@ -85,7 +85,7 @@ public override void VisitForSyntax(ForSyntax syntax) var itemVariable = new LocalVariableSymbol(this.context, syntax.ItemVariable.Name.IdentifierName, syntax.ItemVariable); // create new scope without any descendants - var scope = new LocalScope(string.Empty, syntax, itemVariable.AsEnumerable(), ImmutableArray.Empty); + var scope = new LocalScope(string.Empty, syntax, syntax.Body, itemVariable.AsEnumerable(), ImmutableArray.Empty); this.PushScope(scope); diff --git a/src/Bicep.Core/Semantics/LocalScope.cs b/src/Bicep.Core/Semantics/LocalScope.cs index e8a1f24e277..200fcd7b154 100644 --- a/src/Bicep.Core/Semantics/LocalScope.cs +++ b/src/Bicep.Core/Semantics/LocalScope.cs @@ -13,15 +13,25 @@ namespace Bicep.Core.Semantics /// public class LocalScope : Symbol, ILanguageScope { - public LocalScope(string name, SyntaxBase enclosingSyntax, IEnumerable locals, IEnumerable childScopes) + public LocalScope(string name, SyntaxBase declaringSyntax, SyntaxBase bindingSyntax, IEnumerable locals, IEnumerable childScopes) : base(name) { - this.EnclosingSyntax = enclosingSyntax; + this.DeclaringSyntax = declaringSyntax; + this.BindingSyntax = bindingSyntax; this.Locals = locals.ToImmutableArray(); this.ChildScopes = childScopes.ToImmutableArray(); } - public SyntaxBase EnclosingSyntax { get; } + /// + /// The syntax node that declares the scope, but may not have effect on name binding. Most commonly this will be a ForSyntax object. + /// + public SyntaxBase DeclaringSyntax { get; } + + /// + /// The syntax node within which this scope will affect binding. This will typically be the Body of a ForSyntax node. + /// + /// Identifiers within this node will first bind to symbols in this scope. Identifiers above this node will bind to the parent scope. + public SyntaxBase BindingSyntax { get; } public ImmutableArray Locals { get; } @@ -33,16 +43,10 @@ public LocalScope(string name, SyntaxBase enclosingSyntax, IEnumerable Descendants => this.ChildScopes.Concat(this.Locals); - public LocalScope ReplaceChildren(IEnumerable newChildren) => new(this.Name, this.EnclosingSyntax, this.Locals, newChildren); + public LocalScope ReplaceChildren(IEnumerable newChildren) => new(this.Name, this.DeclaringSyntax, this.BindingSyntax, this.Locals, newChildren); public IEnumerable GetDeclarationsByName(string name) => this.Locals.Where(symbol => symbol.NameSyntax.IsValid && string.Equals(symbol.Name, name, LanguageConstants.IdentifierComparison)).ToList(); public IEnumerable AllDeclarations => this.Locals; - - public override IEnumerable GetDiagnostics() - { - // TODO: Remove when loops codegen is done. - yield return DiagnosticBuilder.ForPosition(((ForSyntax) this.EnclosingSyntax).ForKeyword).LoopsNotSupported(); - } } } \ No newline at end of file diff --git a/src/Bicep.Core/Semantics/LocalVariableSymbol.cs b/src/Bicep.Core/Semantics/LocalVariableSymbol.cs index a70c2f16ea4..007ccdb3c8b 100644 --- a/src/Bicep.Core/Semantics/LocalVariableSymbol.cs +++ b/src/Bicep.Core/Semantics/LocalVariableSymbol.cs @@ -14,6 +14,8 @@ public LocalVariableSymbol(ISymbolContext context, string name, LocalVariableSyn { } + public LocalVariableSyntax DeclaringLocalVariable => (LocalVariableSyntax) this.DeclaringSyntax; + public override void Accept(SymbolVisitor visitor) => visitor.VisitLocalVariableSymbol(this); public override SymbolKind Kind => SymbolKind.Local; diff --git a/src/Bicep.Core/Semantics/ModuleSymbol.cs b/src/Bicep.Core/Semantics/ModuleSymbol.cs index ac91e8161c4..ac7c6ff49cf 100644 --- a/src/Bicep.Core/Semantics/ModuleSymbol.cs +++ b/src/Bicep.Core/Semantics/ModuleSymbol.cs @@ -5,6 +5,7 @@ using Bicep.Core.Diagnostics; using System; using System.Diagnostics.CodeAnalysis; +using Bicep.Core.TypeSystem; namespace Bicep.Core.Semantics { @@ -46,5 +47,7 @@ public override IEnumerable Descendants yield return this.Type; } } + + public bool IsCollection => this.Context.TypeManager.GetTypeInfo(this.DeclaringModule) is ArrayType; } } \ No newline at end of file diff --git a/src/Bicep.Core/Semantics/NameBindingVisitor.cs b/src/Bicep.Core/Semantics/NameBindingVisitor.cs index 37ef39bd7a6..97fac87168c 100644 --- a/src/Bicep.Core/Semantics/NameBindingVisitor.cs +++ b/src/Bicep.Core/Semantics/NameBindingVisitor.cs @@ -197,21 +197,25 @@ public override void VisitInstanceFunctionCallSyntax(InstanceFunctionCallSyntax } } - public override void VisitForSyntax(ForSyntax syntax) + protected override void VisitInternal(SyntaxBase syntax) { + // any node can be a binding scope if (!this.allLocalScopes.TryGetValue(syntax, out var localScope)) { - // code defect in the declaration visitor - throw new InvalidOperationException($"Local scope is missing for {syntax.GetType().Name} at {syntax.Span}"); + // not a binding scope + // visit children normally + base.VisitInternal(syntax); + return; } + // we are in a binding scope // push it to the stack of active scopes // as a result this scope will be used to resolve symbols first // (then all the previous one and then finally the global scope) this.activeScopes.Push(localScope); // visit all the children - base.VisitForSyntax(syntax); + base.VisitInternal(syntax); // we are leaving the loop scope // pop the scope - no symbols will be resolved against it ever again @@ -219,6 +223,15 @@ public override void VisitForSyntax(ForSyntax syntax) Debug.Assert(ReferenceEquals(lastPopped, localScope), "ReferenceEquals(lastPopped, localScope)"); } + public override void VisitForSyntax(ForSyntax syntax) + { + // we must have a scope in the map for the loop body - otherwise binding won't work + Debug.Assert(this.allLocalScopes.ContainsKey(syntax.Body), "this.allLocalScopes.ContainsKey(syntax.Body)"); + + // visit all the children + base.VisitForSyntax(syntax); + } + private Symbol LookupSymbolByName(IdentifierSyntax identifierSyntax, bool isFunctionCall) => this.LookupLocalSymbolByName(identifierSyntax, isFunctionCall) ?? LookupGlobalSymbolByName(identifierSyntax, isFunctionCall); @@ -298,7 +311,7 @@ private class ScopeCollectorVisitor: SymbolVisitor public override void VisitLocalScope(LocalScope symbol) { - this.ScopeMap.Add(symbol.EnclosingSyntax, symbol); + this.ScopeMap.Add(symbol.BindingSyntax, symbol); base.VisitLocalScope(symbol); } diff --git a/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceSymbol.cs b/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceSymbol.cs index 9f530adc68a..18918c451c2 100644 --- a/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceSymbol.cs +++ b/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceSymbol.cs @@ -295,7 +295,7 @@ public class SystemNamespaceSymbol : NamespaceSymbol .Build(), new FunctionOverloadBuilder("range") - .WithReturnType(LanguageConstants.Array) + .WithReturnType(new TypedArrayType(LanguageConstants.Int, TypeSymbolValidationFlags.Default)) .WithDescription("Creates an array of integers from a starting integer and containing a number of items.") .WithRequiredParameter("startIndex", LanguageConstants.Int, "The first integer in the array. The sum of startIndex and count must be no greater than 2147483647.") .WithRequiredParameter("count", LanguageConstants.Int, "The number of integers in the array. Must be non-negative integer up to 10000.") diff --git a/src/Bicep.Core/Semantics/ResourceSymbol.cs b/src/Bicep.Core/Semantics/ResourceSymbol.cs index af40581c022..19db79f7588 100644 --- a/src/Bicep.Core/Semantics/ResourceSymbol.cs +++ b/src/Bicep.Core/Semantics/ResourceSymbol.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; using Bicep.Core.Syntax; +using Bicep.Core.TypeSystem; namespace Bicep.Core.Semantics { @@ -25,5 +26,7 @@ public override IEnumerable Descendants yield return this.Type; } } + + public bool IsCollection => this.Context.TypeManager.GetTypeInfo(this.DeclaringResource) is ArrayType; } } \ No newline at end of file diff --git a/src/Bicep.Core/Semantics/SemanticModel.cs b/src/Bicep.Core/Semantics/SemanticModel.cs index 48e5b6e1a15..b187c613dea 100644 --- a/src/Bicep.Core/Semantics/SemanticModel.cs +++ b/src/Bicep.Core/Semantics/SemanticModel.cs @@ -14,6 +14,7 @@ namespace Bicep.Core.Semantics public class SemanticModel { private readonly Lazy emitLimitationInfoLazy; + private readonly Lazy symbolHierarchyLazy; public SemanticModel(Compilation compilation, SyntaxTree syntaxTree) { @@ -34,6 +35,13 @@ public SemanticModel(Compilation compilation, SyntaxTree syntaxTree) symbolContext.Unlock(); this.emitLimitationInfoLazy = new Lazy(() => EmitLimitationCalculator.Calculate(this)); + this.symbolHierarchyLazy = new Lazy(() => + { + var hierarchy = new SymbolHierarchy(); + hierarchy.AddRoot(this.Root); + + return hierarchy; + }); } public SyntaxTree SyntaxTree { get; } @@ -88,6 +96,8 @@ public bool HasErrors() public DeclaredTypeAssignment? GetDeclaredTypeAssignment(SyntaxBase syntax) => this.TypeManager.GetDeclaredTypeAssignment(syntax); + public Symbol? GetSymbolParent(Symbol symbol) => this.symbolHierarchyLazy.Value.GetParent(symbol); + /// /// Returns the symbol that was bound to the specified syntax node. Will return null for syntax nodes that never get bound to symbols. Otherwise, /// a symbol will always be returned. Binding failures are represented with a non-null error symbol. diff --git a/src/Bicep.Core/Semantics/SymbolHierarchy.cs b/src/Bicep.Core/Semantics/SymbolHierarchy.cs new file mode 100644 index 00000000000..27c5511ab53 --- /dev/null +++ b/src/Bicep.Core/Semantics/SymbolHierarchy.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Bicep.Core.TypeSystem; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Bicep.Core.Semantics +{ + /// + /// Represents the hierarchy between symbols. For example, all global declarations have a parent that is a FileSymbol. All local scopes + /// have parents who can be a local scope or the global scope represented by the FileSymbol. + /// + public class SymbolHierarchy + { + private readonly Dictionary parentMap = new Dictionary(); + + /// + /// Adds a root node and indexes the parents for all child nodes recursively. + /// + /// The root node. + public void AddRoot(Symbol root) + { + var visitor = new ParentTrackingVisitor(this.parentMap); + visitor.Visit(root); + } + + /// + /// Gets the parent of the specified symbol. Returns null for root nodes. Throws an exception for nodes that have not been indexed. + /// + /// The node + public Symbol? GetParent(Symbol node) + { + if (this.parentMap.TryGetValue(node, out var parent) == false) + { + throw new ArgumentException($"Unable to determine parent of specified node of type '{node.GetType().Name}' with name '{node.Name}' because it has not been indexed."); + } + + return parent; + } + + private sealed class ParentTrackingVisitor : SymbolVisitor + { + private readonly Dictionary parentMap; + private readonly Stack currentParents = new(); + + public ParentTrackingVisitor(Dictionary parentMap) + { + this.parentMap = parentMap; + } + + protected override void VisitInternal(Symbol node) + { + if(node is TypeSymbol) + { + // the same type may be returned as a child of multiple symbols + // we can skip them for now + return; + } + + var parent = currentParents.Count <= 0 ? null : currentParents.Peek(); + parentMap.Add(node, parent); + + currentParents.Push(node); + base.VisitInternal(node); + currentParents.Pop(); + } + } + } +} diff --git a/src/Bicep.Core/Syntax/SyntaxHierarchy.cs b/src/Bicep.Core/Syntax/SyntaxHierarchy.cs index f8fac3a4bdc..ea7d77c0d4b 100644 --- a/src/Bicep.Core/Syntax/SyntaxHierarchy.cs +++ b/src/Bicep.Core/Syntax/SyntaxHierarchy.cs @@ -33,6 +33,21 @@ public void AddRoot(SyntaxBase root) return parent; } + public bool IsDescendant(SyntaxBase node, SyntaxBase potentialAncestor) + { + var current = node; + while(current != null) + { + current = this.GetParent(current); + if(ReferenceEquals(current,potentialAncestor)) + { + return true; + } + } + + return false; + } + private sealed class ParentTrackingVisitor: SyntaxVisitor { private readonly Dictionary parentMap; diff --git a/src/Bicep.Core/TypeSystem/Az/AzResourceTypeProvider.cs b/src/Bicep.Core/TypeSystem/Az/AzResourceTypeProvider.cs index 9182f546204..8828fbcc4ca 100644 --- a/src/Bicep.Core/TypeSystem/Az/AzResourceTypeProvider.cs +++ b/src/Bicep.Core/TypeSystem/Az/AzResourceTypeProvider.cs @@ -110,7 +110,7 @@ private static ObjectType SetBicepResourceProperties(ObjectType objectType, Reso else { // TODO: remove 'dependsOn' from the type library - properties = properties.SetItem(LanguageConstants.ResourceDependsOnPropertyName, new TypeProperty(LanguageConstants.ResourceDependsOnPropertyName, LanguageConstants.ResourceRefArray, TypePropertyFlags.WriteOnly)); + properties = properties.SetItem(LanguageConstants.ResourceDependsOnPropertyName, new TypeProperty(LanguageConstants.ResourceDependsOnPropertyName, LanguageConstants.ResourceOrResourceCollectionRefArray, TypePropertyFlags.WriteOnly)); // we only support scope for extension resources (or resources where the scope is unknown and thus may be an extension resource) if (validParentScopes.HasFlag(ResourceScope.Resource)) diff --git a/src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs b/src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs index fe4efb723ef..1f7a409e5e5 100644 --- a/src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs +++ b/src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs @@ -82,7 +82,10 @@ public DeclaredTypeManager(IResourceTypeProvider resourceTypeProvider, TypeManag return GetArrayAccessType(arrayAccess); case VariableDeclarationSyntax variable: - return new DeclaredTypeAssignment(this.typeManager.GetTypeInfo(syntax), variable); + return new DeclaredTypeAssignment(this.typeManager.GetTypeInfo(variable), variable); + + case LocalVariableSyntax localVariable: + return new DeclaredTypeAssignment(this.typeManager.GetTypeInfo(localVariable), localVariable); case FunctionCallSyntax _: case InstanceFunctionCallSyntax _: diff --git a/src/Bicep.Core/TypeSystem/ResourceScopeType.cs b/src/Bicep.Core/TypeSystem/ResourceScopeType.cs index 69f8bbdc3c2..ddef0a50c82 100644 --- a/src/Bicep.Core/TypeSystem/ResourceScopeType.cs +++ b/src/Bicep.Core/TypeSystem/ResourceScopeType.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System; + namespace Bicep.Core.TypeSystem { public class ResourceScopeType : TypeSymbol, IScopeReference @@ -14,5 +16,8 @@ public ResourceScopeType(string name, ResourceScope scopeType) public override TypeKind TypeKind => TypeKind.ResourceScopeReference; public ResourceScope Scope { get; } + + public override string FormatNameForCompoundTypes() => + Enum.IsDefined(typeof(ResourceScope), this.Scope) ? this.Name : this.WrapTypeName(); } } diff --git a/src/Bicep.Core/TypeSystem/TypeSymbol.cs b/src/Bicep.Core/TypeSystem/TypeSymbol.cs index 3e600272efc..faae077f6f7 100644 --- a/src/Bicep.Core/TypeSystem/TypeSymbol.cs +++ b/src/Bicep.Core/TypeSystem/TypeSymbol.cs @@ -29,5 +29,13 @@ public override string ToString() { return this.Name; } + + /// + /// Returns a name for this type that was formatted for inclusion in the name of another compount type. + /// For most types, this is the same as name. + /// + public virtual string FormatNameForCompoundTypes() => this.Name; + + protected string WrapTypeName() => $"({this.Name})"; } } diff --git a/src/Bicep.Core/TypeSystem/TypeValidator.cs b/src/Bicep.Core/TypeSystem/TypeValidator.cs index 8f7efa022cc..e43aa6eba65 100644 --- a/src/Bicep.Core/TypeSystem/TypeValidator.cs +++ b/src/Bicep.Core/TypeSystem/TypeValidator.cs @@ -60,6 +60,9 @@ public static bool AreTypesAssignable(TypeSymbol sourceType, TypeSymbol targetTy // checking for valid combinations of scopes happens after type checking. this allows us to provide a richer & more intuitive error message. return sourceType is IScopeReference; + case UnionType union when ReferenceEquals(union, LanguageConstants.ResourceOrResourceCollectionRefItem): + return sourceType is IScopeReference || sourceType is ArrayType {Item: IScopeReference}; + case TypeSymbol _ when sourceType is ResourceType sourceResourceType: // When assigning a resource, we're really assigning the value of the resource body. return AreTypesAssignable(sourceResourceType.Body.Type, targetType); @@ -217,7 +220,7 @@ private static TypeSymbol NarrowTypeInternal(ITypeManager typeManager, if (targetType is UnionType targetUnionType) { - return UnionType.Create(targetUnionType.Members.Where(x => AreTypesAssignable(expressionType, x.Type) == true)); + return UnionType.Create(targetUnionType.Members.Where(x => AreTypesAssignable(expressionType, x.Type))); } return targetType; diff --git a/src/Bicep.Core/TypeSystem/TypedArrayType.cs b/src/Bicep.Core/TypeSystem/TypedArrayType.cs index 4f436e6486e..626479ff6d8 100644 --- a/src/Bicep.Core/TypeSystem/TypedArrayType.cs +++ b/src/Bicep.Core/TypeSystem/TypedArrayType.cs @@ -5,7 +5,7 @@ namespace Bicep.Core.TypeSystem public class TypedArrayType : ArrayType { public TypedArrayType(ITypeReference itemReference, TypeSymbolValidationFlags validationFlags) - : base(itemReference.Type.Name + "[]") + : base(FormatTypeName(itemReference)) { this.Item = itemReference; ValidationFlags = validationFlags; @@ -14,5 +14,7 @@ public TypedArrayType(ITypeReference itemReference, TypeSymbolValidationFlags va public override ITypeReference Item { get; } public override TypeSymbolValidationFlags ValidationFlags { get; } + + private static string FormatTypeName(ITypeReference itemReference) => $"{itemReference.Type.FormatNameForCompoundTypes()}[]"; } } diff --git a/src/Bicep.Core/TypeSystem/UnionType.cs b/src/Bicep.Core/TypeSystem/UnionType.cs index a3914a795ba..51148a167c9 100644 --- a/src/Bicep.Core/TypeSystem/UnionType.cs +++ b/src/Bicep.Core/TypeSystem/UnionType.cs @@ -38,12 +38,15 @@ public static TypeSymbol Create(IEnumerable unionMembers) public static TypeSymbol Create(params ITypeReference[] members) => Create((IEnumerable) members); + public override string FormatNameForCompoundTypes() => this.WrapTypeName(); + private static IEnumerable FlattenMembers(IEnumerable members) => members.SelectMany(member => member.Type is UnionType union ? FlattenMembers(union.Members) : member.AsEnumerable()); - private static string FormatName(IEnumerable unionMembers) => unionMembers.Select(m => m.Type.Name).ConcatString(" | "); + private static string FormatName(IEnumerable unionMembers) => + unionMembers.Select(m => m.Type.FormatNameForCompoundTypes()).ConcatString(" | "); } } diff --git a/src/Bicep.Decompiler.IntegrationTests/Working/resourceIds/main.bicep b/src/Bicep.Decompiler.IntegrationTests/Working/resourceIds/main.bicep index ea039390bcb..a2ccc2ae603 100644 --- a/src/Bicep.Decompiler.IntegrationTests/Working/resourceIds/main.bicep +++ b/src/Bicep.Decompiler.IntegrationTests/Working/resourceIds/main.bicep @@ -44,6 +44,6 @@ resource fooName_blah2 'Foo.Rp/bar@2019-06-01' = { } dependsOn: [ 'Foo.Rp/bar${fooName}bar' -//@[4:29) [BCP034 (Error)] The enclosing array expected an item of type "resource | module", but the provided item was of type "string". |'Foo.Rp/bar${fooName}bar'| +//@[4:29) [BCP034 (Error)] The enclosing array expected an item of type "module[] | (resource | module) | resource[]", but the provided item was of type "string". |'Foo.Rp/bar${fooName}bar'| ] } diff --git a/src/Bicep.LangServer.UnitTests/BicepCompletionProviderTests.cs b/src/Bicep.LangServer.UnitTests/BicepCompletionProviderTests.cs index 0f0d2479e22..16fbf44377f 100644 --- a/src/Bicep.LangServer.UnitTests/BicepCompletionProviderTests.cs +++ b/src/Bicep.LangServer.UnitTests/BicepCompletionProviderTests.cs @@ -36,7 +36,7 @@ public void DeclarationSnippetsShouldBeValid() var provider = new BicepCompletionProvider(new FileResolver()); - var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(grouping.EntryPoint, 0)); + var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(compilation, 0)); var snippetCompletions = completions .Where(c => c.Kind == CompletionItemKind.Snippet) @@ -102,7 +102,7 @@ public void DeclarationContextShouldReturnKeywordCompletions() var provider = new BicepCompletionProvider(new FileResolver()); - var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(grouping.EntryPoint, 0)); + var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(compilation, 0)); var keywordCompletions = completions .Where(c => c.Kind == CompletionItemKind.Keyword) @@ -181,7 +181,7 @@ param p string var compilation = new Compilation(TestResourceTypeProvider.Create(), grouping); var provider = new BicepCompletionProvider(new FileResolver()); - var context = BicepCompletionContext.Create(grouping.EntryPoint, offset); + var context = BicepCompletionContext.Create(compilation, offset); var completions = provider.GetFilteredCompletions(compilation, context).ToList(); AssertExpectedFunctions(completions, expectParamDefaultFunctions: false); @@ -222,7 +222,7 @@ public void CompletionsForOneLinerParameterDefaultValueShouldIncludeFunctionsVal var provider = new BicepCompletionProvider(new FileResolver()); var completions = provider.GetFilteredCompletions( compilation, - BicepCompletionContext.Create(grouping.EntryPoint, offset)).ToList(); + BicepCompletionContext.Create(compilation, offset)).ToList(); AssertExpectedFunctions(completions, expectParamDefaultFunctions: true); @@ -248,7 +248,7 @@ public void CompletionsForModifierDefaultValuesShouldIncludeFunctionsValidInDefa var offset = ((ObjectSyntax) grouping.EntryPoint.ProgramSyntax.Declarations.OfType().Single().Modifier!).Properties.Single().Value.Span.Position; var compilation = new Compilation(TestResourceTypeProvider.Create(), grouping); - var context = BicepCompletionContext.Create(grouping.EntryPoint, offset); + var context = BicepCompletionContext.Create(compilation, offset); var provider = new BicepCompletionProvider(new FileResolver()); var completions = provider.GetFilteredCompletions(compilation, context).ToList(); @@ -282,7 +282,7 @@ param concat string var compilation = new Compilation(TestResourceTypeProvider.Create(), grouping); var provider = new BicepCompletionProvider(new FileResolver()); - var context = BicepCompletionContext.Create(grouping.EntryPoint, offset); + var context = BicepCompletionContext.Create(compilation, offset); var completions = provider.GetFilteredCompletions(compilation, context).ToList(); AssertExpectedFunctions(completions, expectParamDefaultFunctions: false, new[] {"sys.concat", "az.resourceGroup", "sys.base64"}); @@ -327,7 +327,7 @@ public void OutputTypeContextShouldReturnDeclarationTypeCompletions() var offset = grouping.EntryPoint.ProgramSyntax.Declarations.OfType().Single().Type.Span.Position; - var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(grouping.EntryPoint, offset)); + var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(compilation, offset)); var declarationTypeCompletions = completions.Where(c => c.Kind == CompletionItemKind.Class).ToList(); AssertExpectedDeclarationTypeCompletions(declarationTypeCompletions); @@ -344,7 +344,7 @@ public void ParameterTypeContextShouldReturnDeclarationTypeCompletions() var offset = grouping.EntryPoint.ProgramSyntax.Declarations.OfType().Single().Type.Span.Position; - var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(grouping.EntryPoint, offset)); + var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(compilation, offset)); var declarationTypeCompletions = completions.Where(c => c.Kind == CompletionItemKind.Class).ToList(); AssertExpectedDeclarationTypeCompletions(declarationTypeCompletions); @@ -388,7 +388,7 @@ public void CommentShouldNotGiveAnyCompletions(string codeFragment) var offset = codeFragment.IndexOf('|'); - var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(grouping.EntryPoint, offset)); + var completions = provider.GetFilteredCompletions(compilation, BicepCompletionContext.Create(compilation, offset)); completions.Should().BeEmpty(); } diff --git a/src/Bicep.LangServer.UnitTests/Completions/BicepCompletionContextTests.cs b/src/Bicep.LangServer.UnitTests/Completions/BicepCompletionContextTests.cs index 4cd10b0b82e..d24978d5ced 100644 --- a/src/Bicep.LangServer.UnitTests/Completions/BicepCompletionContextTests.cs +++ b/src/Bicep.LangServer.UnitTests/Completions/BicepCompletionContextTests.cs @@ -1,7 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; -using Bicep.Core.Syntax; +using Bicep.Core.Semantics; +using Bicep.Core.TypeSystem.Az; +using Bicep.Core.UnitTests.Utils; using Bicep.LanguageServer.Completions; using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -15,9 +17,9 @@ public class BicepCompletionContextTests public void ZeroMatchingNodes_Create_ShouldThrow() { const string text = "var foo = 42"; - var syntaxTree = SyntaxTree.Create(new Uri("test://test"), text); + var compilation = new Compilation(new AzResourceTypeProvider(), SyntaxTreeGroupingFactory.CreateFromText(text)); - Action fail = () => BicepCompletionContext.Create(syntaxTree, text.Length + 2); + Action fail = () => BicepCompletionContext.Create(compilation, text.Length + 2); fail.Should().Throw().WithMessage("The specified offset 14 is outside the span of the specified ProgramSyntax node."); } } diff --git a/src/Bicep.LangServer/Completions/BicepCompletionContext.cs b/src/Bicep.LangServer/Completions/BicepCompletionContext.cs index 5761c4b32aa..406e6614011 100644 --- a/src/Bicep.LangServer/Completions/BicepCompletionContext.cs +++ b/src/Bicep.LangServer/Completions/BicepCompletionContext.cs @@ -9,6 +9,7 @@ using Bicep.Core.Extensions; using Bicep.Core.Navigation; using Bicep.Core.Parsing; +using Bicep.Core.Semantics; using Bicep.Core.Syntax; using Bicep.LanguageServer.Extensions; using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; @@ -35,7 +36,8 @@ public BicepCompletionContext( ArraySyntax? array, PropertyAccessSyntax? propertyAccess, ArrayAccessSyntax? arrayAccess, - TargetScopeSyntax? targetScope) + TargetScopeSyntax? targetScope, + ImmutableArray activeScopes) { this.Kind = kind; this.ReplacementRange = replacementRange; @@ -46,6 +48,7 @@ public BicepCompletionContext( this.PropertyAccess = propertyAccess; this.ArrayAccess = arrayAccess; this.TargetScope = targetScope; + this.ActiveScopes = activeScopes; } public BicepCompletionContextKind Kind { get; } @@ -64,11 +67,14 @@ public BicepCompletionContext( public TargetScopeSyntax? TargetScope { get; } + public ImmutableArray ActiveScopes { get; } + public Range ReplacementRange { get; } - public static BicepCompletionContext Create(SyntaxTree syntaxTree, int offset) + public static BicepCompletionContext Create(Compilation compilation, int offset) { + var syntaxTree = compilation.SyntaxTreeGrouping.EntryPoint; var matchingNodes = SyntaxMatcher.FindNodesMatchingOffset(syntaxTree.ProgramSyntax, offset); if (!matchingNodes.Any()) { @@ -82,7 +88,7 @@ public static BicepCompletionContext Create(SyntaxTree syntaxTree, int offset) var matchingTriviaType = FindTriviaMatchingOffset(syntaxTree.ProgramSyntax, offset)?.Type; if (matchingTriviaType is not null && (matchingTriviaType == SyntaxTriviaType.MultiLineComment || matchingTriviaType == SyntaxTriviaType.SingleLineComment)) { //we're in a comment, no hints here - return new BicepCompletionContext(BicepCompletionContextKind.None, replacementRange, null, null, null, null, null, null, null); + return new BicepCompletionContext(BicepCompletionContextKind.None, replacementRange, null, null, null, null, null, null, null, ImmutableArray.Empty); } var topLevelDeclarationInfo = SyntaxMatcher.FindLastNodeOfType(matchingNodes); @@ -92,6 +98,7 @@ public static BicepCompletionContext Create(SyntaxTree syntaxTree, int offset) var propertyAccessInfo = SyntaxMatcher.FindLastNodeOfType(matchingNodes); var arrayAccessInfo = SyntaxMatcher.FindLastNodeOfType(matchingNodes); var targetScopeInfo = SyntaxMatcher.FindLastNodeOfType(matchingNodes); + var activeScopes = ActiveScopesVisitor.GetActiveScopes(compilation.GetEntrypointSemanticModel().Root, offset); var kind = ConvertFlag(IsTopLevelDeclarationStartContext(matchingNodes, offset), BicepCompletionContextKind.TopLevelDeclarationStart) | GetDeclarationTypeFlags(matchingNodes, offset) | @@ -113,7 +120,17 @@ public static BicepCompletionContext Create(SyntaxTree syntaxTree, int offset) kind |= ConvertFlag(IsInnerExpressionContext(matchingNodes), BicepCompletionContextKind.Expression); } - return new BicepCompletionContext(kind, replacementRange, topLevelDeclarationInfo.node, objectInfo.node, propertyInfo.node, arrayInfo.node, propertyAccessInfo.node, arrayAccessInfo.node, targetScopeInfo.node); + return new BicepCompletionContext( + kind, + replacementRange, + topLevelDeclarationInfo.node, + objectInfo.node, + propertyInfo.node, + arrayInfo.node, + propertyAccessInfo.node, + arrayAccessInfo.node, + targetScopeInfo.node, + activeScopes); } /// @@ -496,5 +513,48 @@ private static Range GetReplacementRange(SyntaxTree syntaxTree, SyntaxBase inner // produce an insertion edit return new TextSpan(offset, 0).ToRange(syntaxTree.LineStarts); } + + private class ActiveScopesVisitor : SymbolVisitor + { + private readonly int offset; + + private ActiveScopesVisitor(int offset) + { + this.offset = offset; + } + + public override void VisitFileSymbol(FileSymbol symbol) + { + // global scope is always active + this.ActiveScopes.Add(symbol); + + base.VisitFileSymbol(symbol); + } + + public override void VisitLocalScope(LocalScope symbol) + { + // use binding syntax because this is used to find accessible symbols + // in a child scope + if (symbol.BindingSyntax.Span.Contains(this.offset)) + { + // the offset is inside the binding scope + // this scope is active + this.ActiveScopes.Add(symbol); + + // visit children to find more active scopes within + base.VisitLocalScope(symbol); + } + } + + private IList ActiveScopes { get; } = new List(); + + public static ImmutableArray GetActiveScopes(FileSymbol file, int offset) + { + var visitor = new ActiveScopesVisitor(offset); + visitor.Visit(file); + + return visitor.ActiveScopes.ToImmutableArray(); + } + } } } diff --git a/src/Bicep.LangServer/Completions/BicepCompletionProvider.cs b/src/Bicep.LangServer/Completions/BicepCompletionProvider.cs index 15ef7984ffa..da7553a2107 100644 --- a/src/Bicep.LangServer/Completions/BicepCompletionProvider.cs +++ b/src/Bicep.LangServer/Completions/BicepCompletionProvider.cs @@ -1,372 +1,378 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Bicep.Core; -using Bicep.Core.Extensions; -using Bicep.Core.FileSystem; -using Bicep.Core.Parsing; -using Bicep.Core.Resources; -using Bicep.Core.Semantics; -using Bicep.Core.Syntax; -using Bicep.Core.TypeSystem; -using Bicep.LanguageServer.Extensions; -using Bicep.LanguageServer.Snippets; -using OmniSharp.Extensions.LanguageServer.Protocol.Models; -using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; -using SymbolKind = Bicep.Core.Semantics.SymbolKind; - -namespace Bicep.LanguageServer.Completions -{ - public class BicepCompletionProvider : ICompletionProvider - { - private const string MarkdownNewLine = " \n"; - - private static readonly Container PropertyCommitChars = new Container(":"); - - private static readonly Container PropertyAccessCommitChars = new Container("."); - - private IFileResolver FileResolver; - - public BicepCompletionProvider(IFileResolver fileResolver) - { - this.FileResolver = fileResolver; - } - - public IEnumerable GetFilteredCompletions(Compilation compilation, BicepCompletionContext context) - { - var model = compilation.GetEntrypointSemanticModel(); - - return GetDeclarationCompletions(context) - .Concat(GetSymbolCompletions(model, context)) - .Concat(GetDeclarationTypeCompletions(context)) - .Concat(GetObjectPropertyNameCompletions(model, context)) - .Concat(GetMemberAccessCompletions(compilation, context)) - .Concat(GetArrayIndexCompletions(compilation, context)) - .Concat(GetPropertyValueCompletions(model, context)) - .Concat(GetArrayItemCompletions(model, context)) - .Concat(GetResourceTypeCompletions(model, context)) - .Concat(GetModulePathCompletions(model, context)) - .Concat(GetResourceOrModuleBodyCompletions(context)) - .Concat(GetTargetScopeCompletions(model, context)); - } - - private IEnumerable GetDeclarationCompletions(BicepCompletionContext context) - { - if (context.Kind.HasFlag(BicepCompletionContextKind.TopLevelDeclarationStart)) - { - yield return CreateKeywordCompletion(LanguageConstants.ParameterKeyword, "Parameter keyword", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration", "param ${1:Identifier} ${2:Type}", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration with default value", "param ${1:Identifier} ${2:Type} = ${3:DefaultValue}", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration with default and allowed values", @"param ${1:Identifier} ${2:Type} { - default: $3 - allowed: [ - $4 - ] -}", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration with options", @"param ${1:Identifier} ${2:Type} { - $0 -}", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Secure string parameter", @"param ${1:Identifier} string { - secure: true -}", context.ReplacementRange); - - yield return CreateKeywordCompletion(LanguageConstants.VariableKeyword, "Variable keyword", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.VariableKeyword, "Variable declaration", "var ${1:Identifier} = $0", context.ReplacementRange); - - yield return CreateKeywordCompletion(LanguageConstants.ResourceKeyword, "Resource keyword", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Resource with defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:Type}@${4:Version}' = { - name: $5 - location: $6 - properties: { - $0 - } -}", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Child Resource with defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:ParentType}/${4:ChildType}@${5:Version}' = { - name: $6 - properties: { - $0 - } -}", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Resource without defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:Type}@${4:Version}' = { - name: $5 - $0 -} -", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Child Resource without defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:ParentType}/${4:ChildType}@${5:Version}' = { - name: $6 - $0 -}", context.ReplacementRange); - - yield return CreateKeywordCompletion(LanguageConstants.OutputKeyword, "Output keyword", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.OutputKeyword, "Output declaration", "output ${1:Identifier} ${2:Type} = $0", context.ReplacementRange); - - yield return CreateKeywordCompletion(LanguageConstants.ModuleKeyword, "Module keyword", context.ReplacementRange); - yield return CreateContextualSnippetCompletion(LanguageConstants.ModuleKeyword, "Module declaration", @"module ${1:Identifier} '${2:Path}' = { - name: $3 - $0 -}", context.ReplacementRange); - - yield return CreateKeywordCompletion(LanguageConstants.TargetScopeKeyword, "Target Scope keyword", context.ReplacementRange); - } - } - - private IEnumerable GetTargetScopeCompletions(SemanticModel model, BicepCompletionContext context) - { - return context.Kind.HasFlag(BicepCompletionContextKind.TargetScope) && context.TargetScope is { } targetScope - ? GetValueCompletionsForType(model.GetDeclaredType(targetScope), context.ReplacementRange) - : Enumerable.Empty(); - } - - private IEnumerable GetSymbolCompletions(SemanticModel model, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.Expression) && - !context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName)) - { - return Enumerable.Empty(); - } - - if (context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName | BicepCompletionContextKind.MemberAccess)) - { - // This is already handled by GetMemberAccessCompletions. - return Enumerable.Empty(); - } - - if (context.Property != null && model.GetDeclaredTypeAssignment(context.Property)?.Flags == DeclaredTypeFlags.Constant) - { - // the enclosing property's declared type is supposed to be a constant value - // the constant flag comes from TypeProperty constant flag, so nothing else can really alter it except for another property - // (in other words constant flag inherits down into the expression tree of the property value) - return Enumerable.Empty(); - } - - // when we're inside an expression that is inside a property that expects a compile-time constant value, - // we should not be emitting accessible symbol completions - return GetAccessibleSymbolCompletions(model, context); - } - - private IEnumerable GetDeclarationTypeCompletions(BicepCompletionContext context) - { - // local function - IEnumerable GetPrimitiveTypeCompletions() => - LanguageConstants.DeclarationTypes.Values.Select(type => CreateTypeCompletion(type, context.ReplacementRange)); - - if (context.Kind.HasFlag(BicepCompletionContextKind.ParameterType)) - { - return GetPrimitiveTypeCompletions().Concat(GetParameterTypeSnippets(context.ReplacementRange)); - } - - if (context.Kind.HasFlag(BicepCompletionContextKind.OutputType)) - { - return GetPrimitiveTypeCompletions(); - } - - return Enumerable.Empty(); - } - - private IEnumerable GetResourceTypeCompletions(SemanticModel model, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.ResourceType)) - { - return Enumerable.Empty(); - } - - // we need to ensure that Microsoft.Compute/virtualMachines@whatever comes before Microsoft.Compute/virtualMachines/extensions@whatever - // similarly, newest api versions should be shown first - return model.Compilation.ResourceTypeProvider.GetAvailableTypes() - .OrderBy(rt => rt.FullyQualifiedType, StringComparer.OrdinalIgnoreCase) - .ThenByDescending(rt => rt.ApiVersion) - .Select((reference, index) => CreateResourceTypeCompletion(reference, index, context.ReplacementRange)) - .ToList(); - } - - private IEnumerable GetModulePathCompletions(SemanticModel model, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.ModulePath)) - { - return Enumerable.Empty(); - } - - // To provide intellisense before the quotes are typed - if (context.EnclosingDeclaration is not ModuleDeclarationSyntax declarationSyntax - || declarationSyntax.Path is not StringSyntax stringSyntax - || stringSyntax.TryGetLiteralValue() is not string entered) - { - entered = ""; - } - - // These should only fail if we're not able to resolve cwd path or the entered string - if (FileResolver.TryResolveModulePath(model.SyntaxTree.FileUri, ".") is not {} cwdUri - || FileResolver.TryResolveModulePath(cwdUri, entered) is not {} query) - { - return Enumerable.Empty(); - } - - var files = Enumerable.Empty(); - var dirs = Enumerable.Empty(); - - - // technically bicep files do not have to follow the bicep extension, so - // we are not enforcing *.bicep get files command - if (FileResolver.TryDirExists(query)) - { - files = FileResolver.GetFiles(query, string.Empty); - dirs = FileResolver.GetDirectories(query, string.Empty); - } - else if (FileResolver.TryResolveModulePath(query, ".") is {} queryParent) - { - files = FileResolver.GetFiles(queryParent, ""); - dirs = FileResolver.GetDirectories(queryParent,""); - } - // "./" will not be preserved when making relative Uris. We have to go and manually add it. - // Prioritize .bicep files higher than other files. - var fileItems = files - .Where(file => file != model.SyntaxTree.FileUri) - .Where(file => file.Segments.Last().EndsWith(LanguageConstants.LanguageFileExtension)) - .Select(file => CreateModulePathCompletion( - file.Segments.Last(), - (entered.StartsWith("./") ? "./" : "") + cwdUri.MakeRelativeUri(file).ToString(), - context.ReplacementRange, - CompletionItemKind.File, - file.Segments.Last().EndsWith(LanguageConstants.LanguageId) ? CompletionPriority.High : CompletionPriority.Medium)) - .ToList(); - - var dirItems = dirs - .Select(dir => CreateModulePathCompletion( - dir.Segments.Last(), - (entered.StartsWith("./") ? "./" : "") + cwdUri.MakeRelativeUri(dir).ToString(), - context.ReplacementRange, - CompletionItemKind.Folder, - CompletionPriority.Medium) - .WithCommand(new Command {Name = EditorCommands.RequestCompletions })) - .ToList(); - return fileItems.Concat(dirItems); - } - - private static IEnumerable GetParameterTypeSnippets(Range replacementRange) - { - yield return CreateContextualSnippetCompletion("secureObject", "Secure object", @"object { - secure: true -}", replacementRange); - - yield return CreateContextualSnippetCompletion("secureString", "Secure string", @"string { - secure: true -}", replacementRange); - } - - private IEnumerable GetResourceOrModuleBodyCompletions(BicepCompletionContext context) - { - if (context.Kind.HasFlag(BicepCompletionContextKind.ResourceBody) || context.Kind.HasFlag(BicepCompletionContextKind.ModuleBody)) - { - yield return CreateObjectBodyCompletion(context.ReplacementRange); - } - } - - private static IEnumerable GetAccessibleSymbolCompletions(SemanticModel model, BicepCompletionContext context) - { - // maps insert text to the completion item - var completions = new Dictionary(); - - var declaredNames = new HashSet(); - - var accessibleDecoratorFunctionsCache = new Dictionary>(); - - var enclosingDeclarationSymbol = context.EnclosingDeclaration == null - ? null - : model.GetSymbolInfo(context.EnclosingDeclaration); - - // local function - void AddSymbolCompletions(IDictionary result, IEnumerable symbols) - { - foreach (var symbol in symbols) - { - if (!result.ContainsKey(symbol.Name) && !ReferenceEquals(symbol, enclosingDeclarationSymbol) && !string.Equals(symbol.Name, enclosingDeclarationSymbol?.Name, LanguageConstants.IdentifierComparison)) - { - // the symbol satisfies the following conditions: - // - we have not added a symbol with the same name (avoids duplicate completions) - // - the symbol is different than the enclosing declaration (avoids suggesting cycles) - // - the symbol name is different than the name of the enclosing declaration (avoids suggesting a duplicate identifier) - result.Add(symbol.Name, CreateSymbolCompletion(symbol, context.ReplacementRange)); - } - } - } - - // local function - IEnumerable GetAccessibleDecoratorFunctionsWithCache(NamespaceType namespaceType) - { - if (accessibleDecoratorFunctionsCache.TryGetValue(namespaceType, out var result)) - { - return result; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Bicep.Core; +using Bicep.Core.Extensions; +using Bicep.Core.FileSystem; +using Bicep.Core.Parsing; +using Bicep.Core.Resources; +using Bicep.Core.Semantics; +using Bicep.Core.Syntax; +using Bicep.Core.TypeSystem; +using Bicep.LanguageServer.Extensions; +using Bicep.LanguageServer.Snippets; +using OmniSharp.Extensions.LanguageServer.Protocol.Models; +using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range; +using SymbolKind = Bicep.Core.Semantics.SymbolKind; + +namespace Bicep.LanguageServer.Completions +{ + public class BicepCompletionProvider : ICompletionProvider + { + private const string MarkdownNewLine = " \n"; + + private static readonly Container PropertyCommitChars = new Container(":"); + + private static readonly Container PropertyAccessCommitChars = new Container("."); + + private IFileResolver FileResolver; + + public BicepCompletionProvider(IFileResolver fileResolver) + { + this.FileResolver = fileResolver; + } + + public IEnumerable GetFilteredCompletions(Compilation compilation, BicepCompletionContext context) + { + var model = compilation.GetEntrypointSemanticModel(); + + return GetDeclarationCompletions(context) + .Concat(GetSymbolCompletions(model, context)) + .Concat(GetDeclarationTypeCompletions(context)) + .Concat(GetObjectPropertyNameCompletions(model, context)) + .Concat(GetMemberAccessCompletions(compilation, context)) + .Concat(GetArrayIndexCompletions(compilation, context)) + .Concat(GetPropertyValueCompletions(model, context)) + .Concat(GetArrayItemCompletions(model, context)) + .Concat(GetResourceTypeCompletions(model, context)) + .Concat(GetModulePathCompletions(model, context)) + .Concat(GetResourceOrModuleBodyCompletions(context)) + .Concat(GetTargetScopeCompletions(model, context)); + } + + private IEnumerable GetDeclarationCompletions(BicepCompletionContext context) + { + if (context.Kind.HasFlag(BicepCompletionContextKind.TopLevelDeclarationStart)) + { + yield return CreateKeywordCompletion(LanguageConstants.ParameterKeyword, "Parameter keyword", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration", "param ${1:Identifier} ${2:Type}", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration with default value", "param ${1:Identifier} ${2:Type} = ${3:DefaultValue}", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration with default and allowed values", @"param ${1:Identifier} ${2:Type} { + default: $3 + allowed: [ + $4 + ] +}", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Parameter declaration with options", @"param ${1:Identifier} ${2:Type} { + $0 +}", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ParameterKeyword, "Secure string parameter", @"param ${1:Identifier} string { + secure: true +}", context.ReplacementRange); + + yield return CreateKeywordCompletion(LanguageConstants.VariableKeyword, "Variable keyword", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.VariableKeyword, "Variable declaration", "var ${1:Identifier} = $0", context.ReplacementRange); + + yield return CreateKeywordCompletion(LanguageConstants.ResourceKeyword, "Resource keyword", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Resource with defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:Type}@${4:Version}' = { + name: $5 + location: $6 + properties: { + $0 + } +}", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Child Resource with defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:ParentType}/${4:ChildType}@${5:Version}' = { + name: $6 + properties: { + $0 + } +}", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Resource without defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:Type}@${4:Version}' = { + name: $5 + $0 +} +", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ResourceKeyword, "Child Resource without defaults", @"resource ${1:Identifier} 'Microsoft.${2:Provider}/${3:ParentType}/${4:ChildType}@${5:Version}' = { + name: $6 + $0 +}", context.ReplacementRange); + + yield return CreateKeywordCompletion(LanguageConstants.OutputKeyword, "Output keyword", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.OutputKeyword, "Output declaration", "output ${1:Identifier} ${2:Type} = $0", context.ReplacementRange); + + yield return CreateKeywordCompletion(LanguageConstants.ModuleKeyword, "Module keyword", context.ReplacementRange); + yield return CreateContextualSnippetCompletion(LanguageConstants.ModuleKeyword, "Module declaration", @"module ${1:Identifier} '${2:Path}' = { + name: $3 + $0 +}", context.ReplacementRange); + + yield return CreateKeywordCompletion(LanguageConstants.TargetScopeKeyword, "Target Scope keyword", context.ReplacementRange); + } + } + + private IEnumerable GetTargetScopeCompletions(SemanticModel model, BicepCompletionContext context) + { + return context.Kind.HasFlag(BicepCompletionContextKind.TargetScope) && context.TargetScope is { } targetScope + ? GetValueCompletionsForType(model.GetDeclaredType(targetScope), context.ReplacementRange) + : Enumerable.Empty(); + } + + private IEnumerable GetSymbolCompletions(SemanticModel model, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.Expression) && + !context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName)) + { + return Enumerable.Empty(); + } + + if (context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName | BicepCompletionContextKind.MemberAccess)) + { + // This is already handled by GetMemberAccessCompletions. + return Enumerable.Empty(); + } + + if (context.Property != null && model.GetDeclaredTypeAssignment(context.Property)?.Flags == DeclaredTypeFlags.Constant) + { + // the enclosing property's declared type is supposed to be a constant value + // the constant flag comes from TypeProperty constant flag, so nothing else can really alter it except for another property + // (in other words constant flag inherits down into the expression tree of the property value) + return Enumerable.Empty(); + } + + // when we're inside an expression that is inside a property that expects a compile-time constant value, + // we should not be emitting accessible symbol completions + return GetAccessibleSymbolCompletions(model, context); + } + + private IEnumerable GetDeclarationTypeCompletions(BicepCompletionContext context) + { + // local function + IEnumerable GetPrimitiveTypeCompletions() => + LanguageConstants.DeclarationTypes.Values.Select(type => CreateTypeCompletion(type, context.ReplacementRange)); + + if (context.Kind.HasFlag(BicepCompletionContextKind.ParameterType)) + { + return GetPrimitiveTypeCompletions().Concat(GetParameterTypeSnippets(context.ReplacementRange)); + } + + if (context.Kind.HasFlag(BicepCompletionContextKind.OutputType)) + { + return GetPrimitiveTypeCompletions(); + } + + return Enumerable.Empty(); + } + + private IEnumerable GetResourceTypeCompletions(SemanticModel model, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.ResourceType)) + { + return Enumerable.Empty(); + } + + // we need to ensure that Microsoft.Compute/virtualMachines@whatever comes before Microsoft.Compute/virtualMachines/extensions@whatever + // similarly, newest api versions should be shown first + return model.Compilation.ResourceTypeProvider.GetAvailableTypes() + .OrderBy(rt => rt.FullyQualifiedType, StringComparer.OrdinalIgnoreCase) + .ThenByDescending(rt => rt.ApiVersion) + .Select((reference, index) => CreateResourceTypeCompletion(reference, index, context.ReplacementRange)) + .ToList(); + } + + private IEnumerable GetModulePathCompletions(SemanticModel model, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.ModulePath)) + { + return Enumerable.Empty(); + } + + // To provide intellisense before the quotes are typed + if (context.EnclosingDeclaration is not ModuleDeclarationSyntax declarationSyntax + || declarationSyntax.Path is not StringSyntax stringSyntax + || stringSyntax.TryGetLiteralValue() is not string entered) + { + entered = ""; + } + + // These should only fail if we're not able to resolve cwd path or the entered string + if (FileResolver.TryResolveModulePath(model.SyntaxTree.FileUri, ".") is not {} cwdUri + || FileResolver.TryResolveModulePath(cwdUri, entered) is not {} query) + { + return Enumerable.Empty(); + } + + var files = Enumerable.Empty(); + var dirs = Enumerable.Empty(); + + + // technically bicep files do not have to follow the bicep extension, so + // we are not enforcing *.bicep get files command + if (FileResolver.TryDirExists(query)) + { + files = FileResolver.GetFiles(query, string.Empty); + dirs = FileResolver.GetDirectories(query, string.Empty); + } + else if (FileResolver.TryResolveModulePath(query, ".") is {} queryParent) + { + files = FileResolver.GetFiles(queryParent, ""); + dirs = FileResolver.GetDirectories(queryParent,""); + } + // "./" will not be preserved when making relative Uris. We have to go and manually add it. + // Prioritize .bicep files higher than other files. + var fileItems = files + .Where(file => file != model.SyntaxTree.FileUri) + .Where(file => file.Segments.Last().EndsWith(LanguageConstants.LanguageFileExtension)) + .Select(file => CreateModulePathCompletion( + file.Segments.Last(), + (entered.StartsWith("./") ? "./" : "") + cwdUri.MakeRelativeUri(file).ToString(), + context.ReplacementRange, + CompletionItemKind.File, + file.Segments.Last().EndsWith(LanguageConstants.LanguageId) ? CompletionPriority.High : CompletionPriority.Medium)) + .ToList(); + + var dirItems = dirs + .Select(dir => CreateModulePathCompletion( + dir.Segments.Last(), + (entered.StartsWith("./") ? "./" : "") + cwdUri.MakeRelativeUri(dir).ToString(), + context.ReplacementRange, + CompletionItemKind.Folder, + CompletionPriority.Medium) + .WithCommand(new Command {Name = EditorCommands.RequestCompletions })) + .ToList(); + return fileItems.Concat(dirItems); + } + + private static IEnumerable GetParameterTypeSnippets(Range replacementRange) + { + yield return CreateContextualSnippetCompletion("secureObject", "Secure object", @"object { + secure: true +}", replacementRange); + + yield return CreateContextualSnippetCompletion("secureString", "Secure string", @"string { + secure: true +}", replacementRange); + } + + private IEnumerable GetResourceOrModuleBodyCompletions(BicepCompletionContext context) + { + if (context.Kind.HasFlag(BicepCompletionContextKind.ResourceBody) || context.Kind.HasFlag(BicepCompletionContextKind.ModuleBody)) + { + yield return CreateObjectBodyCompletion(context.ReplacementRange); + } + } + + private static IEnumerable GetAccessibleSymbolCompletions(SemanticModel model, BicepCompletionContext context) + { + // maps insert text to the completion item + var completions = new Dictionary(); + + var declaredNames = new HashSet(); + + var accessibleDecoratorFunctionsCache = new Dictionary>(); + + var enclosingDeclarationSymbol = context.EnclosingDeclaration == null + ? null + : model.GetSymbolInfo(context.EnclosingDeclaration); + + // local function + void AddSymbolCompletions(IDictionary result, IEnumerable symbols) + { + foreach (var symbol in symbols) + { + if (!result.ContainsKey(symbol.Name) && !ReferenceEquals(symbol, enclosingDeclarationSymbol)) + { + // the symbol satisfies the following conditions: + // - we have not added a symbol with the same name (avoids duplicate completions) + // - the symbol is different than the enclosing declaration (avoids suggesting cycles) + // - the symbol name is different than the name of the enclosing declaration (avoids suggesting a duplicate identifier) + result.Add(symbol.Name, CreateSymbolCompletion(symbol, context.ReplacementRange)); + } + } + } + + // local function + IEnumerable GetAccessibleDecoratorFunctionsWithCache(NamespaceType namespaceType) + { + if (accessibleDecoratorFunctionsCache.TryGetValue(namespaceType, out var result)) + { + return result; } - result = GetAccessibleDecoratorFunctions(namespaceType, enclosingDeclarationSymbol); - accessibleDecoratorFunctionsCache.Add(namespaceType, result); - - return result; - } - - if (!context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName)) - { - // add namespaces first - AddSymbolCompletions(completions, model.Root.ImportedNamespaces.Values); - - // add the non-output declarations with valid identifiers - AddSymbolCompletions(completions, model.Root.AllDeclarations.Where(decl => decl.NameSyntax.IsValid && decl is not OutputSymbol)); - } - else - { - // Only add the namespaces that contain accessible decorator function symbols. - AddSymbolCompletions(completions, model.Root.ImportedNamespaces.Values.Where( - @namespace => GetAccessibleDecoratorFunctionsWithCache(@namespace.Type).Any())); - - // Record the names of the non-output declarations which will be used to check name clashes later. - declaredNames.UnionWith(model.Root.AllDeclarations.Where(decl => decl.NameSyntax.IsValid && decl is not OutputSymbol).Select(decl => decl.Name)); - } - - // get names of functions that always require to be fully qualified due to clashes between namespaces - var alwaysFullyQualifiedNames = model.Root.ImportedNamespaces - .SelectMany(pair => context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName) - ? GetAccessibleDecoratorFunctionsWithCache(pair.Value.Type) - : pair.Value.Type.MethodResolver.GetKnownFunctions().Values) - .GroupBy(func => func.Name, (name, functionSymbols) => (name, count: functionSymbols.Count()), LanguageConstants.IdentifierComparer) - .Where(tuple => tuple.count > 1) - .Select(tuple => tuple.name) - .ToHashSet(LanguageConstants.IdentifierComparer); - - foreach (var @namespace in model.Root.ImportedNamespaces.Values) - { - var functionSymbols = context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName) - ? GetAccessibleDecoratorFunctionsWithCache(@namespace.Type) - : @namespace.Type.MethodResolver.GetKnownFunctions().Values; - - foreach (var function in functionSymbols) - { - if (function.FunctionFlags.HasFlag(FunctionFlags.ParamDefaultsOnly) && !(enclosingDeclarationSymbol is ParameterSymbol)) - { - // this function is only allowed in param defaults but the enclosing declaration is not bound to a parameter symbol - // therefore we should not suggesting this function as a viable completion - continue; - } - - if (completions.ContainsKey(function.Name) || alwaysFullyQualifiedNames.Contains(function.Name) || declaredNames.Contains(function.Name)) - { - // either there is a declaration with the same name as the function or the function is ambiguous between the imported namespaces - // either way the function must be fully qualified in the completion - var fullyQualifiedFunctionName = $"{@namespace.Name}.{function.Name}"; - completions.Add(fullyQualifiedFunctionName, CreateSymbolCompletion(function, context.ReplacementRange, insertText: fullyQualifiedFunctionName)); - } - else - { - // function does not have to be fully qualified - completions.Add(function.Name, CreateSymbolCompletion(function, context.ReplacementRange)); - } - } - } - - return completions.Values; + result = GetAccessibleDecoratorFunctions(namespaceType, enclosingDeclarationSymbol); + accessibleDecoratorFunctionsCache.Add(namespaceType, result); + + return result; + } + + if (!context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName)) + { + // add namespaces first + AddSymbolCompletions(completions, model.Root.ImportedNamespaces.Values); + + // add accessible symbols from innermost scope and then move to outer scopes + // reverse loop iteration + for (int depth = context.ActiveScopes.Length - 1; depth >= 0; depth--) + { + // add the non-output declarations with valid identifiers at current scope + var currentScope = context.ActiveScopes[depth]; + AddSymbolCompletions(completions, currentScope.AllDeclarations.Where(decl => decl.NameSyntax.IsValid && !(decl is OutputSymbol))); + } + } + else + { + // Only add the namespaces that contain accessible decorator function symbols. + AddSymbolCompletions(completions, model.Root.ImportedNamespaces.Values.Where( + @namespace => GetAccessibleDecoratorFunctionsWithCache(@namespace.Type).Any())); + + // Record the names of the non-output declarations which will be used to check name clashes later. + declaredNames.UnionWith(model.Root.AllDeclarations.Where(decl => decl.NameSyntax.IsValid && decl is not OutputSymbol).Select(decl => decl.Name)); + } + + // get names of functions that always require to be fully qualified due to clashes between namespaces + var alwaysFullyQualifiedNames = model.Root.ImportedNamespaces + .SelectMany(pair => context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName) + ? GetAccessibleDecoratorFunctionsWithCache(pair.Value.Type) + : pair.Value.Type.MethodResolver.GetKnownFunctions().Values) + .GroupBy(func => func.Name, (name, functionSymbols) => (name, count: functionSymbols.Count()), LanguageConstants.IdentifierComparer) + .Where(tuple => tuple.count > 1) + .Select(tuple => tuple.name) + .ToHashSet(LanguageConstants.IdentifierComparer); + + foreach (var @namespace in model.Root.ImportedNamespaces.Values) + { + var functionSymbols = context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName) + ? GetAccessibleDecoratorFunctionsWithCache(@namespace.Type) + : @namespace.Type.MethodResolver.GetKnownFunctions().Values; + + foreach (var function in functionSymbols) + { + if (function.FunctionFlags.HasFlag(FunctionFlags.ParamDefaultsOnly) && !(enclosingDeclarationSymbol is ParameterSymbol)) + { + // this function is only allowed in param defaults but the enclosing declaration is not bound to a parameter symbol + // therefore we should not suggesting this function as a viable completion + continue; + } + + if (completions.ContainsKey(function.Name) || alwaysFullyQualifiedNames.Contains(function.Name) || declaredNames.Contains(function.Name)) + { + // either there is a declaration with the same name as the function or the function is ambiguous between the imported namespaces + // either way the function must be fully qualified in the completion + var fullyQualifiedFunctionName = $"{@namespace.Name}.{function.Name}"; + completions.Add(fullyQualifiedFunctionName, CreateSymbolCompletion(function, context.ReplacementRange, insertText: fullyQualifiedFunctionName)); + } + else + { + // function does not have to be fully qualified + completions.Add(function.Name, CreateSymbolCompletion(function, context.ReplacementRange)); + } + } + } + + return completions.Values; } private static IEnumerable GetAccessibleDecoratorFunctions(NamespaceType namespaceType, Symbol? enclosingDeclarationSymbol) @@ -395,391 +401,393 @@ IEnumerable GetAccessible(IEnumerable symbols, T }; } - private IEnumerable GetMemberAccessCompletions(Compilation compilation, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.MemberAccess) || context.PropertyAccess == null) - { - return Enumerable.Empty(); - } - - var declaredType = compilation.GetEntrypointSemanticModel().GetDeclaredType(context.PropertyAccess.BaseExpression); - - if (context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName) && declaredType is NamespaceType namespaceType) - { - var model = compilation.GetEntrypointSemanticModel(); - var enclosingDeclarationSymbol = context.EnclosingDeclaration is null ? null : model.GetSymbolInfo(context.EnclosingDeclaration); - - return GetAccessibleDecoratorFunctions(namespaceType, enclosingDeclarationSymbol) - .Select(symbol => CreateSymbolCompletion(symbol, context.ReplacementRange)); - } - - return GetProperties(declaredType) - .Where(p => !p.Flags.HasFlag(TypePropertyFlags.WriteOnly)) - .Select(p => CreatePropertyAccessCompletion(p, compilation.SyntaxTreeGrouping.EntryPoint, context.PropertyAccess, context.ReplacementRange)) - .Concat(GetMethods(declaredType) - .Select(m => CreateSymbolCompletion(m, context.ReplacementRange))); - } - - private IEnumerable GetArrayIndexCompletions(Compilation compilation, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.ArrayIndex) || context.ArrayAccess == null) - { - return Enumerable.Empty(); - } - - var declaredType = compilation.GetEntrypointSemanticModel().GetDeclaredType(context.ArrayAccess.BaseExpression); - - return GetProperties(declaredType) - .Where(p => !p.Flags.HasFlag(TypePropertyFlags.WriteOnly)) - .Select(p => CreatePropertyIndexCompletion(p, context.ReplacementRange, CompletionPriority.High)); - } - - private IEnumerable GetObjectPropertyNameCompletions(SemanticModel model, BicepCompletionContext context) - { - if (context.Kind.HasFlag(BicepCompletionContextKind.ObjectPropertyName) == false || context.Object == null) - { - return Enumerable.Empty(); - } - - // in order to provide completions for property names, - // we need to establish the type of the object first - var declaredType = model.GetDeclaredType(context.Object); - if (declaredType == null) - { - return Enumerable.Empty(); - } - - var specifiedPropertyNames = context.Object.ToKnownPropertyNames(); - - // exclude read-only properties as they can't be set - // exclude properties whose name has been specified in the object already - return GetProperties(declaredType) - .Where(p => !p.Flags.HasFlag(TypePropertyFlags.ReadOnly) && specifiedPropertyNames.Contains(p.Name) == false) - .Select(p => CreatePropertyNameCompletion(p, context.ReplacementRange)); - } - - private static IEnumerable GetProperties(TypeSymbol? type) - { - switch (type) - { - case ResourceType resourceType: - return GetProperties(resourceType.Body.Type); - - case ModuleType moduleType: - return GetProperties(moduleType.Body.Type); - - case ObjectType objectType: - return objectType.Properties.Values; - - case DiscriminatedObjectType discriminated: - return discriminated.DiscriminatorProperty.AsEnumerable(); - - default: - return Enumerable.Empty(); - } - } - - private static IEnumerable GetMethods(TypeSymbol? type) => - type is ObjectType objectType - ? objectType.MethodResolver.GetKnownFunctions().Values - : Enumerable.Empty(); - - private static DeclaredTypeAssignment? GetDeclaredTypeAssignment(SemanticModel model, SyntaxBase? syntax) => syntax == null - ? null - : model.GetDeclaredTypeAssignment(syntax); - - private IEnumerable GetPropertyValueCompletions(SemanticModel model, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.PropertyValue)) - { - return Enumerable.Empty(); - } - - var declaredTypeAssignment = GetDeclaredTypeAssignment(model, context.Property); - if (declaredTypeAssignment == null) - { - return Enumerable.Empty(); - } - - return GetValueCompletionsForType(declaredTypeAssignment.Reference.Type, context.ReplacementRange); - } - - private IEnumerable GetArrayItemCompletions(SemanticModel model, BicepCompletionContext context) - { - if (!context.Kind.HasFlag(BicepCompletionContextKind.ArrayItem)) - { - return Enumerable.Empty(); - } - - var declaredTypeAssignment = GetDeclaredTypeAssignment(model, context.Array); - if (declaredTypeAssignment == null || !(declaredTypeAssignment.Reference.Type is ArrayType arrayType)) - { - return Enumerable.Empty(); - } - - return GetValueCompletionsForType(arrayType.Item.Type, context.ReplacementRange); - } - - private static IEnumerable GetValueCompletionsForType(TypeSymbol? propertyType, Range replacementRange) - { - switch (propertyType) - { - case PrimitiveType _ when ReferenceEquals(propertyType, LanguageConstants.Bool): - yield return CreateKeywordCompletion(LanguageConstants.TrueKeyword, LanguageConstants.TrueKeyword, replacementRange, preselect: true, CompletionPriority.High); - yield return CreateKeywordCompletion(LanguageConstants.FalseKeyword, LanguageConstants.FalseKeyword, replacementRange, preselect: true, CompletionPriority.High); - - break; - - case StringLiteralType stringLiteral: - yield return CompletionItemBuilder.Create(CompletionItemKind.EnumMember) - .WithLabel(stringLiteral.Name) - .WithPlainTextEdit(replacementRange, stringLiteral.Name) - .WithDetail(stringLiteral.Name) - .Preselect() - .WithSortText(GetSortText(stringLiteral.Name, CompletionPriority.Medium)); - - break; - - case ArrayType _: - const string arrayLabel = "[]"; - yield return CompletionItemBuilder.Create(CompletionItemKind.Value) - .WithLabel(arrayLabel) - .WithSnippetEdit(replacementRange, "[\n\t$0\n]", InsertTextMode.AdjustIndentation) - .WithDetail(arrayLabel) - .Preselect() - .WithSortText(GetSortText(arrayLabel, CompletionPriority.High)); - - break; - - case DiscriminatedObjectType _: - case ObjectType _: - yield return CreateObjectBodyCompletion(replacementRange); - break; - - case UnionType union: - var aggregatedCompletions = union.Members.SelectMany(typeRef => GetValueCompletionsForType(typeRef.Type, replacementRange)); - foreach (var completion in aggregatedCompletions) - { - yield return completion; - } - - break; - } - } - - private static CompletionItem CreateObjectBodyCompletion(Range replacementRange) - { - const string objectLabel = "{}"; - return CompletionItemBuilder.Create(CompletionItemKind.Value) - .WithLabel(objectLabel) - .WithSnippetEdit(replacementRange, "{\n\t$0\n}", InsertTextMode.AdjustIndentation) - .WithDetail(objectLabel) - .Preselect() - .WithSortText(GetSortText(objectLabel, CompletionPriority.High)); - } - - private static CompletionItem CreatePropertyNameCompletion(TypeProperty property, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) => - CompletionItemBuilder.Create(CompletionItemKind.Property) - .WithLabel(property.Name) - // property names containg spaces need to be escaped - .WithPlainTextEdit(replacementRange, IsPropertyNameEscapingRequired(property) ? StringUtils.EscapeBicepString(property.Name) : property.Name) - .WithCommitCharacters(PropertyCommitChars) - .WithDetail(FormatPropertyDetail(property)) - .WithDocumentation(FormatPropertyDocumentation(property)) - .WithSortText(GetSortText(property.Name, priority)); - - private static CompletionItem CreatePropertyIndexCompletion(TypeProperty property, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) - { - var escaped = StringUtils.EscapeBicepString(property.Name); - return CompletionItemBuilder.Create(CompletionItemKind.Property) - .WithLabel(escaped) - .WithPlainTextEdit(replacementRange, escaped) - .WithDetail(FormatPropertyDetail(property)) - .WithDocumentation(FormatPropertyDocumentation(property)) - .WithSortText(GetSortText(escaped, priority)); - } - - private static CompletionItem CreatePropertyAccessCompletion(TypeProperty property, SyntaxTree tree, PropertyAccessSyntax propertyAccess, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) - { - var item = CompletionItemBuilder.Create(CompletionItemKind.Property) - .WithLabel(property.Name) - .WithCommitCharacters(PropertyAccessCommitChars) - .WithDetail(FormatPropertyDetail(property)) - .WithDocumentation(FormatPropertyDocumentation(property)) - .WithSortText(GetSortText(property.Name, priority)); - - if (IsPropertyNameEscapingRequired(property)) - { - // the property requires escaping because it does not comply with bicep identifier rules - // in bicep those types of properties are accessed via array indexer using a string as an index - // if we update the main edit of the completion, vs code will not show such a completion at all - // thus we will append additional text edits to replace the . with a [ and to insert the closing ] - item - .WithPlainTextEdit(replacementRange, $"[{StringUtils.EscapeBicepString(property.Name)}]") - .WithAdditionalEdits(new TextEditContainer( - // remove the dot after the main text edit is applied - new TextEdit - { - NewText = string.Empty, - Range = propertyAccess.Dot.ToRange(tree.LineStarts) - })); - } - else - { - item.WithPlainTextEdit(replacementRange, property.Name); - } - - return item; - } - - private static CompletionItem CreateKeywordCompletion(string keyword, string detail, Range replacementRange, bool preselect = false, CompletionPriority priority = CompletionPriority.Medium) => - CompletionItemBuilder.Create(CompletionItemKind.Keyword) - .WithLabel(keyword) - .WithPlainTextEdit(replacementRange, keyword) - .WithDetail(detail) - .Preselect(preselect) - .WithSortText(GetSortText(keyword, priority)); - - private static CompletionItem CreateTypeCompletion(TypeSymbol type, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) => - CompletionItemBuilder.Create(CompletionItemKind.Class) - .WithLabel(type.Name) - .WithPlainTextEdit(replacementRange, type.Name) - .WithDetail(type.Name) - .WithSortText(GetSortText(type.Name, priority)); - - private static CompletionItem CreateResourceTypeCompletion(ResourceTypeReference resourceType, int index, Range replacementRange) - { - var insertText = StringUtils.EscapeBicepString($"{resourceType.FullyQualifiedType}@{resourceType.ApiVersion}"); - return CompletionItemBuilder.Create(CompletionItemKind.Class) - .WithLabel(insertText) - .WithPlainTextEdit(replacementRange, insertText) - .WithDocumentation($"Namespace: `{resourceType.Namespace}`{MarkdownNewLine}Type: `{resourceType.TypesString}`{MarkdownNewLine}API Version: `{resourceType.ApiVersion}`") - // 8 hex digits is probably overkill :) - .WithSortText(index.ToString("x8")); - } - - private static CompletionItem CreateModulePathCompletion(string name, string path, Range replacementRange, CompletionItemKind completionItemKind, CompletionPriority priority) - { - path = StringUtils.EscapeBicepString(path); - var item = CompletionItemBuilder.Create(completionItemKind) - .WithLabel(name) - .WithFilterText(path) - .WithSortText(GetSortText(name, priority)); - // Folder completions should keep us within the completion string - if (completionItemKind.Equals(CompletionItemKind.Folder)) - { - item.WithSnippetEdit(replacementRange, $"{path.Substring(0, path.Length - 1)}$0'"); - } - else - { - item = item.WithPlainTextEdit(replacementRange, path); - } - return item; - } - - /// - /// Creates a completion with a contextual snippet. This will look like a snippet to the user. - /// - private static CompletionItem CreateContextualSnippetCompletion(string label, string detail, string snippet, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) => - CompletionItemBuilder.Create(CompletionItemKind.Snippet) - .WithLabel(label) - .WithSnippetEdit(replacementRange, snippet) - .WithDetail(detail) - .WithDocumentation($"```bicep\n{new Snippet(snippet).FormatDocumentation()}\n```") - .WithSortText(GetSortText(label, priority)); - - private static CompletionItem CreateSymbolCompletion(Symbol symbol, Range replacementRange, string? insertText = null) - { - insertText ??= symbol.Name; - var kind = GetCompletionItemKind(symbol); - var priority = GetCompletionPriority(symbol); - - var completion = CompletionItemBuilder.Create(kind) - .WithLabel(insertText) - .WithSortText(GetSortText(insertText, priority)); - - if (symbol is FunctionSymbol function) - { - // for functions without any parameters on all the overloads, we should be placing the cursor after the parentheses - // for all other functions, the cursor should land between the parentheses so the user can specify the arguments - bool hasParameters = function.Overloads.Any(overload => overload.HasParameters); - var snippet = hasParameters - ? $"{insertText}($0)" - : $"{insertText}()$0"; - - if (hasParameters) - { - // if parameters may need to be specified, automatically request signature help - completion.WithCommand(new Command {Name = EditorCommands.SignatureHelp}); - } - - return completion - .WithDetail($"{insertText}()") - .WithSnippetEdit(replacementRange, snippet); - } - - return completion - .WithDetail(insertText) - .WithPlainTextEdit(replacementRange, insertText); - } - - // the priority must be a number in the sort text - private static string GetSortText(string label, CompletionPriority priority) => $"{(int)priority}_{label}"; - - private static CompletionPriority GetCompletionPriority(Symbol symbol) => - symbol.Kind switch - { - SymbolKind.Function => CompletionPriority.Low, - SymbolKind.Namespace => CompletionPriority.Low, - _ => CompletionPriority.Medium - }; - - private static CompletionItemKind GetCompletionItemKind(Symbol symbol) => - symbol.Kind switch - { - SymbolKind.Function => CompletionItemKind.Function, - SymbolKind.File => CompletionItemKind.File, - SymbolKind.Variable => CompletionItemKind.Variable, - SymbolKind.Namespace => CompletionItemKind.Folder, - SymbolKind.Output => CompletionItemKind.Value, - SymbolKind.Parameter => CompletionItemKind.Field, - SymbolKind.Resource => CompletionItemKind.Interface, - SymbolKind.Module => CompletionItemKind.Module, - _ => CompletionItemKind.Text - }; - - private static bool IsPropertyNameEscapingRequired(TypeProperty property) => - !Lexer.IsValidIdentifier(property.Name) || LanguageConstants.Keywords.ContainsKey(property.Name); - - private static string FormatPropertyDetail(TypeProperty property) => - property.Flags.HasFlag(TypePropertyFlags.Required) - ? $"{property.Name} (Required)" - : property.Name; - - private static string FormatPropertyDocumentation(TypeProperty property) - { - var buffer = new StringBuilder(); - - buffer.Append($"Type: `{property.TypeReference.Type}`{MarkdownNewLine}"); - - if (property.Flags.HasFlag(TypePropertyFlags.ReadOnly)) - { - // this case will be used for dot property access completions - // this flag is not possible in property name completions - buffer.Append($"Read-only property{MarkdownNewLine}"); - } - - if (property.Flags.HasFlag(TypePropertyFlags.WriteOnly)) - { - buffer.Append($"Write-only property{MarkdownNewLine}"); - } - - if (property.Flags.HasFlag(TypePropertyFlags.Constant)) - { - buffer.Append($"Requires a compile-time constant value.{MarkdownNewLine}"); - } - - return buffer.ToString(); - } - } + private IEnumerable GetMemberAccessCompletions(Compilation compilation, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.MemberAccess) || context.PropertyAccess == null) + { + return Enumerable.Empty(); + } + + var declaredType = compilation.GetEntrypointSemanticModel().GetDeclaredType(context.PropertyAccess.BaseExpression); + + if (context.Kind.HasFlag(BicepCompletionContextKind.DecoratorName) && declaredType is NamespaceType namespaceType) + { + var model = compilation.GetEntrypointSemanticModel(); + var enclosingDeclarationSymbol = context.EnclosingDeclaration is null ? null : model.GetSymbolInfo(context.EnclosingDeclaration); + + return GetAccessibleDecoratorFunctions(namespaceType, enclosingDeclarationSymbol) + .Select(symbol => CreateSymbolCompletion(symbol, context.ReplacementRange)); + } + + return GetProperties(declaredType) + .Where(p => !p.Flags.HasFlag(TypePropertyFlags.WriteOnly)) + .Select(p => CreatePropertyAccessCompletion(p, compilation.SyntaxTreeGrouping.EntryPoint, context.PropertyAccess, context.ReplacementRange)) + .Concat(GetMethods(declaredType) + .Select(m => CreateSymbolCompletion(m, context.ReplacementRange))); + } + + private IEnumerable GetArrayIndexCompletions(Compilation compilation, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.ArrayIndex) || context.ArrayAccess == null) + { + return Enumerable.Empty(); + } + + var declaredType = compilation.GetEntrypointSemanticModel().GetDeclaredType(context.ArrayAccess.BaseExpression); + + return GetProperties(declaredType) + .Where(p => !p.Flags.HasFlag(TypePropertyFlags.WriteOnly)) + .Select(p => CreatePropertyIndexCompletion(p, context.ReplacementRange, CompletionPriority.High)); + } + + private IEnumerable GetObjectPropertyNameCompletions(SemanticModel model, BicepCompletionContext context) + { + if (context.Kind.HasFlag(BicepCompletionContextKind.ObjectPropertyName) == false || context.Object == null) + { + return Enumerable.Empty(); + } + + // in order to provide completions for property names, + // we need to establish the type of the object first + var declaredType = model.GetDeclaredType(context.Object); + if (declaredType == null) + { + return Enumerable.Empty(); + } + + var specifiedPropertyNames = context.Object.ToKnownPropertyNames(); + + // exclude read-only properties as they can't be set + // exclude properties whose name has been specified in the object already + return GetProperties(declaredType) + .Where(p => !p.Flags.HasFlag(TypePropertyFlags.ReadOnly) && specifiedPropertyNames.Contains(p.Name) == false) + .Select(p => CreatePropertyNameCompletion(p, context.ReplacementRange)); + } + + private static IEnumerable GetProperties(TypeSymbol? type) + { + switch (type) + { + case ResourceType resourceType: + return GetProperties(resourceType.Body.Type); + + case ModuleType moduleType: + return GetProperties(moduleType.Body.Type); + + case ObjectType objectType: + return objectType.Properties.Values; + + case DiscriminatedObjectType discriminated: + return discriminated.DiscriminatorProperty.AsEnumerable(); + + default: + return Enumerable.Empty(); + } + } + + private static IEnumerable GetMethods(TypeSymbol? type) => + type is ObjectType objectType + ? objectType.MethodResolver.GetKnownFunctions().Values + : Enumerable.Empty(); + + private static DeclaredTypeAssignment? GetDeclaredTypeAssignment(SemanticModel model, SyntaxBase? syntax) => syntax == null + ? null + : model.GetDeclaredTypeAssignment(syntax); + + private IEnumerable GetPropertyValueCompletions(SemanticModel model, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.PropertyValue)) + { + return Enumerable.Empty(); + } + + var declaredTypeAssignment = GetDeclaredTypeAssignment(model, context.Property); + if (declaredTypeAssignment == null) + { + return Enumerable.Empty(); + } + + return GetValueCompletionsForType(declaredTypeAssignment.Reference.Type, context.ReplacementRange); + } + + private IEnumerable GetArrayItemCompletions(SemanticModel model, BicepCompletionContext context) + { + if (!context.Kind.HasFlag(BicepCompletionContextKind.ArrayItem)) + { + return Enumerable.Empty(); + } + + var declaredTypeAssignment = GetDeclaredTypeAssignment(model, context.Array); + if (declaredTypeAssignment == null || !(declaredTypeAssignment.Reference.Type is ArrayType arrayType)) + { + return Enumerable.Empty(); + } + + return GetValueCompletionsForType(arrayType.Item.Type, context.ReplacementRange); + } + + private static IEnumerable GetValueCompletionsForType(TypeSymbol? propertyType, Range replacementRange) + { + switch (propertyType) + { + case PrimitiveType _ when ReferenceEquals(propertyType, LanguageConstants.Bool): + yield return CreateKeywordCompletion(LanguageConstants.TrueKeyword, LanguageConstants.TrueKeyword, replacementRange, preselect: true, CompletionPriority.High); + yield return CreateKeywordCompletion(LanguageConstants.FalseKeyword, LanguageConstants.FalseKeyword, replacementRange, preselect: true, CompletionPriority.High); + + break; + + case StringLiteralType stringLiteral: + yield return CompletionItemBuilder.Create(CompletionItemKind.EnumMember) + .WithLabel(stringLiteral.Name) + .WithPlainTextEdit(replacementRange, stringLiteral.Name) + .WithDetail(stringLiteral.Name) + .Preselect() + .WithSortText(GetSortText(stringLiteral.Name, CompletionPriority.Medium)); + + break; + + case ArrayType _: + const string arrayLabel = "[]"; + yield return CompletionItemBuilder.Create(CompletionItemKind.Value) + .WithLabel(arrayLabel) + .WithSnippetEdit(replacementRange, "[\n\t$0\n]", InsertTextMode.AdjustIndentation) + .WithDetail(arrayLabel) + .Preselect() + .WithSortText(GetSortText(arrayLabel, CompletionPriority.High)); + + break; + + case DiscriminatedObjectType _: + case ObjectType _: + yield return CreateObjectBodyCompletion(replacementRange); + break; + + case UnionType union: + var aggregatedCompletions = union.Members.SelectMany(typeRef => GetValueCompletionsForType(typeRef.Type, replacementRange)); + foreach (var completion in aggregatedCompletions) + { + yield return completion; + } + + break; + } + } + + private static CompletionItem CreateObjectBodyCompletion(Range replacementRange) + { + const string objectLabel = "{}"; + return CompletionItemBuilder.Create(CompletionItemKind.Value) + .WithLabel(objectLabel) + .WithSnippetEdit(replacementRange, "{\n\t$0\n}", InsertTextMode.AdjustIndentation) + .WithDetail(objectLabel) + .Preselect() + .WithSortText(GetSortText(objectLabel, CompletionPriority.High)); + } + + private static CompletionItem CreatePropertyNameCompletion(TypeProperty property, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) => + CompletionItemBuilder.Create(CompletionItemKind.Property) + .WithLabel(property.Name) + // property names containg spaces need to be escaped + .WithPlainTextEdit(replacementRange, IsPropertyNameEscapingRequired(property) ? StringUtils.EscapeBicepString(property.Name) : property.Name) + .WithCommitCharacters(PropertyCommitChars) + .WithDetail(FormatPropertyDetail(property)) + .WithDocumentation(FormatPropertyDocumentation(property)) + .WithSortText(GetSortText(property.Name, priority)); + + private static CompletionItem CreatePropertyIndexCompletion(TypeProperty property, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) + { + var escaped = StringUtils.EscapeBicepString(property.Name); + return CompletionItemBuilder.Create(CompletionItemKind.Property) + .WithLabel(escaped) + .WithPlainTextEdit(replacementRange, escaped) + .WithDetail(FormatPropertyDetail(property)) + .WithDocumentation(FormatPropertyDocumentation(property)) + .WithSortText(GetSortText(escaped, priority)); + } + + private static CompletionItem CreatePropertyAccessCompletion(TypeProperty property, SyntaxTree tree, PropertyAccessSyntax propertyAccess, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) + { + var item = CompletionItemBuilder.Create(CompletionItemKind.Property) + .WithLabel(property.Name) + .WithCommitCharacters(PropertyAccessCommitChars) + .WithDetail(FormatPropertyDetail(property)) + .WithDocumentation(FormatPropertyDocumentation(property)) + .WithSortText(GetSortText(property.Name, priority)); + + if (IsPropertyNameEscapingRequired(property)) + { + // the property requires escaping because it does not comply with bicep identifier rules + // in bicep those types of properties are accessed via array indexer using a string as an index + // if we update the main edit of the completion, vs code will not show such a completion at all + // thus we will append additional text edits to replace the . with a [ and to insert the closing ] + item + .WithPlainTextEdit(replacementRange, $"[{StringUtils.EscapeBicepString(property.Name)}]") + .WithAdditionalEdits(new TextEditContainer( + // remove the dot after the main text edit is applied + new TextEdit + { + NewText = string.Empty, + Range = propertyAccess.Dot.ToRange(tree.LineStarts) + })); + } + else + { + item.WithPlainTextEdit(replacementRange, property.Name); + } + + return item; + } + + private static CompletionItem CreateKeywordCompletion(string keyword, string detail, Range replacementRange, bool preselect = false, CompletionPriority priority = CompletionPriority.Medium) => + CompletionItemBuilder.Create(CompletionItemKind.Keyword) + .WithLabel(keyword) + .WithPlainTextEdit(replacementRange, keyword) + .WithDetail(detail) + .Preselect(preselect) + .WithSortText(GetSortText(keyword, priority)); + + private static CompletionItem CreateTypeCompletion(TypeSymbol type, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) => + CompletionItemBuilder.Create(CompletionItemKind.Class) + .WithLabel(type.Name) + .WithPlainTextEdit(replacementRange, type.Name) + .WithDetail(type.Name) + .WithSortText(GetSortText(type.Name, priority)); + + private static CompletionItem CreateResourceTypeCompletion(ResourceTypeReference resourceType, int index, Range replacementRange) + { + var insertText = StringUtils.EscapeBicepString($"{resourceType.FullyQualifiedType}@{resourceType.ApiVersion}"); + return CompletionItemBuilder.Create(CompletionItemKind.Class) + .WithLabel(insertText) + .WithPlainTextEdit(replacementRange, insertText) + .WithDocumentation($"Namespace: `{resourceType.Namespace}`{MarkdownNewLine}Type: `{resourceType.TypesString}`{MarkdownNewLine}API Version: `{resourceType.ApiVersion}`") + // 8 hex digits is probably overkill :) + .WithSortText(index.ToString("x8")); + } + + private static CompletionItem CreateModulePathCompletion(string name, string path, Range replacementRange, CompletionItemKind completionItemKind, CompletionPriority priority) + { + path = StringUtils.EscapeBicepString(path); + var item = CompletionItemBuilder.Create(completionItemKind) + .WithLabel(name) + .WithFilterText(path) + .WithSortText(GetSortText(name, priority)); + // Folder completions should keep us within the completion string + if (completionItemKind.Equals(CompletionItemKind.Folder)) + { + item.WithSnippetEdit(replacementRange, $"{path.Substring(0, path.Length - 1)}$0'"); + } + else + { + item = item.WithPlainTextEdit(replacementRange, path); + } + return item; + } + + /// + /// Creates a completion with a contextual snippet. This will look like a snippet to the user. + /// + private static CompletionItem CreateContextualSnippetCompletion(string label, string detail, string snippet, Range replacementRange, CompletionPriority priority = CompletionPriority.Medium) => + CompletionItemBuilder.Create(CompletionItemKind.Snippet) + .WithLabel(label) + .WithSnippetEdit(replacementRange, snippet) + .WithDetail(detail) + .WithDocumentation($"```bicep\n{new Snippet(snippet).FormatDocumentation()}\n```") + .WithSortText(GetSortText(label, priority)); + + private static CompletionItem CreateSymbolCompletion(Symbol symbol, Range replacementRange, string? insertText = null) + { + insertText ??= symbol.Name; + var kind = GetCompletionItemKind(symbol); + var priority = GetCompletionPriority(symbol); + + var completion = CompletionItemBuilder.Create(kind) + .WithLabel(insertText) + .WithSortText(GetSortText(insertText, priority)); + + if (symbol is FunctionSymbol function) + { + // for functions without any parameters on all the overloads, we should be placing the cursor after the parentheses + // for all other functions, the cursor should land between the parentheses so the user can specify the arguments + bool hasParameters = function.Overloads.Any(overload => overload.HasParameters); + var snippet = hasParameters + ? $"{insertText}($0)" + : $"{insertText}()$0"; + + if (hasParameters) + { + // if parameters may need to be specified, automatically request signature help + completion.WithCommand(new Command {Name = EditorCommands.SignatureHelp}); + } + + return completion + .WithDetail($"{insertText}()") + .WithSnippetEdit(replacementRange, snippet); + } + + return completion + .WithDetail(insertText) + .WithPlainTextEdit(replacementRange, insertText); + } + + // the priority must be a number in the sort text + private static string GetSortText(string label, CompletionPriority priority) => $"{(int)priority}_{label}"; + + private static CompletionPriority GetCompletionPriority(Symbol symbol) => + symbol.Kind switch + { + SymbolKind.Function => CompletionPriority.Low, + SymbolKind.Namespace => CompletionPriority.Low, + _ => CompletionPriority.Medium + }; + + private static CompletionItemKind GetCompletionItemKind(Symbol symbol) => + symbol.Kind switch + { + SymbolKind.Function => CompletionItemKind.Function, + SymbolKind.File => CompletionItemKind.File, + SymbolKind.Variable => CompletionItemKind.Variable, + SymbolKind.Namespace => CompletionItemKind.Folder, + SymbolKind.Output => CompletionItemKind.Value, + SymbolKind.Parameter => CompletionItemKind.Field, + SymbolKind.Resource => CompletionItemKind.Interface, + SymbolKind.Module => CompletionItemKind.Module, + SymbolKind.Local => CompletionItemKind.Variable, + + _ => CompletionItemKind.Text + }; + + private static bool IsPropertyNameEscapingRequired(TypeProperty property) => + !Lexer.IsValidIdentifier(property.Name) || LanguageConstants.Keywords.ContainsKey(property.Name); + + private static string FormatPropertyDetail(TypeProperty property) => + property.Flags.HasFlag(TypePropertyFlags.Required) + ? $"{property.Name} (Required)" + : property.Name; + + private static string FormatPropertyDocumentation(TypeProperty property) + { + var buffer = new StringBuilder(); + + buffer.Append($"Type: `{property.TypeReference.Type}`{MarkdownNewLine}"); + + if (property.Flags.HasFlag(TypePropertyFlags.ReadOnly)) + { + // this case will be used for dot property access completions + // this flag is not possible in property name completions + buffer.Append($"Read-only property{MarkdownNewLine}"); + } + + if (property.Flags.HasFlag(TypePropertyFlags.WriteOnly)) + { + buffer.Append($"Write-only property{MarkdownNewLine}"); + } + + if (property.Flags.HasFlag(TypePropertyFlags.Constant)) + { + buffer.Append($"Requires a compile-time constant value.{MarkdownNewLine}"); + } + + return buffer.ToString(); + } + } } \ No newline at end of file diff --git a/src/Bicep.LangServer/Handlers/BicepCompletionHandler.cs b/src/Bicep.LangServer/Handlers/BicepCompletionHandler.cs index d140da1c377..a4c0e1e20f5 100644 --- a/src/Bicep.LangServer/Handlers/BicepCompletionHandler.cs +++ b/src/Bicep.LangServer/Handlers/BicepCompletionHandler.cs @@ -37,7 +37,7 @@ public override Task Handle(CompletionParams request, Cancellati } int offset = PositionHelper.GetOffset(compilationContext.LineStarts, request.Position); - var completionContext = BicepCompletionContext.Create(compilationContext.Compilation.SyntaxTreeGrouping.EntryPoint, offset); + var completionContext = BicepCompletionContext.Create(compilationContext.Compilation, offset); var completions = Enumerable.Empty(); try {