Skip to content

Commit

Permalink
Changed some name references as agreed in PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Lapointe committed Feb 2, 2022
1 parent 6da5ec3 commit 7caef0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ var invalidEnvironmentVar = environment().aosdufhsad
//@[42:52) [BCP053 (Error)] The type "environment" does not contain property "aosdufhsad". Available properties include "activeDirectoryDataLake", "authentication", "batch", "gallery", "graph", "graphAudience", "media", "name", "portal", "resourceManager", "sqlManagement", "suffixes", "vmImageAliasDoc". (CodeDescription: none) |aosdufhsad|
var invalidEnvAuthVar = environment().authentication.asdgdsag
//@[4:21) [no-unused-vars (Warning)] Variable "invalidEnvAuthVar" is declared but never used. (CodeDescription: bicep core(https://aka.ms/bicep/linter/no-unused-vars)) |invalidEnvAuthVar|
//@[53:61) [BCP053 (Error)] The type "authentication" does not contain property "asdgdsag". Available properties include "audiences", "identityProvider", "loginEndpoint", "tenant". (CodeDescription: none) |asdgdsag|
//@[53:61) [BCP053 (Error)] The type "authenticationProperties" does not contain property "asdgdsag". Available properties include "audiences", "identityProvider", "loginEndpoint", "tenant". (CodeDescription: none) |asdgdsag|

// invalid use of reserved namespace
var az = 1
Expand Down
13 changes: 7 additions & 6 deletions src/Bicep.Core/Semantics/Namespaces/AzNamespaceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ private static ObjectType GetTenantReturnType(IBinder binder, IFileResolver file

private static ObjectType GetManagementGroupReturnType(IBinder binder, IFileResolver fileResolver, IDiagnosticWriter diagnostics, ImmutableArray<FunctionArgumentSyntax> arguments, ImmutableArray<TypeSymbol> argumentTypes)
{
var summary = new ObjectType("summary", TypeSymbolValidationFlags.Default, new[]
var summary = new ObjectType("summaryProperties", TypeSymbolValidationFlags.Default, new[]
{
new TypeProperty("id", LanguageConstants.String),
new TypeProperty("name", LanguageConstants.String),
new TypeProperty("type", LanguageConstants.String),
}, null);

var details = new ObjectType("details", TypeSymbolValidationFlags.Default, new[]
var details = new ObjectType("detailsProperties", TypeSymbolValidationFlags.Default, new[]
{
new TypeProperty("version", LanguageConstants.String),
new TypeProperty("updatedTime", LanguageConstants.String),
Expand Down Expand Up @@ -137,7 +137,7 @@ private static ObjectType GetEnvironmentReturnType()
return new ObjectType("environment", TypeSymbolValidationFlags.Default, new[]
{
new TypeProperty("activeDirectoryDataLake", LanguageConstants.String),
new TypeProperty("authentication", new ObjectType("authentication", TypeSymbolValidationFlags.Default, new []
new TypeProperty("authentication", new ObjectType("authenticationProperties", TypeSymbolValidationFlags.Default, new []
{
new TypeProperty("audiences", new TypedArrayType(LanguageConstants.String, TypeSymbolValidationFlags.Default)),
new TypeProperty("identityProvider", LanguageConstants.String),
Expand All @@ -153,7 +153,7 @@ private static ObjectType GetEnvironmentReturnType()
new TypeProperty("portal", LanguageConstants.String),
new TypeProperty("resourceManager", LanguageConstants.String),
new TypeProperty("sqlManagement", LanguageConstants.String),
new TypeProperty("suffixes", new ObjectType("suffixes", TypeSymbolValidationFlags.Default, new []
new TypeProperty("suffixes", new ObjectType("suffixesProperties", TypeSymbolValidationFlags.Default, new []
{
new TypeProperty("acrLoginServer", LanguageConstants.String),
new TypeProperty("azureDatalakeAnalyticsCatalogAndJob", LanguageConstants.String),
Expand All @@ -172,16 +172,17 @@ private static ObjectType GetDeploymentReturnType(ResourceScope targetScope)
// Note: there are other properties which could be included here, but they allow you to break out of the bicep world.
// We're going to omit them and only include what is truly necessary. If we get feature requests to expose more properties, we should discuss this further.
// Properties such as 'template', 'templateHash', 'parameters' depend on the codegen, and feel like they could be fragile.
// template.contentVersion was requested in issue #3114
IEnumerable<TypeProperty> properties = new[]
{
new TypeProperty("name", LanguageConstants.String),
new TypeProperty("properties", new ObjectType("properties", TypeSymbolValidationFlags.Default, new []
{
new TypeProperty("template", new ObjectType("properties", TypeSymbolValidationFlags.Default, new []
new TypeProperty("template", new ObjectType("templateProperties", TypeSymbolValidationFlags.Default, new []
{
new TypeProperty("contentVersion", LanguageConstants.String)
}, null)),
new TypeProperty("templateLink", new ObjectType("properties", TypeSymbolValidationFlags.Default, new []
new TypeProperty("templateLink", new ObjectType("templateLinkProperties", TypeSymbolValidationFlags.Default, new []
{
new TypeProperty("id", LanguageConstants.String),
new TypeProperty("uri", LanguageConstants.String),
Expand Down

0 comments on commit 7caef0c

Please sign in to comment.