Skip to content

Commit 53d0ac6

Browse files
committed
Fix test failures
1 parent a5eec68 commit 53d0ac6

File tree

8 files changed

+8
-133
lines changed

8 files changed

+8
-133
lines changed

src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decorators.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -238,26 +238,5 @@
238238
"range": {},
239239
"newText": "secure()$0"
240240
}
241-
},
242-
{
243-
"label": "validate",
244-
"kind": "function",
245-
"documentation": {
246-
"kind": "markdown",
247-
"value": "```bicep\nvalidate(predicate: any => bool, [errorMessage: string]): any\n\n``` \n \n"
248-
},
249-
"deprecated": false,
250-
"preselect": false,
251-
"sortText": "3_validate",
252-
"insertTextFormat": "snippet",
253-
"insertTextMode": "adjustIndentation",
254-
"textEdit": {
255-
"range": {},
256-
"newText": "validate($0)"
257-
},
258-
"command": {
259-
"title": "signature help",
260-
"command": "editor.action.triggerParameterHints"
261-
}
262241
}
263242
]

src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decoratorsPlusNamespace.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -256,26 +256,5 @@
256256
"title": "symbol completion",
257257
"command": "editor.action.triggerSuggest"
258258
}
259-
},
260-
{
261-
"label": "validate",
262-
"kind": "function",
263-
"documentation": {
264-
"kind": "markdown",
265-
"value": "```bicep\nvalidate(predicate: any => bool, [errorMessage: string]): any\n\n``` \n \n"
266-
},
267-
"deprecated": false,
268-
"preselect": false,
269-
"sortText": "3_validate",
270-
"insertTextFormat": "snippet",
271-
"insertTextMode": "adjustIndentation",
272-
"textEdit": {
273-
"range": {},
274-
"newText": "validate($0)"
275-
},
276-
"command": {
277-
"title": "signature help",
278-
"command": "editor.action.triggerParameterHints"
279-
}
280259
}
281260
]

src/Bicep.Core.Samples/Files/baselines/InvalidParameters_LF/Completions/intParameterDecorators.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,5 @@
103103
"title": "signature help",
104104
"command": "editor.action.triggerParameterHints"
105105
}
106-
},
107-
{
108-
"label": "validate",
109-
"kind": "function",
110-
"documentation": {
111-
"kind": "markdown",
112-
"value": "```bicep\nvalidate(predicate: any => bool, [errorMessage: string]): any\n\n``` \n \n"
113-
},
114-
"deprecated": false,
115-
"preselect": false,
116-
"sortText": "3_validate",
117-
"insertTextFormat": "snippet",
118-
"insertTextMode": "adjustIndentation",
119-
"textEdit": {
120-
"range": {},
121-
"newText": "validate($0)"
122-
},
123-
"command": {
124-
"title": "signature help",
125-
"command": "editor.action.triggerParameterHints"
126-
}
127106
}
128107
]

src/Bicep.Core.Samples/Files/baselines/InvalidParameters_LF/Completions/intParameterDecoratorsPlusNamespace.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,5 @@
121121
"title": "symbol completion",
122122
"command": "editor.action.triggerSuggest"
123123
}
124-
},
125-
{
126-
"label": "validate",
127-
"kind": "function",
128-
"documentation": {
129-
"kind": "markdown",
130-
"value": "```bicep\nvalidate(predicate: any => bool, [errorMessage: string]): any\n\n``` \n \n"
131-
},
132-
"deprecated": false,
133-
"preselect": false,
134-
"sortText": "3_validate",
135-
"insertTextFormat": "snippet",
136-
"insertTextMode": "adjustIndentation",
137-
"textEdit": {
138-
"range": {},
139-
"newText": "validate($0)"
140-
},
141-
"command": {
142-
"title": "signature help",
143-
"command": "editor.action.triggerParameterHints"
144-
}
145124
}
146125
]

src/Bicep.Core.Samples/Files/baselines/InvalidParameters_LF/Completions/stringParameterDecorators.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,5 @@
120120
"range": {},
121121
"newText": "secure()$0"
122122
}
123-
},
124-
{
125-
"label": "validate",
126-
"kind": "function",
127-
"documentation": {
128-
"kind": "markdown",
129-
"value": "```bicep\nvalidate(predicate: any => bool, [errorMessage: string]): any\n\n``` \n \n"
130-
},
131-
"deprecated": false,
132-
"preselect": false,
133-
"sortText": "3_validate",
134-
"insertTextFormat": "snippet",
135-
"insertTextMode": "adjustIndentation",
136-
"textEdit": {
137-
"range": {},
138-
"newText": "validate($0)"
139-
},
140-
"command": {
141-
"title": "signature help",
142-
"command": "editor.action.triggerParameterHints"
143-
}
144123
}
145124
]

src/Bicep.Core.Samples/Files/baselines/InvalidParameters_LF/Completions/stringParameterDecoratorsPlusNamespace.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,5 @@
138138
"title": "symbol completion",
139139
"command": "editor.action.triggerSuggest"
140140
}
141-
},
142-
{
143-
"label": "validate",
144-
"kind": "function",
145-
"documentation": {
146-
"kind": "markdown",
147-
"value": "```bicep\nvalidate(predicate: any => bool, [errorMessage: string]): any\n\n``` \n \n"
148-
},
149-
"deprecated": false,
150-
"preselect": false,
151-
"sortText": "3_validate",
152-
"insertTextFormat": "snippet",
153-
"insertTextMode": "adjustIndentation",
154-
"textEdit": {
155-
"range": {},
156-
"newText": "validate($0)"
157-
},
158-
"command": {
159-
"title": "signature help",
160-
"command": "editor.action.triggerParameterHints"
161-
}
162141
}
163142
]

src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,11 +1946,10 @@ public Diagnostic EnvironmentVariableDoesNotExist(string name, string? suggestio
19461946
"BCP427",
19471947
$"Environment variable \"{name}\" does not exist and there's no default value set.{suggestion}");
19481948

1949-
public Diagnostic RuntimeValueNotAllowedInFunctionArgument((string?, string?) parameterMetadata, string? accessedSymbolName, IEnumerable<string>? accessiblePropertyNames, IEnumerable<string>? variableDependencyChain)
1949+
public Diagnostic RuntimeValueNotAllowedInFunctionArgument(string? functionName, string? parameterName, string? accessedSymbolName, IEnumerable<string>? accessiblePropertyNames, IEnumerable<string>? variableDependencyChain)
19501950
{
19511951
var variableDependencyChainClause = BuildVariableDependencyChainClause(variableDependencyChain);
19521952
var accessiblePropertiesClause = BuildAccessiblePropertiesClause(accessedSymbolName, accessiblePropertyNames);
1953-
var (functionName, parameterName) = parameterMetadata;
19541953

19551954
return CoreError(
19561955
"BCP428",

src/Bicep.Core/TypeSystem/DeployTimeConstantViolationVisitor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ ForSyntax forSyntax when ErrorSyntaxInForBodyOfVariable(forSyntax, errorSyntax)
5959
ForSyntax => diagnosticBuilder.RuntimeValueNotAllowedInForExpression(accessedSymbolName, accessiblePropertyNames, variableDependencyChain),
6060
FunctionCallSyntaxBase functionCallSyntaxBase => diagnosticBuilder.RuntimeValueNotAllowedInRunTimeFunctionArguments(functionCallSyntaxBase.Name.IdentifierName, accessedSymbolName, accessiblePropertyNames, variableDependencyChain),
6161
FunctionDeclarationSyntax => diagnosticBuilder.RuntimeValueNotAllowedInFunctionDeclaration(accessedSymbolName, accessiblePropertyNames, variableDependencyChain),
62-
FunctionArgumentSyntax arg => diagnosticBuilder.RuntimeValueNotAllowedInFunctionArgument(
63-
GetFunctionAndParameterName(arg),
64-
accessedSymbolName,
65-
accessiblePropertyNames,
66-
variableDependencyChain),
62+
FunctionArgumentSyntax arg when GetFunctionAndParameterName(arg) is { } parameterMetadata
63+
=> diagnosticBuilder.RuntimeValueNotAllowedInFunctionArgument(
64+
parameterMetadata.functionName,
65+
parameterMetadata.parameterName,
66+
accessedSymbolName,
67+
accessiblePropertyNames,
68+
variableDependencyChain),
6769
_ => throw new ArgumentOutOfRangeException(nameof(this.DeployTimeConstantContainer), "Expected an ObjectPropertySyntax with a propertyName, an IfConditionSyntax, a ForSyntax, a FunctionCallSyntaxBase, or a FunctionDeclarationSyntax."),
6870
};
6971

0 commit comments

Comments
 (0)