You need to check out the swift-5.1-branch of swift-format if you're using it alongside Swift 5.1.x. master is currently pinned to a development snapshot (unfortunately an older one, but still past where the 5.1.x releases were cut). See Matching swift-format to Your Swift Version in the README for more info.
In the near future, we're going to keep master in sync with the master branches of swift-syntax and swift, so the release branch scheme will still apply.
How can I make swift-format work with Xcode 11.4 ?
For the moment I have this issue SwiftSyntax parser library isn't compatible.
Should @akyrtzi tag swift-syntax since Xcode 11.4 is getting ready to ship ?
Sorry, the parser library from beta 1 is out-of-sync with what is currently in the swift-5.2-branch, we are looking into getting them in-sync.
In the meantime try using the matching OSS toolchain from the SwiftSyntax tag that swift-format uses.
Xcode 11.4 is compatible with the swift-5.2-branch of SwiftSyntax, or the 0.50200.0 tag. SwiftFormat currently uses the swift-DEVELOPMENT-SNAPSHOT-2020-01-29-a tag. The snapshot tags are only guaranteed to be compatible with the Swift toolchain of the same tag.
@allevato would it be possible to update SwiftFormat's dependency tag to be the 0.50200.0 one?
The Swift version in the swift-format branch name indicates the exact version of swift-syntax and the syntax parser that that branch is compatible with. There are no guarantees of compatibility (and in fact, no likelihood of it) if the swift-format branch and swift-syntax release are mismatched.
I'm getting this same message, but I'm using Xcode 12.0 Beta 6 and Swift 5.3, and I installed the app using "brew install swiftdocorg/formulae/swift-doc". I just now tried every variation I could think of with "swift doc generate ./Source --module-name Grid" (yes, I have a folder called "Source" that has Swift code in it). But everything I tried gave me "Error: SwiftSyntax parser library isn't compatible". Any ideas? Cheers
Probably swiftâdoc depends on a fixed version of swiftâsyntax and needs the matching toolchain around to run. (The parser library is in the toolchain; not the product folder of a package build.) I donât know what release of swiftâdoc homebrew may have used, but its master branch appears to depend on 0.50200.0. If the release is the same, then the necessary toolchain is 5.2. (It doesnât matter which patch number you choose; all patches of 5.2 happen to be mutually compatible.)
Thanks much. Is there a brew fix-this-mess kind of command I can use? I see an option --with-toolchain in homebrew, but it seems like people point it to LLVM, which means I know less than nothing about the problem and in a few hours I'll be wiping my storage and reinstalling macOS. If there's not some easy way to do this, could you give me an idea of where to start learning about it? Cheers
Just to clarify for future readers (since I was confused at first, since this and the post it's replying to were in this thread in the swift-format subforum), swift-doc doesn't appear to depend on swift-format; the issue is the dependency from swift-doc to swift-syntax.
That being said, I do need to cut a 5.3 compatible branch for swift-format soon, now that we're this far into the release cycle. The master branch is aligned with apple/swift master and is already incompatible with 5.3 since it has additions like async/await.
Sorry. I wrote the first sentence before I even knew what swiftâdoc was. Then I decided to try to find it to take a closer look. When I came back with more information, I just kept writing and failed to notice that the two halves of the post ended up incongruous.
I have fixed the post, but I cannot split the thread to move it to the swiftâsyntax section where it belongs.