Skip to content

CmdletBinding annotation looks broken #227

Closed

Description

@deathaxe

First line of following file is not correctly highlighted/scoped as annotation.

[CmdletBinding(PositionalBinding=$false)]
param(
    [Parameter(Mandatory=$true)]
    [string]$base,

    [Parameter(Mandatory=$true)]
    [string]$head
)

Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
Image

Activity

  1. michaelblyons commented on Jun 18, 2026

    @michaelblyons
    Collaborator

    This is like the contents of inside-function-body, but at top-level?

    Could we do something like this?

    contexts:
      main:
        - meta_include_prototype: false
        - match: ''
          push: [statements, script-param, imports, shebang]
    
      script-param:
        - include: attributes
        - include: param-block
        - include: else-pop
  2. deathaxe commented on Jun 18, 2026

    @deathaxe
    MemberAuthor

    LGTM.

    Off-topic: Would it make sense to scope attributes meta.annotation as C#?

  3. michaelblyons commented on Jun 18, 2026

    @michaelblyons
    Collaborator

    Off-topic: Would it make sense to scope attributes meta.annotation as C#?

    Sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels