-
Notifications
You must be signed in to change notification settings - Fork 222
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
Add comments to fmt
#4116
Comments
Discussed on the dev call — let's go for the second approach — "Require passing in the source into |
What is the status on this? Is someone actively working on getting comments working? |
Ah, I haven't been keeping this issue up-to-date, thanks for the ping @m-span . Relevant links: #4397 (comment), #4639 Briefly:
I'm not confident on the best next steps. There's a mini-goal of getting DocComments in the PL, which are much easier than comments, and uses a subset of #4639. Then I think we need to decide whether to a) try and take one of those approaches and add enough hacks that it works or b) rewrite the formatter from the perspective of LR tokens. |
What's up?
We discussed comments (and associated aesthetic items, such as significant newlines) on Discord. A couple of options for how to do this:
comments
field on the Expr struct containing the comments before the expression.Expr
and so would require a different design (e.g. a comment above an annotation wouldn't fit anywhere; similarly we'd need to add this toStmt
too.)WriteSource
, use the source to find and write the comments while writing the query.IIUC these are the main two approaches. There are variations — for example having comments part of a CST but not AST; though in our case we don't have a CST.
Any thoughts?
The text was updated successfully, but these errors were encountered: