Skip to content

Commit

Permalink
Add more namespacing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw committed Feb 19, 2024
1 parent 09aab16 commit ad7223a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Sources/ComposableArchitectureMacros/ReducerMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,14 @@ extension ReducerMacro: MemberMacro {
if !hasBody {
var staticVarBody = ""
if reducerTypeScopes.isEmpty {
staticVarBody = "EmptyReducer<Self.State, Self.Action>"
staticVarBody = "ComposableArchitecture.EmptyReducer<Self.State, Self.Action>"
} else if reducerTypeScopes.count == 1 {
staticVarBody = reducerTypeScopes[0]
} else {
for _ in 1...(reducerTypeScopes.count - 1) {
staticVarBody.append("ReducerBuilder<Self.State, Self.Action>._Sequence<")
staticVarBody.append(
"ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>._Sequence<"
)
}
staticVarBody.append(reducerTypeScopes[0])
staticVarBody.append(", ")
Expand Down
10 changes: 5 additions & 5 deletions Tests/ComposableArchitectureMacrosTests/ReducerMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: EmptyReducer<Self.State, Self.Action> {
static var body: ComposableArchitecture.EmptyReducer<Self.State, Self.Action> {
}
Expand Down Expand Up @@ -302,7 +302,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Activity>, ComposableArchitecture.Scope<Self.State, Self.Action, Timeline>>, ComposableArchitecture.Scope<Self.State, Self.Action, Tweet>> {
static var body: ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Activity>, ComposableArchitecture.Scope<Self.State, Self.Action, Timeline>>, ComposableArchitecture.Scope<Self.State, Self.Action, Tweet>> {
ComposableArchitecture.Scope(state: \Self.State.Cases.activity, action: \Self.Action.Cases.activity) {
Activity()
}
Expand Down Expand Up @@ -372,7 +372,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Activity>, ComposableArchitecture.Scope<Self.State, Self.Action, Timeline>> {
static var body: ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Activity>, ComposableArchitecture.Scope<Self.State, Self.Action, Timeline>> {
ComposableArchitecture.Scope(state: \Self.State.Cases.activity, action: \Self.Action.Cases.activity) {
Activity()
}
Expand Down Expand Up @@ -498,7 +498,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: EmptyReducer<Self.State, Self.Action> {
static var body: ComposableArchitecture.EmptyReducer<Self.State, Self.Action> {
}
Expand Down Expand Up @@ -561,7 +561,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Counter>, ComposableArchitecture.Scope<Self.State, Self.Action, Counter>>, ComposableArchitecture.Scope<Self.State, Self.Action, Counter>> {
static var body: ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Counter>, ComposableArchitecture.Scope<Self.State, Self.Action, Counter>>, ComposableArchitecture.Scope<Self.State, Self.Action, Counter>> {
ComposableArchitecture.Scope(state: \Self.State.Cases.drillDown, action: \Self.Action.Cases.drillDown) {
Counter()
}
Expand Down

0 comments on commit ad7223a

Please sign in to comment.