Open realslacker opened 4 months ago
Duplicate of https://sourceforge.net/p/scintilla/bugs/1761/
@zufuliu maybe this should be two bugs, I believe that variables inside double quotes not being highlighted is also an issue worth resolving.
cc @mpheath, I think this can be fixed with following rough steps (not plan to work on this myself):
nullptr
, remove ctype, etc.).if (sc.state)
block to switch statement.class LexerPowerShell final : public DefaultLexer
).$()
inside SCE_POWERSHELL_DEFAULT
as operator.$()
inside SCE_POWERSHELL_STRING
and SCE_POWERSHELL_HERE_STRING
, which is similar (allows new line and arbitrary expressions) to JavaScript ${}
, so can reuse interpolatingAtEol
and interpolatingStack
from LexCPP.$var
variables inside SCE_POWERSHELL_STRING
and SCE_POWERSHELL_HERE_STRING
.${}
variables inside SCE_POWERSHELL_DEFAULT
, SCE_POWERSHELL_STRING
and SCE_POWERSHELL_HERE_STRING
.@var
variables inside SCE_POWERSHELL_DEFAULT
.not plan to work on this myself
@zufuliu I like basic string styling so I currently have a negative interest with the OP feature request.
I like basic string styling
How about configured with Bash like styling.inside.xxx
properties?
In PowersShell you can use $($Expression) inside of quotes to execute code during string interpolation. Consider this valid PowerShell code example:
Github formats the code as expected, however Notepad++ which uses the current version (532) of lexilla formats the code as shown:
Single quotes are handled correctly as variable expansion does not happen between single quotes, however double quotes should allow variable expansion and thus variables should be highlighted.
Finally, in the last example the $() structure should re-evaluate everything inside of the parenthesis as code. In the example it looks like the highlighter is interpreting the embedded quotation mark as the end of the string and the trailing single quote as the beginning of a new string.