Skip to content

[ValidateScript()] highlighting very incorrect #65

@vexx32

Description

@vexx32

The simplest test case for this is as follows:

function Verb-Noun{
    param(
        [ValidateScript({ Test-Path -Path $_ })]
        [string]
        $Path
    )
    Begin { }
    Process { }
    End { }
}

In about half of the themes I've looked through, and the majority of the default ones (especially the PS extension's ISE theme) there is a very glaring syntax highlight issue. Any cmdlet placed in the inline scriptblock will be highlighted in two different colours, switching colours at the dash. The closing brace will also inherit the offending colour.

Adding a line-break after the opening brace will hide the issue, but the cmdlet within the script block is then not highlighted as a cmdlet at all, either.

Some darker themes will obscure the issue, giving a similar colour pairing to the two halves of the cmdlet (e.g., Monokai Dark), but if you look you can still see the issue is present. On themes with a more restricted color palette (e.g., monochrome themes) the difference is often not noticeable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions