-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct the
throws
clause in the closure within template logic to s…
…upport TypedThrow. (#262) * Update swift-syntax to 600.0.0-prerelease * Resolve warnings for SwiftSyntax600 * Update for tests * update to support typed-throw * Update Sources/MockoloFramework/Parsers/SwiftSyntaxExtensions.swift Co-authored-by: Iceman <[email protected]> * Read accessor and omit setCallCount if protocol has no setter * Remove unnecessary static var handling * Support get async and get throws property accessor * small rename and remove unused code * generate initialize for computed var * computed getter handles with the same way of method * remove deprecated method * Add test for throwing never * small formatting * Define FunctionSuffixClause. * Change swift-syntax organization from apple to swiftlang * Define FunctionSuffixClause * Update TestCase * refactoring * fix: remove unused string token. * Fix for typed throws * rename argument for applyThrowingTemplate method. Add doc comment * Avoid to expose special parameter in a common method. * Update TestFixture * Keep applyThrowingTemplate nullable to consider trivia. review comment: #262 (comment) * Refactor template logic for closure's suffix. * Refactor function's suffix logic. --------- Co-authored-by: Iceman <[email protected]> Co-authored-by: Iceman <[email protected]>
- Loading branch information
1 parent
2628c64
commit 09a1ea2
Showing
11 changed files
with
160 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Sources/MockoloFramework/Utils/FunctionSuffixTemplate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Copyright (c) 2018. Uber Technologies | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
/// Apply template for function suffix | ||
/// | ||
/// Suffix consists of async and throws. | ||
func applyFunctionSuffixTemplate(isAsync: Bool, throwing: ThrowingKind) -> String { | ||
[ | ||
isAsync ? String.async : nil, | ||
throwing.applyThrowingTemplate(), | ||
].compactMap { $0 }.joined(separator: " ") + " " | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters