-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify output of colorization tests (#260)
* Fix #250, strings vs expressions boundary cases * Simplify output of colorization tests * lint?
- Loading branch information
1 parent
919274d
commit b5286bd
Showing
59 changed files
with
1,466 additions
and
1,206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
{ | ||
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"type": "string" | ||
}, | ||
"networkInterfaceName": { | ||
"type": "string" | ||
}, | ||
"networkSecurityGroupName": { | ||
"type": "string" | ||
}, | ||
"networkSecurityGroupRules": { | ||
"type": "array" | ||
}, | ||
"subnetName": { | ||
"type": "string" | ||
}, | ||
"virtualNetworkName": { | ||
"type": "string" | ||
}, | ||
"addressPrefixes": { | ||
"type": "array" | ||
}, | ||
"subnets": { | ||
"type": "array" | ||
}, | ||
"publicIpAddressName": { | ||
"type": "string" | ||
}, | ||
"publicIpAddressType": { | ||
"type": "string" | ||
}, | ||
"publicIpAddressSku": { | ||
"type": "string" | ||
}, | ||
"virtualMachineName": { | ||
"type": "string" | ||
}, | ||
"osDiskType": { | ||
"type": "string" | ||
}, | ||
"virtualMachineSize": { | ||
"type": "string" | ||
}, | ||
"adminUsername": { | ||
"type": "string" | ||
}, | ||
"adminPassword": { | ||
"type": "secureString" | ||
}, | ||
"diagnosticsStorageAccountName": { | ||
"type": "string" | ||
} | ||
}, | ||
"variables": { | ||
"$TEST": "['test1']", | ||
"vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]", | ||
"subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]" | ||
}, | ||
"resources": [ | ||
{ | ||
"name": "[parameters('networkInterfaceName')]", | ||
"type": "Microsoft.Network/networkInterfaces", | ||
"apiVersion": "2018-10-01", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]", | ||
"[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]", | ||
"[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]" | ||
], | ||
"properties": { | ||
"ipConfigurations": [ | ||
{ | ||
"name": "ipconfig1", | ||
"properties": { | ||
"subnet": { | ||
"id": "[variables('subnetRef')]" | ||
}, | ||
"privateIPAllocationMethod": "Dynamic", | ||
"publicIpAddress": { | ||
"id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]" | ||
} | ||
} | ||
} | ||
], | ||
"networkSecurityGroup": { | ||
"id": "[variables('nsgId')]" | ||
} | ||
}, | ||
"tags": {} | ||
}, | ||
{ | ||
"name": "[parameters('networkSecurityGroupName')]", | ||
"type": "Microsoft.Network/networkSecurityGroups", | ||
"apiVersion": "2018-08-01", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"securityRules": "[parameters('networkSecurityGroupRules')]" | ||
}, | ||
"tags": {} | ||
}, | ||
{ | ||
"name": "[parameters('virtualNetworkName')]", | ||
"type": "Microsoft.Network/virtualNetworks", | ||
"apiVersion": "2018-08-01", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"addressSpace": { | ||
"addressPrefixes": "[parameters('addressPrefixes')]" | ||
}, | ||
"subnets": "[parameters('subnets')]" | ||
}, | ||
"tags": {} | ||
}, | ||
{ | ||
"name": "[parameters('publicIpAddressName')]", | ||
"type": "Microsoft.Network/publicIpAddresses", | ||
"apiVersion": "2018-08-01", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"publicIpAllocationMethod": "[parameters('publicIpAddressType')]" | ||
}, | ||
"sku": { | ||
"name": "[parameters('publicIpAddressSku')]" | ||
}, | ||
"tags": {} | ||
}, | ||
{ | ||
"name": "[parameters('virtualMachineName')]", | ||
"type": "Microsoft.Compute/virtualMachines", | ||
"apiVersion": "2018-06-01", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]" | ||
], | ||
"properties": { | ||
"hardwareProfile": { | ||
"vmSize": "[parameters('virtualMachineSize')]" | ||
}, | ||
"storageProfile": { | ||
"osDisk": { | ||
"createOption": "fromImage", | ||
"managedDisk": { | ||
"storageAccountType": "[parameters('osDiskType')]" | ||
} | ||
}, | ||
"imageReference": { | ||
"publisher": "Canonical", | ||
"offer": "UbuntuServer", | ||
"sku": "18.04-LTS", | ||
"version": "latest" | ||
} | ||
}, | ||
"networkProfile": { | ||
"networkInterfaces": [ | ||
{ | ||
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]" | ||
} | ||
] | ||
}, | ||
"osProfile": { | ||
"computerName": "[parameters('virtualMachineName')]", | ||
"adminUsername": "[parameters('adminUsername')]", | ||
"adminPassword": "[parameters('adminPassword')]" | ||
}, | ||
"diagnosticsProfile": { | ||
"bootDiagnostics": { | ||
"enabled": true, | ||
"$TEST": "['test2']" | ||
} | ||
} | ||
}, | ||
"tags": {} | ||
} | ||
], | ||
"outputs": { | ||
"adminUsername": { | ||
"type": "string", | ||
"value": "[parameters('adminUsername')]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
|
||
// With string literal - all same color (except parens) | ||
"$TEST1": "[variables('myvar')]", | ||
|
||
// With expression - normal expression colors inside 'variables' | ||
"$TEST2": "[variables(concat('myvar', 'a'))]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
TEST STRING: "[a()]]" | ||
"[ source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-expression-start}} | ||
a source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-unknownfunction}} | ||
() source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm meta.function-call.tle.arm {{scope-parentheses-funccall}} | ||
] source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm invalid.illegal.expected-expression.tle.arm | ||
]" source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-expression-end}} | ||
"[ {{scope-expression-start}} | ||
a {{scope-unknownfunction}} | ||
() {{scope-parentheses-funccall}} | ||
] invalid.illegal.expected-expression.tle.arm | ||
]" {{scope-expression-end}} | ||
|
||
TEST STRING: "[a()[]]" | ||
"[ source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-expression-start}} | ||
a source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-unknownfunction}} | ||
() source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm meta.function-call.tle.arm {{scope-parentheses-funccall}} | ||
[] source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm invalid.illegal.empty-array-access.tle.arm | ||
]" source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-expression-end}} | ||
"[ {{scope-expression-start}} | ||
a {{scope-unknownfunction}} | ||
() {{scope-parentheses-funccall}} | ||
[] invalid.illegal.empty-array-access.tle.arm | ||
]" {{scope-expression-end}} | ||
|
||
TEST STRING: "[a()[ ]]" | ||
"[ source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-expression-start}} | ||
a source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-unknownfunction}} | ||
() source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm meta.function-call.tle.arm {{scope-parentheses-funccall}} | ||
[ ] source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm invalid.illegal.empty-array-access.tle.arm | ||
]" source.json meta.structure.dictionary.json meta.arm-deployment-template.json.comments meta.structure.dictionary.value.json.comments meta.expression.tle.arm {{scope-expression-end}} | ||
"[ {{scope-expression-start}} | ||
a {{scope-unknownfunction}} | ||
() {{scope-parentheses-funccall}} | ||
[ ] invalid.illegal.empty-array-access.tle.arm | ||
]" {{scope-expression-end}} |
Oops, something went wrong.