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

Fix parsing of command #48

Merged
merged 1 commit into from
Dec 27, 2023
Merged

Conversation

kit494way
Copy link
Contributor

Fix #45 , Fix #47

Under the current rule for parsing of command, whether the command is a subexpression or not, line breaks are allowed between command arguments.
This causes the parser to fail to correctly detect the end of a command or pipeline.
This pr changes the rules to allow line breaks between command arguments only when the command is a subexpression.

After this change, the highlights looks like follows
スクリーンショット 2023-12-27 215258
スクリーンショット 2023-12-27 215503

Fix to allow line breaks between command arguments only when the command is a subexpression
@fdncred
Copy link
Collaborator

fdncred commented Dec 27, 2023

nice work! we appreciate all your efforts here.

@fdncred fdncred merged commit bddc79c into nushell:main Dec 27, 2023
3 checks passed
@amtoine
Copy link
Member

amtoine commented Dec 27, 2023

nice 👌

after updating, it looks much better 🙏
i just have the whole content of the string interpolation that is white, i.e. ($env.HOME)

@fdncred
Copy link
Collaborator

fdncred commented Dec 27, 2023

@amtoine isn't that controlled by highlights.scm? I'm not positive but I thought it was.

@amtoine
Copy link
Member

amtoine commented Dec 27, 2023

@amtoine isn't that controlled by highlights.scm? I'm not positive but I thought it was.

it might not be related to that PR yeah, because it's there in other places, i.e. $env.HOME never appear to highlight properly in my Neovim.

i did update both the parser and the query file 😉

@fdncred
Copy link
Collaborator

fdncred commented Dec 27, 2023

what i'm suggesting is that the highlights.scm file is very old and it probably needs a good updating too.

@kit494way kit494way deleted the fix-parsing-command branch February 3, 2024 06:12
mrdgo pushed a commit to mrdgo/tree-sitter-nu that referenced this pull request Sep 23, 2024
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.

Fails to parse a multi-line command enclosed in parentheses Highlighting breaks on alias before let
3 participants