Commit 38a91a1
authored
feat: add support for
Fixes #18370
## Description
The fix ensures that when evaluating parameters from extended files, the
evaluator uses the correct `ExpressionConverter` that corresponds to the
semantic model of the file where the parameter was originally declared.
This allows functions like `loadTextContent()` to resolve file paths
correctly relative to their defining file.
## Example Usage
```bicep
// example.txt
This is an example txt file.
// main.bicep
param foo object
// base.bicepparam
using none
param foo = {
bar: loadTextContent('./example.txt')
}
// main.bicepparam
using './main.bicep'
extends './base.bicepparam'
```
To build the `main.bicepparam`, use the following command;
```shell
dotnet run --project ./src/Bicep.Cli/Bicep.Cli.csproj -- build-params ./main.bicepparam
```
With the fixes in this PR building the bicepparam will succeed.
_PS : `Build_params_with_extends_and_loadTextContent_in_base_succeeds`
test is to ensure the fix works 👍_
## Checklist
- [x] I have read and adhere to the [contribution
guide](https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md).
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/18424)loadTextContent function in extendable parameter files (#18424)1 parent 5d4eca9 commit 38a91a1
File tree
3 files changed
+152
-5
lines changed- src
- Bicep.Cli.IntegrationTests
- Bicep.Core
- Emit
- Intermediate
3 files changed
+152
-5
lines changedLines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1286 | 1352 | | |
1287 | 1353 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
152 | 154 | | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
161 | 225 | | |
162 | 226 | | |
| 227 | + | |
163 | 228 | | |
164 | 229 | | |
165 | 230 | | |
| |||
172 | 237 | | |
173 | 238 | | |
174 | 239 | | |
| 240 | + | |
175 | 241 | | |
176 | 242 | | |
177 | 243 | | |
178 | 244 | | |
179 | 245 | | |
180 | 246 | | |
181 | 247 | | |
182 | | - | |
| 248 | + | |
183 | 249 | | |
184 | 250 | | |
185 | 251 | | |
186 | 252 | | |
187 | 253 | | |
188 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
189 | 270 | | |
190 | 271 | | |
191 | 272 | | |
| |||
195 | 276 | | |
196 | 277 | | |
197 | 278 | | |
198 | | - | |
| 279 | + | |
| 280 | + | |
199 | 281 | | |
200 | 282 | | |
201 | 283 | | |
| |||
212 | 294 | | |
213 | 295 | | |
214 | 296 | | |
215 | | - | |
| 297 | + | |
216 | 298 | | |
217 | 299 | | |
218 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
887 | | - | |
888 | | - | |
| 887 | + | |
889 | 888 | | |
890 | 889 | | |
891 | 890 | | |
| |||
0 commit comments