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

Add contributors documentation #2320

Open
Tracked by #2315
nojaf opened this issue Jul 1, 2022 · 0 comments
Open
Tracked by #2315

Add contributors documentation #2320

nojaf opened this issue Jul 1, 2022 · 0 comments

Comments

@nojaf
Copy link
Contributor

nojaf commented Jul 1, 2022

We should have documentation that explains the high-level overview of this project.
And add some detailed information about the code. The high-level stuff is somewhat captured in our Contribution guidelines. It should be split up and expanded upon.

High-level topics

Somewhat in order.

  • A first local build
  • Project structure (what does each project do)
  • Overview of FAKE build
  • Parsing of the AST
  • Trivia and ASTTransformer
  • CodePrinter
  • WriteEvents in Context
  • Format selection
  • Fantomas Daemon and Fantomas.Client
  • Formatting with conditional compiler defines
  • Online tools and how to use them.
  • PR checklist.

Details

These are in no particular order.

  • Explain Context -> Context
  • Custom operators: !-, +>
  • Helper functions: col, expressionFitsOnRestOfLine, isShortExpression, sepNln, sepSpace, onlyIf, genTriviaFor, indent, atCurrentColumn, colWithNlnWhenItemIsMultiline, leadingExpressionIsMultiline.
  • Explain Queue data structure
  • Why indent only works after sepNln
  • What ColMultilineItem is.
  • The Define module and how we resolve the different AST trees.
  • AstExtensions and .FullRange extension function.

Questions that should be answered

Again no particular order.

  • Why do we have our own F# compiler API?
  • Why all the active patterns in SourceParser?
  • Why we restore strings/chars/numbers using ISourceText.GetContentAt?
  • Why could a code comment disappear after formatting?
  • Why is CodePrinter so large and full of recursive functions?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant