Page 2 of 3
Posted: 11.02.2020 16:18
by Alexey
Operator -f and -c* -i* - fixed.
! and other symbols (comparision): IMO better hilite them as symbols, not like operators,
to not list all as regex (! > >= < <= etc).
Hilite switch options as operators: OK
Lexer update in 10min.
Posted: 12.02.2020 19:49
by Alexey
Lexer now lives in AddonManager, not in Cud distro.
Posted: 12.02.2020 20:04
by ANewUser
Thanks!
I will test it.
Posted: 15.02.2020 13:46
by ANewUser
The are missing built-in variables:
Code: Select all
$ErrorActionPreference
$ConfirmPreference
$WhatIfPreference
$DebugPreference
$ProgressPreference
$VerbosePreference
$WarningPreference
$InformationPreference
$MaximumAliasCount
$MaximumDriveCount
$MaximumErrorCount
$MaximumFunctionCount
$MaximumHistoryCount
$MaximumVariableCount
$ErrorView
$PSEmailServer
$PSModuleAutoLoadingPreference
$PSDefaultParameterValues
$PSSessionApplicationName
$PSSessionConfigurationName
$PSSessionOption
The are additional operators related to strings (I should have listed the operators with case-sensitivity), only the i* and c* variants are missing:
Code: Select all
-replace -ireplace -creplace
-split -isplit -csplit
-like -ilike -clike
-notlike -inotlike -cnotlike
-contains -icontains -ccontains
-notcontains -inotcontains -cnotcontains
-in -iin -cin
-notin -inotin -cnotin
-match -imatch -cmatch
-notmatch -inotmatch -cnotmatch
Some operators could be highlighted not as symbols:
related to calling and parameters: & -- --%
the ++ -- increment/decrement operators
static member access: :: (double colon)
assignment: += -= *= /= %=
https://i.imgur.com/i5VOcU1.png
Code: Select all
# highlight as variable the ${...}
# the name is "a very ugly variable name in the braces {} ..."
${a very ugly variable name in the braces `{`} ...} = "12345"
# another weird name
${foreach and switch var} = "it is legal"
# highlight types as [type-name] or just the type-name
# types are in brackets
[switch] $w
# the switch statement is highlighted as type
switch ( )
{ }
# better keyword/statement detection ?
# there is no "-" before them
# begin/process/end {...} are script blocks
# function must be followed an "identifier {...}" part
Some-Cmdlet -Process -Switch -Begin { }
Sort-Object -Property Function,Other
Thank you!
Posted: 15.02.2020 13:59
by ANewUser
Video about a small glitch, when the closing "@ characters are in the right position again, the comment does not be highlghted.
https://streamable.com/g4t22
Posted: 15.02.2020 14:54
by Alexey
Fixed most of issues
- "function" without Id name - still is keyword, it is ok to hilite all keywords in all places, even w/o next Id.
- here-strings @" ... "@ - do you type spaces after @" ? here strings cannot have space there -
https://powershell.org/2019/04/hear-hea ... e-strings/
Posted: 15.02.2020 14:57
by Alexey
glitch with editing of end - it exists, because editor parses text from start of changed line.
lexer updated.
Posted: 16.02.2020 14:54
by ANewUser
Thank you!
Posted: 29.02.2020 14:07
by ANewUser
Hello!
The "#Requires ..." statement is highlighted as comment not as statement or some other category.
https://docs.microsoft.com/en-us/powers ... wershell-7
Thanks
Posted: 29.02.2020 14:33
by Alexey
fixed this, used style Id3 for this. lexer updated. Pls test.