Skip to content

Commit 8b393a5

Browse files
committed
Fix for tuple param
1 parent 167755b commit 8b393a5

4 files changed

Lines changed: 23 additions & 7 deletions

File tree

VVDocumenter-Xcode.xcodeproj/project.pbxproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,6 @@
686686
);
687687
GCC_PRECOMPILE_PREFIX_HEADER = YES;
688688
GCC_PREFIX_HEADER = "VVDocumenterTests/VVDocumenterTests-Prefix.pch";
689-
GCC_PREPROCESSOR_DEFINITIONS = (
690-
"DEBUG=1",
691-
"$(inherited)",
692-
__DEBUG__,
693-
);
694689
HEADER_SEARCH_PATHS = (
695690
"$(inherited)",
696691
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,

VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,15 @@ -(void) parseSwiftArgumentsInputArgs:(NSString *)rawArgsCode
7171
}
7272

7373
NSString *removedUnwantComma = [rawArgsCode vv_stringByReplacingRegexPattern:@"[{].*?[^}],.*?[)}]" withString:@""];
74+
NSString *removedUnwantParentheses = [removedUnwantComma copy];
7475

75-
NSArray *argumentStrings = [removedUnwantComma componentsSeparatedByString:@","];
76+
VVTextResult *parenthesesInParam = [removedUnwantComma vv_textResultMatchPartWithPairOpenString:@"(" closeString:@")" currentLocation:0];
77+
while (parenthesesInParam.string) {
78+
removedUnwantParentheses = [removedUnwantParentheses stringByReplacingOccurrencesOfString:parenthesesInParam.string withString:@""];
79+
parenthesesInParam = [removedUnwantParentheses vv_textResultMatchPartWithPairOpenString:@"(" closeString:@")" currentLocation:0];
80+
}
81+
82+
NSArray *argumentStrings = [removedUnwantParentheses componentsSeparatedByString:@","];
7683
for (__strong NSString *argumentString in argumentStrings) {
7784
VVArgument *arg = [[VVArgument alloc] init];
7885
argumentString = [argumentString vv_stringByReplacingRegexPattern:@"=\\s*\\w*" withString:@""];

VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ -(VVTextResult *) textResultWithPairOpenString:(NSString *)open
216216
resultRange = NSMakeRange(nextLineRange.location + 1, targetRange.location - nextLineRange.location);
217217
}
218218

219-
if (resultRange.location < [self length] && NSMaxRange(resultRange) < [self length]) {
219+
if (resultRange.location < [self length] && NSMaxRange(resultRange) <= [self length]) {
220220
NSString *result = [self substringWithRange:resultRange];
221221
return [[VVTextResult alloc] initWithRange:resultRange string:result];
222222
} else {

VVDocumenterTests/DocumenterTests/VVMethodTestsCode.plist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,20 @@ SIAlertViewBackgroundStyleSolid,
633633
634634
- parameter count: &lt;#count description#&gt;
635635
636+
- returns: &lt;#return value description#&gt;
637+
*/</string>
638+
</dict>
639+
<dict>
640+
<key>source</key>
641+
<string>func testTuple(aTuple: (first: String, second: String, third: String)) -> (first: String, second: String, third: String)? {</string>
642+
<key>uniform</key>
643+
<string>func testTuple(aTuple:(first: String, second: String, third: String))->(first: String, second: String, third: String)? {</string>
644+
<key>result</key>
645+
<string>/**
646+
&lt;#Description#&gt;
647+
648+
- parameter aTuple: &lt;#aTuple description#&gt;
649+
636650
- returns: &lt;#return value description#&gt;
637651
*/</string>
638652
</dict>

0 commit comments

Comments
 (0)