Skip to content

add support for array splat completion in type syntax and enhance completion context#18948

Merged
polatengin merged 2 commits intomainfrom
polatengin/17610-completion-not-offered-for-array-splat-in-type-syntax
Feb 23, 2026
Merged

add support for array splat completion in type syntax and enhance completion context#18948
polatengin merged 2 commits intomainfrom
polatengin/17610-completion-not-offered-for-array-splat-in-type-syntax

Conversation

@polatengin
Copy link
Member

@polatengin polatengin commented Feb 2, 2026

Fixes #17610

Design Proposal

When using the resourceInput<> type accessor with chained property access involving arrays, intellisense does not offer * (splat) completion inside square brackets. For example:

param foo resourceInput<'Microsoft.App/containerApps@2024-03-01'>.properties.template.containers[|]

At te cursor position |, no completion is offered for * to access the array item type.

When parsing foo.items[] in a type context, the Bicep parser creates an ArrayTypeSyntax node (interpreting [] as "array of foo.items"), not a TypeArrayAccessSyntax node. The existing completion logic only detected TypeArrayAccessSyntax, which is created when there's already content inside the brackets (like foo[0]).

In this PR we extend the completian context detection to also recognize ArrayTypeSyntax as a valid context for offering the * completion when the cursor is positioned between [ and ].

I added some integration tests to cover;

  • Basic array splat completion in type clauses
  • Chained typ completions for *.properties.tags.* and *.properties.template.containers[*].probes patterns
  • Real resource types, such as; Microsoft.App/containerApps and Microsoft.Resources/tags

Checklist

Microsoft Reviewers: Open in CodeFlow

@polatengin polatengin self-assigned this Feb 2, 2026
@polatengin polatengin added this to Bicep Feb 2, 2026
@polatengin polatengin linked an issue Feb 2, 2026 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this to Todo in Bicep Feb 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

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

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

@polatengin polatengin merged commit 93366fe into main Feb 23, 2026
41 checks passed
@polatengin polatengin deleted the polatengin/17610-completion-not-offered-for-array-splat-in-type-syntax branch February 23, 2026 17:05
@github-project-automation github-project-automation bot moved this from Todo to Done in Bicep Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Completion not offered for array splat in type syntax

2 participants