Skip to content

Don't crash when nonexistent symbol is used with external inputs#19260

Merged
levimatheri merged 3 commits intomainfrom
levi/fix-crash-nonexistent-symbol
Mar 23, 2026
Merged

Don't crash when nonexistent symbol is used with external inputs#19260
levimatheri merged 3 commits intomainfrom
levi/fix-crash-nonexistent-symbol

Conversation

@levimatheri
Copy link
Contributor

@levimatheri levimatheri commented Mar 23, 2026

Description

Below code was crashing language server due to unhandled exception when analyzing external input functions.
Updated InlineParameterRewriter to explicity throw ExpressionException so it can be caught and handled gracefully during external input analysis.

import { myVar, helperFunction } from 'main.bicep' // imported symbols don't exist in 'main.bicep'

param p12 = '${myVar}-${helperFunction()}-${externalInput('custom')}'

Checklist

Microsoft Reviewers: Open in CodeFlow

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

Test this change out locally with the following install scripts (Action run 23461144937)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 23461144937
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 23461144937"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 23461144937
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 23461144937"

@levimatheri levimatheri merged commit 93045ea into main Mar 23, 2026
79 of 80 checks passed
@levimatheri levimatheri deleted the levi/fix-crash-nonexistent-symbol branch March 23, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants