Skip to content
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

feat: improve distinction of flags and parameters #110

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Conversation

mrdgo
Copy link
Contributor

@mrdgo mrdgo commented Sep 19, 2024

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?

@mrdgo mrdgo marked this pull request as ready for review September 19, 2024 20:52
@fdncred
Copy link
Collaborator

fdncred commented Sep 19, 2024

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
Copy link
Contributor Author

mrdgo commented Sep 19, 2024

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
Copy link
Collaborator

fdncred commented Sep 19, 2024

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

@mrdgo
Copy link
Contributor Author

mrdgo commented Sep 19, 2024

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

@fdncred fdncred merged commit 47f8fb7 into nushell:main Sep 20, 2024
3 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Sep 20, 2024

Thanks!

mrdgo added a commit to mrdgo/tree-sitter-nu that referenced this pull request Sep 23, 2024
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](https://github.com/user-attachments/assets/80a7260d-2bd9-4c5d-81b8-9416f84b3667)

After: 

![image](https://github.com/user-attachments/assets/c09237ec-7a3c-4f96-9670-b68897aa7368)


Do we like these changes?

---------

Co-authored-by: Maxim Onciul <[email protected]>
mrdgo added a commit to mrdgo/tree-sitter-nu that referenced this pull request Sep 26, 2024
fdncred pushed a commit that referenced this pull request Sep 26, 2024
In #110, I changed highlights. I accidentally committed `(val_string)
@variable.parameter`, which should actually be `@string`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants