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

List the token kinds in child documentation in SyntaxNodes #2168

Merged

Commits on Sep 15, 2023

  1. List the token kinds in child documentation

    For children of syntax nodes that are TokenSyntax, list the kinds of
    tokens it can contain. Fixes swiftlang#1987.
    natikgadzhi committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    e379aee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3f5dbd6 View commit details
    Browse the repository at this point in the history
  3. Improve token choices doc comment

    - Moves complexity of generating the comment into `Child.swift` and uses
      `grammar.grammar()` directly.
    - Appends a `TriviaPiece.newlines(1)` between trivia pieces when merging
      with the original comment.
    - Uses approach similar to `SyntaxNodesFile.swift` to concatenating
      documentation pieces.
    natikgadzhi committed Sep 15, 2023
    Configuration menu
    Copy the full SHA
    4fd2ade View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    11582df View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8862f9a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b788135 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2023

  1. Refactor child token choices comment generator

    - Improves readability by omitting single quotes inside backticks
      (@kimdv)
    - Cleans up the language on possible token choices (@ahoppen)
    - Moves token choices generation into `GrammarGenerator`, but leaves the
      documentation property in `Child` so it's consistent with how `Node`
      works.
    - Regenerated sources with the changes after this cleanup, and after
      rebaising on main.
    natikgadzhi committed Sep 16, 2023
    Configuration menu
    Copy the full SHA
    b4fbbd9 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2023

  1. Use Trivia(joining:) in SyntaxCollections

    We've introduced `Trivia(joining: [Trivia], separator: [Trivia])` to
    generate doc comments from multiple pieces, and already use this
    approach in `SyntaxNodesFile` for nodes themselves, and for node
    children documentation.
    
    This commit switches from joining pieces manually to using
    `Trivia(joining:)` in `SyntaxCollectionsFile` so that we use the same
    approach everywhere.
    natikgadzhi committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    4b76a66 View commit details
    Browse the repository at this point in the history