Skip to content

Fix missing await and syntax errors in documentation examples - #3953

Open
meliharik wants to merge 1 commit into
pointfreeco:mainfrom
meliharik:docs-fix-missing-await-and-syntax-errors
Open

Fix missing await and syntax errors in documentation examples#3953
meliharik wants to merge 1 commit into
pointfreeco:mainfrom
meliharik:docs-fix-missing-await-and-syntax-errors

Conversation

@meliharik

Copy link
Copy Markdown

Follow-ups to the same classes of documentation bug fixed in #3940, #3936 and #3939 — I found remaining instances in other articles.

Missing await on TestStore (13 lines)

TestStore.send and TestStore.receive are both async, so these examples do not compile as written. TestingTCA.md was corrected in #3940; the same shape survives in three other articles, each inside a block that constructs a TestStore:

  • Articles/Performance.md — 9 lines across the two "sharing logic" test examples
  • Articles/Bindings.md — 2 lines in the binding-action test example
  • Articles/FAQ.md — 2 lines, in the paragraph that explicitly introduces TestStore

Unbalanced parentheses (2 lines)

  • Articles/MigrationGuides/MigratingTo1.10.md@Shared(.fileStorage(URL(/* ... */) var signUpData is missing two closing parens. This is the same typo Fix SharingState documentation example syntax #3936 fixed in SharingState.md; that file now reads @Shared(.fileStorage(URL(/* ... */))) var users, and this line now matches it.
  • Articles/MigrationGuides/MigratingTo1.11.md — the #Preview { … } example closes with ) instead of }.

How I found them

I extracted all 362 ```swift blocks from the DocC sources and checked paren/bracket balance outside strings and comments, then cross-checked every store.send/`store.receive` against whether its block builds a `TestStore`. Braces were deliberately not balance-checked, since the docs legitimately show fragments.

Two things I deliberately left alone:

  • Articles/StackBasedNavigation.md:212 also calls store.send(.detailButtonTapped) without await, but that one is inside a SwiftUI Button and so is the synchronous Store.send — correct as written.
  • Articles/MigrationGuides/MigratingTo1.15.md:38 has an unbalanced ]) , but it reads as an intentional excerpt from the middle of a .target(…) call rather than a typo. Happy to adjust if you'd prefer it balanced.

I did not touch the store.receive calls in the 1.4 and 1.9 migration guides, since those are illustrating an older API era and it wasn't obvious whether you want them modernized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant