EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

Hidden is getting wrong color as parameter.

Open PrzemyslawKlys opened this issue 7 years ago • 3 comments
trafficstars

Environment

  • Editor and Version (VS Code, Atom, Sublime): VSCode
  • Your primary theme: Monokai

Issue Description

I've created function

function Set-WordTextHidden {
    param(
        [parameter(ValueFromPipelineByPropertyName, ValueFromPipeline)][Xceed.Words.NET.InsertBeforeOrAfter] $Paragraph,
        $Hidden,
        [bool] $Supress = $true
    )
    if ($Paragraph -ne $null -and $Hidden -ne $null) {
        $Paragraph = $Paragraph.Hidden($Hidden)
    }
    if ($Supress) { return } else { return $Paragraph }
}

As you can see on screenshots... -Hidden is getting wrong color. I guess it's a special name but I still would like to use it.

Screenshots

image

image

Expected Behavior

No coloring?

Code Samples



PrzemyslawKlys avatar Jul 05 '18 18:07 PrzemyslawKlys

Set-WordTextHidden -Hidden $Hidden -Surpress $false

Inline Github repro. I'm guessing because hidden is special for PowerShell classes

TylerLeonhardt avatar Jul 05 '18 21:07 TylerLeonhardt

@tylerl0706 Should I change it, or can I count on a fix?

PrzemyslawKlys avatar Jul 05 '18 21:07 PrzemyslawKlys

The eventual goal was to work out a proper class definition and make hidden only a keyword inside of it but that's a ways of. I will tweak the current match to look for nothing by whitespace between the beginning of the line and the word hidden which should cover 99% of cases for now.

There's nothing wrong with using -Hidden as a param and in fact the current match may trigger in other inappropriate instances.

Will fix.

Dictionary Ref: 296-303

omniomi avatar Jul 05 '18 21:07 omniomi