Skip to content

Commit 0393de7

Browse files
committed
Basic support for swift function
1 parent 5d5a207 commit 0393de7

14 files changed

Lines changed: 202 additions & 57 deletions

File tree

VVDocumenter-Xcode.xcodeproj/project.pbxproj

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,28 @@
1515
D124614717AC16820095F9D6 /* VVDocumenterSetting.m in Sources */ = {isa = PBXBuildFile; fileRef = D124614317AC16820095F9D6 /* VVDocumenterSetting.m */; };
1616
D124614817AC16820095F9D6 /* VVDSettingPanelWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = D124614517AC16820095F9D6 /* VVDSettingPanelWindowController.m */; };
1717
D124614917AC16820095F9D6 /* VVDSettingPanelWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D124614617AC16820095F9D6 /* VVDSettingPanelWindowController.xib */; };
18+
D13EDDD91987F34C0029A555 /* VVSwiftFunctionCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D13EDDD81987F34C0029A555 /* VVSwiftFunctionCommenter.m */; };
1819
D14070C418CE8819009B0EED /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D14070C318CE8819009B0EED /* XCTest.framework */; };
20+
D14110A61988C07E00A7083F /* VVTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462EC17999C9A00EB7B23 /* VVTestHelper.m */; };
21+
D14110A71988C08700A7083F /* VVDocumenterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462E517999C2000EB7B23 /* VVDocumenterTests.m */; };
22+
D14110A81988C12000A7083F /* VVArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = D11C542B17999D9000D3DE38 /* VVArgument.m */; };
23+
D14110A91988C12000A7083F /* VVBaseCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD31796E088006719AA /* VVBaseCommenter.m */; };
24+
D14110AA1988C12000A7083F /* VVPropertyCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD61796E09E006719AA /* VVPropertyCommenter.m */; };
25+
D14110AB1988C12000A7083F /* VVMethodCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD91796E0AC006719AA /* VVMethodCommenter.m */; };
26+
D14110AC1988C12000A7083F /* VVFunctionCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCDC1796E0B9006719AA /* VVFunctionCommenter.m */; };
27+
D14110AD1988C12000A7083F /* VVSwiftFunctionCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D13EDDD81987F34C0029A555 /* VVSwiftFunctionCommenter.m */; };
28+
D14110AE1988C12000A7083F /* VVMacroCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCDF1796E0C0006719AA /* VVMacroCommenter.m */; };
29+
D14110AF1988C12000A7083F /* VVStructCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE21796E0C9006719AA /* VVStructCommenter.m */; };
30+
D14110B01988C12000A7083F /* VVEnumCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE51796E0D0006719AA /* VVEnumCommenter.m */; };
31+
D14110B11988C12000A7083F /* VVVariableCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE81796E0D6006719AA /* VVVariableCommenter.m */; };
32+
D14110B21988C12F00A7083F /* VVKeyboardEventSender.m in Sources */ = {isa = PBXBuildFile; fileRef = D1D66CA717A2AEF000E62F99 /* VVKeyboardEventSender.m */; };
33+
D14110B31988C12F00A7083F /* NSString+VVSyntax.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462F417999CEC00EB7B23 /* NSString+VVSyntax.m */; };
34+
D14110B41988C12F00A7083F /* NSString+PDRegex.m in Sources */ = {isa = PBXBuildFile; fileRef = D114BEDE179644D00043FA65 /* NSString+PDRegex.m */; };
35+
D14110B51988C12F00A7083F /* NSTextView+VVTextGetter.m in Sources */ = {isa = PBXBuildFile; fileRef = D114BEE2179644FA0043FA65 /* NSTextView+VVTextGetter.m */; };
36+
D14110B61988C12F00A7083F /* VVDocumenterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D16917DE17955C8D0036C06B /* VVDocumenterManager.m */; };
37+
D14110B71988C12F00A7083F /* VVDocumenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D1AC3B8E1796DB070063A484 /* VVDocumenter.m */; };
38+
D14110B81988C14500A7083F /* VVDocumenterSetting.m in Sources */ = {isa = PBXBuildFile; fileRef = D124614317AC16820095F9D6 /* VVDocumenterSetting.m */; };
39+
D14110B91988C14500A7083F /* VVDSettingPanelWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = D124614517AC16820095F9D6 /* VVDSettingPanelWindowController.m */; };
1940
D14380F7179551B900C829CE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D14380F6179551B900C829CE /* Cocoa.framework */; };
2041
D1438101179551B900C829CE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D14380FF179551B900C829CE /* InfoPlist.strings */; };
2142
D16AFCD41796E088006719AA /* VVBaseCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD31796E088006719AA /* VVBaseCommenter.m */; };
@@ -26,33 +47,15 @@
2647
D16AFCE31796E0C9006719AA /* VVStructCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE21796E0C9006719AA /* VVStructCommenter.m */; };
2748
D16AFCE61796E0D0006719AA /* VVEnumCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE51796E0D0006719AA /* VVEnumCommenter.m */; };
2849
D16AFCE91796E0D6006719AA /* VVVariableCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE81796E0D6006719AA /* VVVariableCommenter.m */; };
29-
D17B50CA179A34C400B11773 /* VVBaseCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD31796E088006719AA /* VVBaseCommenter.m */; };
3050
D18224DC17956290001A5E8A /* VVDocumenterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D16917DE17955C8D0036C06B /* VVDocumenterManager.m */; };
3151
D1986F74179A12BD00EA6643 /* CommenterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D1986F73179A12BD00EA6643 /* CommenterTests.m */; };
3252
D1AC3B8F1796DB070063A484 /* VVDocumenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D1AC3B8E1796DB070063A484 /* VVDocumenter.m */; };
33-
D1AE501C179A161A0069411A /* VVArgument.m in Sources */ = {isa = PBXBuildFile; fileRef = D11C542B17999D9000D3DE38 /* VVArgument.m */; };
3453
D1B316D6189A2AA700420A6E /* VVMethodTestsCode.plist in Resources */ = {isa = PBXBuildFile; fileRef = D1B316D5189A2AA700420A6E /* VVMethodTestsCode.plist */; };
35-
D1B316DB189A2C3B00420A6E /* VVDSettingPanelWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = D124614517AC16820095F9D6 /* VVDSettingPanelWindowController.m */; };
36-
D1B316DC189A2C3B00420A6E /* VVKeyboardEventSender.m in Sources */ = {isa = PBXBuildFile; fileRef = D1D66CA717A2AEF000E62F99 /* VVKeyboardEventSender.m */; };
37-
D1B316DD189A2C3B00420A6E /* VVDocumenterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D16917DE17955C8D0036C06B /* VVDocumenterManager.m */; };
38-
D1B316DE189A2C3B00420A6E /* VVDocumenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D1AC3B8E1796DB070063A484 /* VVDocumenter.m */; };
39-
D1B316DF189A2C7800420A6E /* VVPropertyCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD61796E09E006719AA /* VVPropertyCommenter.m */; };
40-
D1B316E0189A2C7800420A6E /* VVMethodCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCD91796E0AC006719AA /* VVMethodCommenter.m */; };
41-
D1B316E1189A2C7800420A6E /* VVFunctionCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCDC1796E0B9006719AA /* VVFunctionCommenter.m */; };
42-
D1B316E2189A2C7800420A6E /* VVMacroCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCDF1796E0C0006719AA /* VVMacroCommenter.m */; };
43-
D1B316E3189A2C7800420A6E /* VVStructCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE21796E0C9006719AA /* VVStructCommenter.m */; };
44-
D1B316E4189A2C7800420A6E /* VVEnumCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE51796E0D0006719AA /* VVEnumCommenter.m */; };
45-
D1B316E5189A2C7800420A6E /* VVVariableCommenter.m in Sources */ = {isa = PBXBuildFile; fileRef = D16AFCE81796E0D6006719AA /* VVVariableCommenter.m */; };
4654
D1C462DD17999C2000EB7B23 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D14380F6179551B900C829CE /* Cocoa.framework */; };
4755
D1C462E317999C2000EB7B23 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D1C462E117999C2000EB7B23 /* InfoPlist.strings */; };
48-
D1C462E617999C2000EB7B23 /* VVDocumenterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462E517999C2000EB7B23 /* VVDocumenterTests.m */; };
49-
D1C462ED17999C9A00EB7B23 /* VVTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462EC17999C9A00EB7B23 /* VVTestHelper.m */; };
5056
D1C462F117999CA200EB7B23 /* SyntaxTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462F017999CA200EB7B23 /* SyntaxTests.m */; };
5157
D1C462F517999CEC00EB7B23 /* NSString+VVSyntax.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462F417999CEC00EB7B23 /* NSString+VVSyntax.m */; };
52-
D1C462F617999CEC00EB7B23 /* NSString+VVSyntax.m in Sources */ = {isa = PBXBuildFile; fileRef = D1C462F417999CEC00EB7B23 /* NSString+VVSyntax.m */; };
53-
D1C462F717999D0600EB7B23 /* NSString+PDRegex.m in Sources */ = {isa = PBXBuildFile; fileRef = D114BEDE179644D00043FA65 /* NSString+PDRegex.m */; };
5458
D1D66CA817A2AEF000E62F99 /* VVKeyboardEventSender.m in Sources */ = {isa = PBXBuildFile; fileRef = D1D66CA717A2AEF000E62F99 /* VVKeyboardEventSender.m */; };
55-
E19E073A17B57D2800F048C2 /* VVDocumenterSetting.m in Sources */ = {isa = PBXBuildFile; fileRef = D124614317AC16820095F9D6 /* VVDocumenterSetting.m */; };
5659
/* End PBXBuildFile section */
5760

5861
/* Begin PBXFileReference section */
@@ -69,6 +72,8 @@
6972
D124614417AC16820095F9D6 /* VVDSettingPanelWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VVDSettingPanelWindowController.h; path = "VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.h"; sourceTree = SOURCE_ROOT; };
7073
D124614517AC16820095F9D6 /* VVDSettingPanelWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VVDSettingPanelWindowController.m; path = "VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m"; sourceTree = SOURCE_ROOT; };
7174
D124614617AC16820095F9D6 /* VVDSettingPanelWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = VVDSettingPanelWindowController.xib; path = "VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.xib"; sourceTree = SOURCE_ROOT; };
75+
D13EDDD71987F34C0029A555 /* VVSwiftFunctionCommenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVSwiftFunctionCommenter.h; sourceTree = "<group>"; };
76+
D13EDDD81987F34C0029A555 /* VVSwiftFunctionCommenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VVSwiftFunctionCommenter.m; sourceTree = "<group>"; };
7277
D14070C318CE8819009B0EED /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
7378
D14380F3179551B900C829CE /* VVDocumenter-Xcode.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "VVDocumenter-Xcode.xcplugin"; sourceTree = BUILT_PRODUCTS_DIR; };
7479
D14380F6179551B900C829CE /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@@ -245,6 +250,8 @@
245250
D16AFCD91796E0AC006719AA /* VVMethodCommenter.m */,
246251
D16AFCDB1796E0B9006719AA /* VVFunctionCommenter.h */,
247252
D16AFCDC1796E0B9006719AA /* VVFunctionCommenter.m */,
253+
D13EDDD71987F34C0029A555 /* VVSwiftFunctionCommenter.h */,
254+
D13EDDD81987F34C0029A555 /* VVSwiftFunctionCommenter.m */,
248255
D16AFCDE1796E0C0006719AA /* VVMacroCommenter.h */,
249256
D16AFCDF1796E0C0006719AA /* VVMacroCommenter.m */,
250257
D16AFCE11796E0C9006719AA /* VVStructCommenter.h */,
@@ -452,6 +459,7 @@
452459
D16AFCD71796E09E006719AA /* VVPropertyCommenter.m in Sources */,
453460
D16AFCDA1796E0AC006719AA /* VVMethodCommenter.m in Sources */,
454461
D16AFCDD1796E0B9006719AA /* VVFunctionCommenter.m in Sources */,
462+
D13EDDD91987F34C0029A555 /* VVSwiftFunctionCommenter.m in Sources */,
455463
D16AFCE01796E0C0006719AA /* VVMacroCommenter.m in Sources */,
456464
D16AFCE31796E0C9006719AA /* VVStructCommenter.m in Sources */,
457465
D16AFCE61796E0D0006719AA /* VVEnumCommenter.m in Sources */,
@@ -468,26 +476,28 @@
468476
isa = PBXSourcesBuildPhase;
469477
buildActionMask = 2147483647;
470478
files = (
471-
D1B316DF189A2C7800420A6E /* VVPropertyCommenter.m in Sources */,
472-
D1B316E0189A2C7800420A6E /* VVMethodCommenter.m in Sources */,
473-
D1B316E1189A2C7800420A6E /* VVFunctionCommenter.m in Sources */,
474-
D1B316E2189A2C7800420A6E /* VVMacroCommenter.m in Sources */,
475-
D1B316E3189A2C7800420A6E /* VVStructCommenter.m in Sources */,
476-
D1B316E4189A2C7800420A6E /* VVEnumCommenter.m in Sources */,
477-
D1B316E5189A2C7800420A6E /* VVVariableCommenter.m in Sources */,
478-
D1B316DB189A2C3B00420A6E /* VVDSettingPanelWindowController.m in Sources */,
479-
D1B316DC189A2C3B00420A6E /* VVKeyboardEventSender.m in Sources */,
480-
D1B316DD189A2C3B00420A6E /* VVDocumenterManager.m in Sources */,
481-
D1B316DE189A2C3B00420A6E /* VVDocumenter.m in Sources */,
482-
D17B50CA179A34C400B11773 /* VVBaseCommenter.m in Sources */,
483-
D1AE501C179A161A0069411A /* VVArgument.m in Sources */,
484-
D1C462F717999D0600EB7B23 /* NSString+PDRegex.m in Sources */,
485-
D1C462E617999C2000EB7B23 /* VVDocumenterTests.m in Sources */,
486-
D1C462ED17999C9A00EB7B23 /* VVTestHelper.m in Sources */,
479+
D14110B81988C14500A7083F /* VVDocumenterSetting.m in Sources */,
480+
D14110B91988C14500A7083F /* VVDSettingPanelWindowController.m in Sources */,
481+
D14110B21988C12F00A7083F /* VVKeyboardEventSender.m in Sources */,
482+
D14110B31988C12F00A7083F /* NSString+VVSyntax.m in Sources */,
483+
D14110B41988C12F00A7083F /* NSString+PDRegex.m in Sources */,
484+
D14110B51988C12F00A7083F /* NSTextView+VVTextGetter.m in Sources */,
485+
D14110B61988C12F00A7083F /* VVDocumenterManager.m in Sources */,
486+
D14110B71988C12F00A7083F /* VVDocumenter.m in Sources */,
487+
D14110A81988C12000A7083F /* VVArgument.m in Sources */,
488+
D14110A91988C12000A7083F /* VVBaseCommenter.m in Sources */,
489+
D14110AA1988C12000A7083F /* VVPropertyCommenter.m in Sources */,
490+
D14110AB1988C12000A7083F /* VVMethodCommenter.m in Sources */,
491+
D14110AC1988C12000A7083F /* VVFunctionCommenter.m in Sources */,
492+
D14110AD1988C12000A7083F /* VVSwiftFunctionCommenter.m in Sources */,
493+
D14110AE1988C12000A7083F /* VVMacroCommenter.m in Sources */,
494+
D14110AF1988C12000A7083F /* VVStructCommenter.m in Sources */,
495+
D14110B01988C12000A7083F /* VVEnumCommenter.m in Sources */,
496+
D14110B11988C12000A7083F /* VVVariableCommenter.m in Sources */,
497+
D14110A71988C08700A7083F /* VVDocumenterTests.m in Sources */,
498+
D14110A61988C07E00A7083F /* VVTestHelper.m in Sources */,
487499
D1C462F117999CA200EB7B23 /* SyntaxTests.m in Sources */,
488-
D1C462F617999CEC00EB7B23 /* NSString+VVSyntax.m in Sources */,
489500
D1986F74179A12BD00EA6643 /* CommenterTests.m in Sources */,
490-
E19E073A17B57D2800F048C2 /* VVDocumenterSetting.m in Sources */,
491501
);
492502
runOnlyForDeploymentPostprocessing = 0;
493503
};

VVDocumenter-Xcode/Commenter/VVBaseCommenter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
@property (nonatomic, assign) BOOL hasReturn;
1717

1818
-(id) initWithIndentString:(NSString *)indent codeString:(NSString *)code;
19-
-(NSString *) document;
19+
20+
-(NSString *) documentForC;
21+
-(NSString *) documentForSwift;
2022

2123
-(void) parseArgumentsInputArgs:(NSString *)rawArgsCode;
2224

VVDocumenter-Xcode/Commenter/VVBaseCommenter.m

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,31 @@
1313

1414
@interface VVBaseCommenter()
1515
@property (nonatomic, copy) NSString *space;
16+
@property (nonatomic, assign) BOOL forSwift;
1617
@end
1718

1819
@implementation VVBaseCommenter
1920
-(id) initWithIndentString:(NSString *)indent codeString:(NSString *)code
2021
{
2122
self = [super init];
2223
if (self) {
23-
self.indent = indent;
24-
self.code = code;
25-
self.arguments = [NSMutableArray array];
26-
self.space = [[VVDocumenterSetting defaultSetting] spacesString];
24+
_indent = indent;
25+
_code = code;
26+
_arguments = [NSMutableArray array];
27+
_space = [[VVDocumenterSetting defaultSetting] spacesString];
28+
_forSwift = NO;
2729
}
2830
return self;
2931
}
3032

33+
-(NSString *) paramSymbol {
34+
return self.forSwift ? @":param:" : @"@param";
35+
}
36+
37+
-(NSString *) returnSymbol {
38+
return self.forSwift ? @":returns:" : @"@return";
39+
}
40+
3141
-(NSString *) startComment
3242
{
3343
if ([[VVDocumenterSetting defaultSetting] useHeaderDoc]) {
@@ -56,7 +66,7 @@ -(NSString *) argumentsComment
5666
name = [name stringByPaddingToLength:longestNameLength withString:@" " startingAtIndex:0];
5767
}
5868

59-
[result appendFormat:@"%@@param %@ <#%@ description#>\n", self.prefixString, name, arg.name];
69+
[result appendFormat:@"%@%@ %@ <#%@ description#>\n", self.prefixString, [self paramSymbol], name, arg.name];
6070
}
6171
return result;
6272
}
@@ -66,13 +76,14 @@ -(NSString *) returnComment
6676
if (!self.hasReturn) {
6777
return @"";
6878
} else {
69-
return [NSString stringWithFormat:@"%@%@@return <#return value description#>\n", self.emptyLine, self.prefixString];
79+
return [NSString stringWithFormat:@"%@%@%@ <#return value description#>\n", self.emptyLine, self.prefixString, [self returnSymbol]];
7080
}
7181
}
7282

7383
-(NSString *) sinceComment
7484
{
75-
if ([[VVDocumenterSetting defaultSetting] addSinceToComments]) {
85+
//It seems no since attribute for swift? Maybe I am wrong.
86+
if (!self.forSwift && [[VVDocumenterSetting defaultSetting] addSinceToComments]) {
7687
return [NSString stringWithFormat:@"%@%@@since <#version number#>\n", self.emptyLine, self.prefixString];
7788
} else {
7889
return @"";
@@ -88,6 +99,18 @@ -(NSString *) endComment
8899
}
89100
}
90101

102+
-(NSString *) documentForSwift
103+
{
104+
self.forSwift = YES;
105+
return [self document];
106+
}
107+
108+
-(NSString *) documentForC
109+
{
110+
self.forSwift = NO;
111+
return [self document];
112+
}
113+
91114
-(NSString *) document
92115
{
93116
NSString * comment = [NSString stringWithFormat:@"%@%@%@%@%@",
@@ -96,7 +119,7 @@ -(NSString *) document
96119
[self returnComment],
97120
[self sinceComment],
98121
[self endComment]];
99-
122+
100123
// The last line of the comment should be adjacent to the next line of code,
101124
// back off the newline from the last comment component.
102125
if ([[VVDocumenterSetting defaultSetting] prefixWithSlashes]) {

VVDocumenter-Xcode/Commenter/VVCommenter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
#import "VVStructCommenter.h"
1919
#import "VVVariableCommenter.h"
2020
#import "VVArgument.h"
21+
#import "VVSwiftFunctionCommenter.h"
2122

2223
#endif

VVDocumenter-Xcode/Commenter/VVEnumCommenter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@implementation VVEnumCommenter
1212

13-
- (NSString *)document {
13+
- (NSString *)documentForC {
1414
//Regular comment documentation
1515
NSString *finalString = [NSString stringWithFormat:@"%@%@%@", [self startComment],
1616
[self sinceComment],

VVDocumenter-Xcode/Commenter/VVFunctionCommenter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ -(void) captureParameters
3636
}];
3737
}
3838

39-
-(NSString *) document
39+
-(NSString *) documentForC
4040
{
4141
[self captureReturnType];
4242
[self captureParameters];
4343

44-
return [super document];
44+
return [super documentForC];
4545
}
4646

4747
@end

VVDocumenter-Xcode/Commenter/VVMacroCommenter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ -(void) captureParameters
2323
}
2424
}
2525

26-
-(NSString *) document
26+
-(NSString *) documentForC
2727
{
2828
[self captureReturnType];
2929
[self captureParameters];
3030

31-
return [super document];
31+
return [super documentForC];
3232
}
3333

3434
@end

VVDocumenter-Xcode/Commenter/VVMethodCommenter.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ -(void) captureParameters
3535
}
3636
}
3737

38-
-(NSString *) document
38+
-(NSString *) documentForC
3939
{
4040
[self captureReturnType];
4141
[self captureParameters];
4242

43-
return [super document];
43+
return [super documentForC];
4444
}
4545

4646
@end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// VVSwiftFunctionCommenter.h
3+
// VVDocumenter-Xcode
4+
//
5+
// Created by 王 巍 on 14-7-30.
6+
// Copyright (c) 2014年 OneV's Den. All rights reserved.
7+
//
8+
9+
#import "VVBaseCommenter.h"
10+
11+
@interface VVSwiftFunctionCommenter : VVBaseCommenter
12+
13+
@end

0 commit comments

Comments
 (0)