Skip to content

Fix extra space in withAsyncModifier #14

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

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/MacroToolkit/SwiftSyntax+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extension FunctionDeclSyntax {
.with(
\.effectSpecifiers,
effectSpecifiersOrDefault
.with(\.asyncSpecifier, isPresent ? " async" : nil)
.with(\.asyncSpecifier, isPresent ? "async" : nil)
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/MacroToolkit/Type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftSyntaxBuilder

// TODO: Implement type normalisation and pretend sugar doesn't exist (e.g. Int? looks like Optional<Int> to devs)
/// Wraps type syntax (e.g. `Result<Success, Failure>`).
public enum Type: TypeProtocol, SyntaxExpressibleByStringInterpolation {
public enum `Type`: TypeProtocol, SyntaxExpressibleByStringInterpolation {
/// An array type (e.g. `[Int]`).
case array(ArrayType)
/// A `class` token in a conformance list. Equivalent to `AnyObject`.
Expand Down
14 changes: 7 additions & 7 deletions Tests/MacroToolkitTests/MacroToolkitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class MacroToolkitTests: XCTestCase {

@Before
@After
func d(a: Int, for b: String, _ value: Double) async -> Bool {
func d(a: Int, for b: String, _ value: Double) async -> Bool {
await withCheckedContinuation { continuation in
d(a: a, for: b, value) { returnValue in
continuation.resume(returning: returnValue)
Expand Down Expand Up @@ -576,7 +576,7 @@ final class MacroToolkitTests: XCTestCase {
protocol API {
func request(completion: (Int) -> Void)

func request() async -> Int
func request() async -> Int
}
""",
macros: testMacros
Expand All @@ -598,9 +598,9 @@ final class MacroToolkitTests: XCTestCase {
func request1(completion: (Int) -> Void)
func request2(completion: (String) -> Void)

func request1() async -> Int
func request1() async -> Int

func request2() async -> String
func request2() async -> String
}
""",
macros: testMacros
Expand All @@ -623,7 +623,7 @@ final class MacroToolkitTests: XCTestCase {
completion(0)
}

func request1() async -> Int {
func request1() async -> Int {
await withCheckedContinuation { continuation in
request1() { returnValue in
continuation.resume(returning: returnValue)
Expand Down Expand Up @@ -658,15 +658,15 @@ final class MacroToolkitTests: XCTestCase {
completion("")
}

func request1() async -> Int {
func request1() async -> Int {
await withCheckedContinuation { continuation in
request1() { returnValue in
continuation.resume(returning: returnValue)
}
}
}

func request2() async -> String {
func request2() async -> String {
await withCheckedContinuation { continuation in
request2() { returnValue in
continuation.resume(returning: returnValue)
Expand Down