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

CodeFormatter: Implement proper Comment handling. #4

Open
ldoblies opened this issue Jan 21, 2013 · 0 comments
Open

CodeFormatter: Implement proper Comment handling. #4

ldoblies opened this issue Jan 21, 2013 · 0 comments

Comments

@ldoblies
Copy link
Contributor

Comments are not fully supported yet: They are only properly formatted when they don't interfere with postNewLine()s. It might be necessary to pre-process the AST and move
the WS nodes containing comments to the correct node. Then it is possible to e.g. post a newline after clauses in a FLWORExpr.

Example:

let $x := 1 (: comment within a flwor :)
(: another one :) return $x

Formats to:

let $x := 1
(: comment within a flwor :) (: another one :) return $x

Both comments are in the same WS-node between the LetClause and the ReturnClause.
It would be necessary to make the first Comment a child of the LetClause and the second one a child of the ReturnClause. Then the formatting rules for FLWORExpr/Statement (and all others) could be kept as they are now.

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

No branches or pull requests

1 participant