Skip to content

Conversation

@fdncred
Copy link
Contributor

@fdncred fdncred commented Jan 30, 2026

Description of changes

This PR tries to fix the inline parameter comment formatting identified in #77

Closes #77

@fdncred fdncred merged commit f4cc349 into main Jan 30, 2026
5 checks passed
@fdncred fdncred deleted the fix_inline_comment_formatting branch January 30, 2026 18:29
.iter()
.any(|(span, _)| span.start >= expr.span.start && span.end <= expr.span.end);
if has_comments {
self.write_expr_span(expr);
Copy link

Choose a reason for hiding this comment

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

Does this mean there won't be any change in the signature if there's a doc comment?

Just out of curiosity from eyeballing the code as I don't have a machine with me right now to test, I think custom completion expressions in signatures are missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya, it should stay the same if there are comments. I'm not sure if that's right or wrong.

This code is really just thrown together to try and get over the hump of no one working on it. I really needs like 1000 samples for the ground truth. The intent was to be able to create and input script and an expected script and have it run those without compilation. However, it's all hard coded right now. The more samples we can get with different syntaxes the better testing will be and the better formatting will be.

Copy link

Choose a reason for hiding this comment

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

Glad to see such great improvement in nufmt. It feels almost there that I can archive topiary-nushell and let go, I thought it was an impossible task before a mature new-nu-parser.

On the other hand, the signature thing is till annoying, and I'm afraid too much hack on nufmt doesn't worth the effort for issues that should be originally addressed on the parser side.

Having said that, would you like me to report new issues, like the mentioned "custom completion expression in the signature", or do you have any other plan of how we should proceed with this project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya, please report issues. I may not fix them all. Some, like you say, are parser bugs. I definitely don't want you to archive topiary-nushell but I do want to prove (mostly to myself) that nufmt can actually work as a real-world formatter. I'm honestly not convinced right now. I still think i'll eat more code than it will format, but at least someone is trying to make it better.

Copy link

Choose a reason for hiding this comment

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

Right now, nufmt seems promising. And I think a single working and configurable formatter is enough for the community. topiary has its own limit that won't make everybody happy. If we can overcome some more obstacles either by improving nu-parser/new-nu-parser or nufmt, then I think topiary-nushell has fullfilled its task in history.

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.

Wrong positioning of doc comments for parameters

2 participants