`no-loc-expr-outside-params` rule hides errors
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 81
Description
**Bicep version**
VS Code v0.6.18
**Describe the bug**
The `no-loc-expr-outside-params` analyzer will fire on expressions even if they're invalid in the current scope. (e.g. `resourceGroup().location` in a subscription scope). This expression is then highlighted as a warning rather than an error, hiding the underlying error
**To Reproduce**
In the below example, the `no-loc-expr-outside-param` reports a warning, however Iw ouldn't expect the warnign to be logged at all as the entire expression is invalid in the current (subscription) scope.
``` bicep
targetScope='subscription'
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
location: resourceGroup().location
}
```

**Additional context**
Add any other context about the problem here.
Contributor guide
Research direction
Reproduce the subscription-scope example in VS Code with Bicep v0.6.18 and inspect the no-loc-expr-outside-params analyzer. Trace how it handles the invalid resourceGroup().location expression; done means the analyzer warning is absent while the underlying scope error remains visible.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100