You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all comments are parsed after tokens, but comments generally apply to the token that follows it, with the exception of trailing comments on the same line. Many formatting cases based on reordering expressions can't be done properly until comments are attached to the tokens they apply to. I tried parsing comments before the tokens, but this cannot be done efficiently and elegantly.
The best way forward is to make a pass over the entire syntax tree and moving comments from after their intial token to before the next token. This pass can simultaneously move some comments into better positions where they don't interrupt formatting flow.
The text was updated successfully, but these errors were encountered:
Currently, all comments are parsed after tokens, but comments generally apply to the token that follows it, with the exception of trailing comments on the same line. Many formatting cases based on reordering expressions can't be done properly until comments are attached to the tokens they apply to. I tried parsing comments before the tokens, but this cannot be done efficiently and elegantly.
The best way forward is to make a pass over the entire syntax tree and moving comments from after their intial token to before the next token. This pass can simultaneously move some comments into better positions where they don't interrupt formatting flow.
The text was updated successfully, but these errors were encountered: