nushell / tree-sitter-nu

A tree-sitter grammar for nu-lang, the language of nushell
MIT License
97 stars 24 forks source link

feat: improve distinction of flags and parameters #110

Closed mrdgo closed 2 weeks ago

mrdgo commented 2 weeks ago

This PR does three things:

  1. highlight = in --long-flag=value flags (orange in my case)
  2. highlight flag identifiers as parameters (blue)
  3. highlight string values as strings (green)

Before: image

After: image

Do we like these changes?

fdncred commented 2 weeks ago

I'm not a fan of everything being the same color. I kind of like the parameters being a different color from the commands. I do like the --time-style=long-iso color distinction. It's hard to tell on your theme, maybe your commands are yellow and the parameters are dark yellow?

mrdgo commented 2 weeks ago

The command is bold and green while strings are italic and green.

I would also be happy giving flag identifiers the type query: image

These are not committed, yet!

fdncred commented 2 weeks ago

I like this most recent screenshot better. Lemme know when you're ready to land.

mrdgo commented 2 weeks ago

Last commit made exactly that happen :) From my side, this can be merged

fdncred commented 2 weeks ago

Thanks!