-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spread to syntax highlighting #174
Conversation
The only thing that I'm not quite sure about is having
It may be ok like this, it just gives me pause. |
Replaces `include` with a capture for the existing regex.
@fdncred Fixed. Copied from Discord whether to highlight flags too: def cmd [ --flag ] {}
# ^^ highlighted?
cmd --flag
# ^^ here too |
My answer from Disord was I think yes to both since |
Traps command flags and shortcuts bare string parsing.
Reuses an unused `parameters` expression. Fixes broken word boundary with whitespace lookbehind instead. Also fixes previous `(.+)` (code smell) matching the entire command.
Ready again. I wasn't happy with my first pass but I discovered an expression that wasn't working before and fixed it. I didn't update the scope list (above) with flag tokens but can if it helps review! LGTM |
I think it looks good now. Thanks! |
Fixes #173.
Generated tokens for:
def cmd [
...
keyword.control.nushell
meta.function.parameters.nushell
source.nushell
rest
variable.parameter.nushell
meta.function.parameters.nushell
source.nushell
] {
[
...
keyword.control.nushell
meta.table.nushell
meta.function.body.nushell
source.nushell
$rest
variable.other.nushell
meta.table.nushell
meta.function.body.nushell
source.nushell
]
{
...
keyword.control.nushell
meta.expression.braced.nushell
meta.function.body.nushell
source.nushell
$rest
variable.other.nushell
meta.expression.braced.nushell
meta.function.body.nushell
source.nushell
}
all
-keyword.other.builtin.nushell
...
keyword.control.nushell
meta.command.nushell
meta.function.body.nushell
source.nushell
$rest
variable.other.nushell
meta.command.nushell
meta.function.body.nushell
source.nushell
cmd
-entity.name.type.external.nushell
...
keyword.control.nushell
meta.command.nushell
source.nushell
$rest
variable.other.nushell
meta.command.nushell
source.nushell
^
-keyword.operator.nushell
cmd ...$rest
- same as above