Closed texastoland closed 9 months ago
The only thing that I'm not quite sure about is having ...$rest
as a custom command parameter instead of ...rest
. They resolve to two different things.
...rest
is all variable.parameter.nushell
where
...$rest
is ...
= keyword.control.nushell
, $
= meta.function.parameter.nushell
, and rest
= variable.parameter.nushell
It may be ok like this, it just gives me pause.
...rest
is allvariable.parameter.nushell
@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 --
and flag
mean something different than --flag
. Thanks for working on this stuff.
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 :shipit:
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