Skip to content

add optional sigil % to start of commands#248

Merged
fdncred merged 3 commits intonushell:mainfrom
Tyarel8:builtin-prefix
Apr 22, 2026
Merged

add optional sigil % to start of commands#248
fdncred merged 3 commits intonushell:mainfrom
Tyarel8:builtin-prefix

Conversation

@Tyarel8
Copy link
Copy Markdown
Contributor

@Tyarel8 Tyarel8 commented Apr 22, 2026

Add the new sigil % for builtin commands from nushell/nushell#17956

@blindFS
Copy link
Copy Markdown
Contributor

blindFS commented Apr 22, 2026

Thanks for the update, would you please also include some new test cases?

https://github.com/nushell/tree-sitter-nu/blob/main/test/corpus/pipe/commands.nu

Comment thread test/corpus/expr/identifier.nu Outdated
====

%echo
%str join
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't sound right to me...

Maybe we need to tune the nushell syntax a little bit, %"str join" makes more sense to me. @fdncred ideas?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the way it's listed above is the right syntax. You don't call sub commands with quotes so I'm not sure why you'd need to quote it if you're using a sigil.

 [a b c] | str join
abc
 [a b c] | %str join
abc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point, we can't tell whether the join here is part of the command or a command argument with or without the sigil. We chose the lsp semantic tokens feature as a workaround.

@Tyarel8 I'd suggest we remove this single line from the test, as the result is not aligned with nu-parser. That's something we can't fix at the moment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Apr 22, 2026

Are we ready to land this now?

@blindFS
Copy link
Copy Markdown
Contributor

blindFS commented Apr 22, 2026

Are we ready to land this now?

Sure.

@fdncred fdncred merged commit 348b787 into nushell:main Apr 22, 2026
4 checks passed
@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Apr 22, 2026

Thanks

@Tyarel8 Tyarel8 deleted the builtin-prefix branch April 23, 2026 07:28
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.

3 participants