Giter Club home page Giter Club logo

Comments (6)

belkadan avatar belkadan commented on August 11, 2024

cc @nkcsgexi

from swift-syntax.

Jeehut avatar Jeehut commented on August 11, 2024

Please note that I found a way around this change, so it's not a pressing issue for me, but I would still expect something like the above being possible. Alternatively better documentation with more example uses would be great that covers stuff like this. Currently the project isn't particularly easy to use. But I'm sure you're aware of that.

from swift-syntax.

nkcsgexi avatar nkcsgexi commented on August 11, 2024

@Jeehut We have this change because the items in a MemberDeclList consist not decls but another layer of structure called MemberDeclListItem . We need to unwrap MemberDeclListItem to get all the enum cases back.

More specifically, this is the code snippet you could use to replace the 4.2 version:

        cases.append(contentsOf: node.members.members.compactMap {
          ($0 as MemberDeclListItemSyntax).decl as? EnumCaseDeclSyntax
        })

from swift-syntax.

nkcsgexi avatar nkcsgexi commented on August 11, 2024

For other parts of migrations for the new swift 5 tag, please refer to the changes swift-format has made here: google/swift@62d5af4

from swift-syntax.

Jeehut avatar Jeehut commented on August 11, 2024

Thank you for the answer. I still think better documentation would be great for SwiftFormat with examples that are updated on new versions (instead of just linking to some examples usages that become out of date the moment a new version is released, like now).

from swift-syntax.

ahoppen avatar ahoppen commented on August 11, 2024

Closing this issue because the issue appears to be fixed. If you don’t agree, please re-open the issue.

from swift-syntax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.