diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3a27b3f --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Wei Wang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 92d3a87..bf5346a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ # VVDocumenter-Xcode [![Build Status](https://api.travis-ci.org/onevcat/VVDocumenter-Xcode.svg)](https://travis-ci.org/onevcat/VVDocumenter-Xcode) Flattr this --- +# Goodbye World + +In Xcode 8, Apple integrated a comment documentation generator plugin, which is built on top of VVDocumenter. Now this project is proud to be a part of Apple. It means you could just use the shortcut (⌥ Option + ⌘ Command + /) to add a documentation comment to your code if you are using Xcode 8 or above! + +VVDocumenter is one of my hobby projects [from 2013](https://github.com/onevcat/VVDocumenter-Xcode/commit/6a2b604713c9fb573e229daece8286dac68ac24a), back to the age of Xcode 4. It serves well for these years and I am so glad that it helps a lot of developers to improve their productivity. Since there is no need to install this plugin anymore, the development of VVDocumenter will not continue. Yes, it's time to say goodbye, with a happy ending. + +Thank you all for your selfless support to this project. Let's build more great things and make the world better in future! + ## What is this? -Writing document is so important for developing, but it is really painful with Xcode. Think about how much time you are wasting in pressing '*' or '/', and typing the parameters again and again. Now, you can find the method (or any code) you want to document to, and type in `///`, the document will be generated for you and all params and return will be extracted into a Javadoc style, which is compatible with [appledoc](https://github.com/tomaz/appledoc), [Doxygen](http://www.stack.nl/~dimitri/doxygen/) and [HeaderDoc](https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html). You can just fill the inline placeholder tokens to finish your document. +Writing documentation is so important for developing, but it is really painful with Xcode. Think about how much time you are wasting in pressing '*' or '/', and typing the parameters again and again. Now, you can find the method (or any code) you want to document to, and type in `///`, the document will be generated for you and all params and return will be extracted into a Javadoc style, which is compatible with [appledoc](https://github.com/tomaz/appledoc), [Doxygen](http://www.stack.nl/~dimitri/doxygen/) and [HeaderDoc](https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html). You can just fill the inline placeholder tokens to finish your document. Here is an image which can show what it exactly does. @@ -23,7 +31,7 @@ If you want to use other text beside of `///` to trigger the document insertion, ## Xcode version? -This plug-in is supported in Xcode 5, 6 and 7 (current beta). From Xcode 5, Apple added a UUID-verification to all plugins to ensure the stability when Xcode gets updated. The value of `DVTPlugInCompatibilityUUIDs` in project plist should contains current UUID of Xcode version, or the plugin does not work. And from Xcode 6.3, you will be prompt to "Load third party bundle" if you are using a plugin. You should always select "Load bundles" to enable this plugin. +This plug-in is supported in Xcode 5, 6 and 7. From Xcode 5, Apple added a UUID-verification to all plugins to ensure the stability when Xcode gets updated. The value of `DVTPlugInCompatibilityUUIDs` in project plist should contains current UUID of Xcode version, or the plugin does not work. And from Xcode 6.3, you will be prompt to "Load third party bundle" if you are using a plugin. You should always select "Load bundles" to enable this plugin. All plugins will be disabled once you update your Xcode, since the supported UUIDs in the plugins do not contain the one. You should try to clean your plugins folder (`~/Library/Application Support/Developer/Shared/Xcode/Plug-ins` by default) and clone/build the latest version from master branch. If you happened to skip the bundle loading, you can use this to reset the prompt: @@ -37,7 +45,9 @@ The default deployment target is 10.8. If you want to use it in a earlier OS ver ## Swift Support -Yes, this plugin supports documentation for Swift now. Check [this post](http://nshipster.com/swift-documentation/) from @mattt to see how to write the documentation for swift. By using `VVDocumenter-Xcode`, you can just type `///` to make the magic happen. +Yes, this plugin supports documentation for Swift 2 now. Check [this post](http://ericasadun.com/2015/06/14/swift-header-documentation-in-xcode-7/) to see how to write the documentation for swift. By using `VVDocumenter-Xcode`, you can just type `///` to make the magic happen. + +The documentation format changed from Swift 1.x to 2. If you are using Swift 1.x, you could build from branch [Xcode6](https://github.com/onevcat/VVDocumenter-Xcode/tree/Xcode6) to get the support for the earlier format. ## Limitations and Future @@ -52,23 +62,6 @@ If you have modified these two shortcuts in your Xcode, the newset version of th ## License -VVDocumenter is published under MIT License - - Copyright (c) 2014 Wei Wang (@onevcat) - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +VVDocumenter is published under MIT License. See the LICENSE file for more. + + diff --git a/VVDocumenter-Xcode.xcodeproj/project.pbxproj b/VVDocumenter-Xcode.xcodeproj/project.pbxproj index 5b24ac4..c79f721 100644 --- a/VVDocumenter-Xcode.xcodeproj/project.pbxproj +++ b/VVDocumenter-Xcode.xcodeproj/project.pbxproj @@ -428,7 +428,6 @@ D1C462D517999C2000EB7B23 /* Sources */, D1C462D617999C2000EB7B23 /* Frameworks */, D1C462D717999C2000EB7B23 /* Resources */, - D1C462D817999C2000EB7B23 /* ShellScript */, ); buildRules = ( ); @@ -446,7 +445,7 @@ isa = PBXProject; attributes = { LastTestingUpgradeCheck = 0510; - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "OneV's Den"; }; buildConfigurationList = D14380EE179551B900C829CE /* Build configuration list for PBXProject "VVDocumenter-Xcode" */; @@ -488,22 +487,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - D1C462D817999C2000EB7B23 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ D14380EF179551B900C829CE /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -607,6 +590,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -663,6 +647,7 @@ GCC_PREFIX_HEADER = "VVDocumenter-Xcode/VVDocumenter-Xcode-Prefix.pch"; INFOPLIST_FILE = "VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; + PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; @@ -682,6 +667,7 @@ INFOPLIST_FILE = "VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; @@ -700,16 +686,12 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VVDocumenterTests/VVDocumenterTests-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - __DEBUG__, - ); HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, ); INFOPLIST_FILE = "VVDocumenterTests/VVDocumenterTests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -733,6 +715,7 @@ ); INFOPLIST_FILE = "VVDocumenterTests/VVDocumenterTests-Info.plist"; ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/VVDocumenter-Xcode.xcodeproj/xcshareddata/xcschemes/VVDocumenter-Xcode.xcscheme b/VVDocumenter-Xcode.xcodeproj/xcshareddata/xcschemes/VVDocumenter-Xcode.xcscheme index 6f07a67..78655af 100644 --- a/VVDocumenter-Xcode.xcodeproj/xcshareddata/xcschemes/VVDocumenter-Xcode.xcscheme +++ b/VVDocumenter-Xcode.xcodeproj/xcshareddata/xcschemes/VVDocumenter-Xcode.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,16 +62,25 @@ ReferencedContainer = "container:VVDocumenter-Xcode.xcodeproj"> + + + debugServiceExtension = "internal" + allowLocationSimulation = "YES" + viewDebuggingEnabled = "No"> + + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -39,15 +39,18 @@ + + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/Commenter/VVArgument.m b/VVDocumenter-Xcode/Commenter/VVArgument.m index 16c8143..5b1956c 100755 --- a/VVDocumenter-Xcode/Commenter/VVArgument.m +++ b/VVDocumenter-Xcode/Commenter/VVArgument.m @@ -1,10 +1,28 @@ // // Argument.m -// CommentTest +// VVDocumenter-Xcode // // Created by 王 巍 on 13-7-19. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVArgument.h" diff --git a/VVDocumenter-Xcode/Commenter/VVBaseCommenter.h b/VVDocumenter-Xcode/Commenter/VVBaseCommenter.h index dbe5a67..d42b3b4 100755 --- a/VVDocumenter-Xcode/Commenter/VVBaseCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVBaseCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import @@ -14,6 +32,7 @@ @property (nonatomic, copy) NSString *code; @property (nonatomic, strong) NSMutableArray *arguments; @property (nonatomic, assign) BOOL hasReturn; +@property (nonatomic, assign) BOOL hasThrows; -(instancetype) initWithIndentString:(NSString *)indent codeString:(NSString *)code; diff --git a/VVDocumenter-Xcode/Commenter/VVBaseCommenter.m b/VVDocumenter-Xcode/Commenter/VVBaseCommenter.m index 0767068..a735ff1 100755 --- a/VVDocumenter-Xcode/Commenter/VVBaseCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVBaseCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" #import "VVArgument.h" @@ -34,17 +52,23 @@ -(instancetype) initWithIndentString:(NSString *)indent codeString:(NSString *)c } -(NSString *) paramSymbol { - return self.forSwift ? @":param:" : @"@param"; + return self.forSwift ? @"- parameter" : @"@param"; } -(NSString *) returnSymbol { - return self.forSwift ? @":returns:" : @"@return"; + return self.forSwift ? @"- returns:" : @"@return"; } +-(NSString *) throwsSymbol { + return @"- throws:"; +} + + -(NSString *) startCommentWithDescriptionTag:(NSString *)tag { NSString *authorInfo = @""; + NSString *dateInfo = @""; - if ([[VVDocumenterSetting defaultSetting] useAuthorInformation] && !self.forSwift) { + if ([[VVDocumenterSetting defaultSetting] useAuthorInformation]) { NSMutableString *authorCotent = @"".mutableCopy; if ([[VVDocumenterSetting defaultSetting] authorInformation].length > 0) { @@ -59,13 +83,27 @@ -(NSString *) startCommentWithDescriptionTag:(NSString *)tag { NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:formatString]; - if (authorCotent.length > 0) { - [authorCotent appendString:@", "]; + dateInfo = [formatter stringFromDate:[NSDate date]]; + + if (self.forSwift) { + [authorCotent appendString: [NSString stringWithFormat:@"\n%@- date: %@", self.prefixString, dateInfo]]; + } else { + + if (authorCotent.length > 0) { + [authorCotent appendString:@", "]; + } + + [authorCotent appendString: dateInfo]; } - [authorCotent appendString:[formatter stringFromDate:[NSDate date]]]; + + } + + if (self.forSwift) { + authorInfo = [NSString stringWithFormat:@"\n%@- author: %@\n", self.prefixString, authorCotent]; + } else { + authorInfo = [NSString stringWithFormat:@"%@@author %@\n%@\n", self.prefixString, authorCotent, self.prefixString]; } - authorInfo = [NSString stringWithFormat:@"%@@author %@\n%@\n", self.prefixString, authorCotent, self.prefixString]; } if ([[VVDocumenterSetting defaultSetting] useHeaderDoc]) { @@ -73,14 +111,20 @@ -(NSString *) startCommentWithDescriptionTag:(NSString *)tag { } else if ([[VVDocumenterSetting defaultSetting] prefixWithSlashes]) { return [NSString stringWithFormat:@"%@%@%@<#Description#>\n", self.prefixString, authorInfo, tag]; } else { - return [NSString stringWithFormat:@"%@/**\n%@%@%@<#Description#>\n", self.indent, authorInfo, self.prefixString, tag]; + + if (self.forSwift){ + return [NSString stringWithFormat:@"%@/**\n%@%@<#Description#>\n%@", self.indent, self.prefixString, tag, authorInfo]; + } else { + return [NSString stringWithFormat:@"%@/**\n%@%@%@<#Description#>\n", self.indent, authorInfo, self.prefixString, tag]; + } + } } -(NSString *) startComment { NSString *descriptionTag = - [[VVDocumenterSetting defaultSetting] briefDescription] && !self.forSwift ? @"@brief " : @""; + [[VVDocumenterSetting defaultSetting] briefDescription] && !self.forSwift ? @"@brief " : @""; return [self startCommentWithDescriptionTag:descriptionTag]; } @@ -108,15 +152,31 @@ -(NSString *) argumentsComment name = [[name stringByAppendingString:@":"] stringByPaddingToLength:(name.length + 1 + neededTabCount) withString:@"\t" startingAtIndex:0]; } } else { - if (useSpace) { - name = [name stringByPaddingToLength:longestNameLength withString:@" " startingAtIndex:0]; + if (self.forSwift) { + name = [name stringByAppendingString:@":"]; + if (useSpace) { + name = [name stringByPaddingToLength:longestNameLength + 1 withString:@" " startingAtIndex:0]; + } else { + NSInteger tabSpaceRateCount = [[VVDocumenterSetting defaultSetting] spaceCount]; + NSInteger neededTabCount = (longestNameLength + 1 + tabSpaceRateCount - name.length) / tabSpaceRateCount - 1; + name = [name stringByPaddingToLength:(name.length + neededTabCount) withString:@"\t" startingAtIndex:0]; + } } else { - NSInteger tabSpaceRateCount = [[VVDocumenterSetting defaultSetting] spaceCount]; - NSInteger neededTabCount = (longestNameLength + tabSpaceRateCount - name.length) / tabSpaceRateCount - 1; - name = [name stringByPaddingToLength:(name.length + neededTabCount) withString:@"\t" startingAtIndex:0]; + if (useSpace) { + name = [name stringByPaddingToLength:longestNameLength withString:@" " startingAtIndex:0]; + } else { + NSInteger tabSpaceRateCount = [[VVDocumenterSetting defaultSetting] spaceCount]; + NSInteger neededTabCount = (longestNameLength + tabSpaceRateCount - name.length) / tabSpaceRateCount - 1; + name = [name stringByPaddingToLength:(name.length + neededTabCount) withString:@"\t" startingAtIndex:0]; + } } } } + else { + if (self.forSwiftEnum || self.forSwift) { + name = [name stringByAppendingString:@":"]; + } + } NSString *indentString = useSpace ? @" " : @"\t"; if (self.forSwiftEnum) { @@ -138,16 +198,54 @@ -(NSString *) returnComment } } +-(NSString *) throwsComment +{ + if (!self.hasThrows) { + return @""; + } else { + return [NSString stringWithFormat:@"%@%@%@ <#throws value description#>\n", self.emptyLine, self.prefixString, [self throwsSymbol]]; + } +} + -(NSString *) sinceComment { //It seems no since attribute for swift? Maybe I am wrong. VVProject *project = [VVProject projectForKeyWindow]; if (!self.forSwift && [[VVDocumenterSetting defaultSetting] addSinceToComments]) { - if (project.projectVersion && project.projectVersion.length>0) { - return [NSString stringWithFormat:@"%@%@@since <#%@#>\n", self.emptyLine, self.prefixString,project.projectVersion]; - }else{ - return [NSString stringWithFormat:@"%@%@@since <#version number#>\n", self.emptyLine, self.prefixString]; + + VVDSinceOption sinceOption = [[VVDocumenterSetting defaultSetting] sinceOption]; + + switch (sinceOption) { + case VVDSinceOptionPlaceholder: { + + return [NSString stringWithFormat:@"%@%@@since <#version number#>\n", self.emptyLine, self.prefixString]; + break; + } + case VVDSinceOptionProjectVersion: { + + if (project.projectVersion && project.projectVersion.length>0) { + + return [NSString stringWithFormat:@"%@%@@since <#%@#>\n", self.emptyLine, self.prefixString,project.projectVersion]; + }else{ + // Fall back onto default placeholder if no project version can be obtained. + return [NSString stringWithFormat:@"%@%@@since <#version number#>\n", self.emptyLine, self.prefixString]; + } + + break; + } + case VVDSinceOptionSpecificVersion: { + + NSString *version = [[VVDocumenterSetting defaultSetting] sinceVersion]; + if (version && version.length>0) { + + return [NSString stringWithFormat:@"%@%@@since <#%@#>\n", self.emptyLine, self.prefixString, version]; + }else{ + // Fall back onto default placeholder if no version can be obtained. + return [NSString stringWithFormat:@"%@%@@since <#version number#>\n", self.emptyLine, self.prefixString]; + } + break; + } } } else { return @""; @@ -184,9 +282,10 @@ -(NSString *) documentForC -(NSString *) __document { - NSString * comment = [NSString stringWithFormat:@"%@%@%@%@%@", + NSString * comment = [NSString stringWithFormat:@"%@%@%@%@%@%@", [self startComment], [self argumentsComment], + [self throwsComment], [self returnComment], [self sinceComment], [self endComment]]; diff --git a/VVDocumenter-Xcode/Commenter/VVCommenter.h b/VVDocumenter-Xcode/Commenter/VVCommenter.h index 27b0628..319a130 100755 --- a/VVDocumenter-Xcode/Commenter/VVCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVCommenter.h @@ -1,10 +1,28 @@ // // VVCommenter.h -// VVCommentTest +// VVDocumenter-Xcode // // Created by 王 巍 on 13-7-18. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #ifndef CommentTest_Commenter_h #define CommentTest_Commenter_h diff --git a/VVDocumenter-Xcode/Commenter/VVEnumCommenter.h b/VVDocumenter-Xcode/Commenter/VVEnumCommenter.h index 2062e09..d406407 100755 --- a/VVDocumenter-Xcode/Commenter/VVEnumCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVEnumCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVEnumCommenter.m b/VVDocumenter-Xcode/Commenter/VVEnumCommenter.m index c2c3125..d06c6fe 100755 --- a/VVDocumenter-Xcode/Commenter/VVEnumCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVEnumCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVEnumCommenter.h" @@ -28,7 +46,8 @@ - (NSString *)document { NSTextCheckingResult *enumDefineResult = [enumDefineExpression firstMatchInString:self.code options:0 range:NSMakeRange(0, self.code.length)]; finalString = [finalString stringByAppendingString:[self.code substringWithRange:[enumDefineResult rangeAtIndex:0]]]; - finalString = [finalString stringByAppendingString:@"\n"]; + finalString = [finalString substringToIndex:finalString.length - 1]; + finalString = [finalString stringByAppendingString:@" {\n"]; NSString *endPattern = @"\\}\\s*;"; NSString *enumPartsString = [[self.code vv_stringByReplacingRegexPattern:enumDefinePattern withString:@""] diff --git a/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.h b/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.h index b59a687..f0c3737 100755 --- a/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.m b/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.m index 248f14a..7d5701f 100755 --- a/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVFunctionCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVFunctionCommenter.h" #import "VVArgument.h" diff --git a/VVDocumenter-Xcode/Commenter/VVMacroCommenter.h b/VVDocumenter-Xcode/Commenter/VVMacroCommenter.h index 9128c42..09b9dd5 100755 --- a/VVDocumenter-Xcode/Commenter/VVMacroCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVMacroCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVMacroCommenter.m b/VVDocumenter-Xcode/Commenter/VVMacroCommenter.m index a998c59..64c6adf 100755 --- a/VVDocumenter-Xcode/Commenter/VVMacroCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVMacroCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVMacroCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVMethodCommenter.h b/VVDocumenter-Xcode/Commenter/VVMethodCommenter.h index b1b2464..a030659 100755 --- a/VVDocumenter-Xcode/Commenter/VVMethodCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVMethodCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVMethodCommenter.m b/VVDocumenter-Xcode/Commenter/VVMethodCommenter.m index 3d60ce3..028dadf 100755 --- a/VVDocumenter-Xcode/Commenter/VVMethodCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVMethodCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVMethodCommenter.h" #import "VVArgument.h" diff --git a/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.h b/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.h index 2833199..4da87cb 100755 --- a/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.m b/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.m index 306406c..1d1413e 100755 --- a/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVPropertyCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVPropertyCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVStructCommenter.h b/VVDocumenter-Xcode/Commenter/VVStructCommenter.h index 1432713..91a7355 100755 --- a/VVDocumenter-Xcode/Commenter/VVStructCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVStructCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVStructCommenter.m b/VVDocumenter-Xcode/Commenter/VVStructCommenter.m index c40f358..129c231 100755 --- a/VVDocumenter-Xcode/Commenter/VVStructCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVStructCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVStructCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.h b/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.h index 0af5f75..4c94347 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-30. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.m b/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.m index 35bdedc..302823a 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVSwiftEnumCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-30. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVSwiftEnumCommenter.h" #import "VVArgument.h" diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.h b/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.h index a607664..5244c06 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by WANG WEI on 2015/06/17. -// Copyright (c) 2015年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.m b/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.m index bd5e8ca..8711ea7 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVSwiftExtensionCommenter.m @@ -3,14 +3,38 @@ // VVDocumenter-Xcode // // Created by WANG WEI on 2015/06/17. -// Copyright (c) 2015年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVSwiftExtensionCommenter.h" @implementation VVSwiftExtensionCommenter -(NSString *) document { - return @"// MARK: - <#Description#>"; + NSArray *component = [[self.code stringByReplacingOccurrencesOfString:@"{" withString:@""] componentsSeparatedByString:@":"]; + NSString *description = @"Description"; + if (component.count == 2) { + description = [component.lastObject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + } + + return [NSString stringWithFormat:@"// MARK: - <#%@#>", description]; } @end diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.h b/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.h index 9f48318..440d38c 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-30. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.m b/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.m index 0806805..ca8bc5d 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVSwiftFunctionCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-30. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVSwiftFunctionCommenter.h" #import "VVArgument.h" @@ -15,7 +33,11 @@ @implementation VVSwiftFunctionCommenter -(void) captureReturnType { VVTextResult *funcParenthesesResult = [self.code vv_textResultMatchPartWithPairOpenString:@"(" closeString:@")" currentLocation:0]; - NSString * funcSignatureWithoutParams = [self.code stringByReplacingCharactersInRange:funcParenthesesResult.range withString:@""]; + NSString * funcSignatureWithoutParams = [self.code stringByReplacingCharactersInRange:funcParenthesesResult.range withString:@" "]; + + if ([funcSignatureWithoutParams vv_matchesPatternRegexPattern:@"\\s+(throws|rethrows)\\s+"]) { + self.hasThrows = YES; + } if ([funcSignatureWithoutParams vv_matchesPatternRegexPattern:@"\\s*->\\s*\\(?(\\Void?|\\(\\s*\\))\\)?\\s*[{]"]) { self.hasReturn = NO; @@ -49,8 +71,15 @@ -(void) parseSwiftArgumentsInputArgs:(NSString *)rawArgsCode } NSString *removedUnwantComma = [rawArgsCode vv_stringByReplacingRegexPattern:@"[{].*?[^}],.*?[)}]" withString:@""]; + NSString *removedUnwantParentheses = [removedUnwantComma copy]; + + VVTextResult *parenthesesInParam = [removedUnwantComma vv_textResultMatchPartWithPairOpenString:@"(" closeString:@")" currentLocation:0]; + while (parenthesesInParam.string) { + removedUnwantParentheses = [removedUnwantParentheses stringByReplacingOccurrencesOfString:parenthesesInParam.string withString:@""]; + parenthesesInParam = [removedUnwantParentheses vv_textResultMatchPartWithPairOpenString:@"(" closeString:@")" currentLocation:0]; + } - NSArray *argumentStrings = [removedUnwantComma componentsSeparatedByString:@","]; + NSArray *argumentStrings = [removedUnwantParentheses componentsSeparatedByString:@","]; for (__strong NSString *argumentString in argumentStrings) { VVArgument *arg = [[VVArgument alloc] init]; argumentString = [argumentString vv_stringByReplacingRegexPattern:@"=\\s*\\w*" withString:@""]; diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.h b/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.h index f7e63cc..28ed340 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-31. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.m b/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.m index 51e0c36..5c10a3d 100644 --- a/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVSwiftPropertyCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-31. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVSwiftPropertyCommenter.h" @@ -12,7 +30,7 @@ @implementation VVSwiftPropertyCommenter -(NSString *) document { - return [NSString stringWithFormat:@"%@/// <#Description#>", self.indent]; + return [NSString stringWithFormat:@"/// <#Description#>"]; } @end diff --git a/VVDocumenter-Xcode/Commenter/VVVariableCommenter.h b/VVDocumenter-Xcode/Commenter/VVVariableCommenter.h index 145293d..d049f61 100755 --- a/VVDocumenter-Xcode/Commenter/VVVariableCommenter.h +++ b/VVDocumenter-Xcode/Commenter/VVVariableCommenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVBaseCommenter.h" diff --git a/VVDocumenter-Xcode/Commenter/VVVariableCommenter.m b/VVDocumenter-Xcode/Commenter/VVVariableCommenter.m index 0b6e198..437f778 100755 --- a/VVDocumenter-Xcode/Commenter/VVVariableCommenter.m +++ b/VVDocumenter-Xcode/Commenter/VVVariableCommenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE./ #import "VVVariableCommenter.h" diff --git a/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.h b/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.h index baee497..e500713 100644 --- a/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.h +++ b/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-26. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import #import diff --git a/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.m b/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.m index 4b3a757..f2aa8e0 100644 --- a/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.m +++ b/VVDocumenter-Xcode/KeyboardHelper/VVKeyboardEventSender.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-26. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVKeyboardEventSender.h" diff --git a/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.h b/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.h index efabb30..b86d460 100755 --- a/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.h +++ b/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.h @@ -1,10 +1,28 @@ // // NSString+VVSyntax.h -// CommentTest +// VVDocumenter-Xcode // // Created by 王 巍 on 13-7-18. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.m b/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.m index 86af565..d3d1abc 100755 --- a/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.m +++ b/VVDocumenter-Xcode/OCCategory/NSString+VVSyntax/NSString+VVSyntax.m @@ -1,10 +1,28 @@ // // NSString+VVSyntax.m -// CommentTest +// VVDocumenter-Xcode // // Created by 王 巍 on 13-7-18. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "NSString+VVSyntax.h" @@ -81,6 +99,11 @@ -(BOOL) vv_isSwiftEnum -(BOOL) vv_isSwiftProperty { + // Opt out the situation of `class func` + if ([self vv_matchesPatternRegexPattern:@"class func"]) { + return NO; + } + // `let`/`var` can be in swift func, but `(` appear before `let`/`var` only // happens when `private(set)` or `internal(set)` is used // typealias is considered to share the same comment as property. diff --git a/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.h b/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.h index 10f2689..03372ce 100644 --- a/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.h +++ b/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-31. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.m b/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.m index 762b33e..663b8ac 100644 --- a/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.m +++ b/VVDocumenter-Xcode/OCCategory/NSString+VVTextGetter/NSString+VVTextGetter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-31. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "NSString+VVTextGetter.h" #import "VVTextResult.h" @@ -97,7 +115,7 @@ -(VVTextResult *) vv_textResultUntilNextString:(NSString *)findString currentLoc NSString *line = nil; if (nextLineRange.location != NSNotFound && rangeToString.location != NSNotFound && nextLineRange.location <= rangeToString.location) { NSRange lineRange = NSMakeRange(nextLineRange.location + 1, rangeToString.location - nextLineRange.location); - if (lineRange.location < [self length] && NSMaxRange(lineRange) < [self length]) { + if (lineRange.location < [self length] && NSMaxRange(lineRange) <= [self length]) { line = [self substringWithRange:lineRange]; return [[VVTextResult alloc] initWithRange:lineRange string:line]; } else { @@ -198,7 +216,7 @@ -(VVTextResult *) textResultWithPairOpenString:(NSString *)open resultRange = NSMakeRange(nextLineRange.location + 1, targetRange.location - nextLineRange.location); } - if (resultRange.location < [self length] && NSMaxRange(resultRange) < [self length]) { + if (resultRange.location < [self length] && NSMaxRange(resultRange) <= [self length]) { NSString *result = [self substringWithRange:resultRange]; return [[VVTextResult alloc] initWithRange:resultRange string:result]; } else { diff --git a/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.h b/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.h index db42249..949affc 100755 --- a/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.h +++ b/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.m b/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.m index cdccf06..54e5abd 100755 --- a/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.m +++ b/VVDocumenter-Xcode/OCCategory/NSTextView+VVTextGetter/NSTextView+VVTextGetter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "NSTextView+VVTextGetter.h" #import "VVTextResult.h" diff --git a/VVDocumenter-Xcode/OCCategory/VVTextResult.h b/VVDocumenter-Xcode/OCCategory/VVTextResult.h index bd84eef..8f5caa5 100644 --- a/VVDocumenter-Xcode/OCCategory/VVTextResult.h +++ b/VVDocumenter-Xcode/OCCategory/VVTextResult.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-31. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/OCCategory/VVTextResult.m b/VVDocumenter-Xcode/OCCategory/VVTextResult.m index 27b1ef8..d3afed9 100644 --- a/VVDocumenter-Xcode/OCCategory/VVTextResult.m +++ b/VVDocumenter-Xcode/OCCategory/VVTextResult.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 14-7-31. -// Copyright (c) 2014年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVTextResult.h" diff --git a/VVDocumenter-Xcode/ProjectHelper/VVProject.h b/VVDocumenter-Xcode/ProjectHelper/VVProject.h index 7158166..6e9541c 100644 --- a/VVDocumenter-Xcode/ProjectHelper/VVProject.h +++ b/VVDocumenter-Xcode/ProjectHelper/VVProject.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 夏天味道 on 15/6/25. -// Copyright (c) 2015年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/ProjectHelper/VVProject.m b/VVDocumenter-Xcode/ProjectHelper/VVProject.m index 3af760d..66a783e 100644 --- a/VVDocumenter-Xcode/ProjectHelper/VVProject.m +++ b/VVDocumenter-Xcode/ProjectHelper/VVProject.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 夏天味道 on 15/6/25. -// Copyright (c) 2015年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVProject.h" #import "VVWorkspaceManager.h" diff --git a/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.h b/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.h index c074c93..0ea8539 100644 --- a/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.h +++ b/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 夏天味道 on 15/6/25. -// Copyright (c) 2015年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.m b/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.m index 6ed865c..9de2b69 100644 --- a/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.m +++ b/VVDocumenter-Xcode/ProjectHelper/VVWorkspaceManager.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 夏天味道 on 15/6/25. -// Copyright (c) 2015年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVWorkspaceManager.h" diff --git a/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.h b/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.h index d243ada..43c1fca 100644 --- a/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.h +++ b/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-8-3. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m b/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m index 5421340..450c065 100644 --- a/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m +++ b/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-8-3. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVDSettingPanelWindowController.h" #import "VVDocumenterSetting.h" @@ -17,11 +35,12 @@ @interface VVDSettingPanelWindowController () @property (weak) IBOutlet NSStepper *stepperCount; +@property (weak) IBOutlet NSMatrix *mtxSinceOptions; @property (weak) IBOutlet NSMatrix *mtxPrefixOptions; @property (weak) IBOutlet NSButtonCell *btnPrefixWithWhitespace; @property (weak) IBOutlet NSButtonCell *btnPrefixWithStar; @property (weak) IBOutlet NSButtonCell *btnPrefixWithSlashes; -@property (assign) IBOutlet NSButton *btnAddSinceToComment; +@property (weak) IBOutlet NSButton *btnAddSinceToComment; @property (weak) IBOutlet NSButton *btnBriefDescription; @property (weak) IBOutlet NSButton *btnUseHeaderDoc; @property (weak) IBOutlet NSButton *btnBlankLinesBetweenSections; @@ -30,6 +49,7 @@ @interface VVDSettingPanelWindowController () @property (weak) IBOutlet NSButton *btnUseDateInformation; @property (weak) IBOutlet NSTextField *tfAuthoInformation; @property (weak) IBOutlet NSTextField *tfDateInformaitonFormat; +@property (weak) IBOutlet NSTextField *tfSinceVersion; @end @@ -54,6 +74,11 @@ - (void)windowDidLoad self.btnUseSpaces.state = (NSCellStateValue)[[VVDocumenterSetting defaultSetting] useSpaces]; self.btnAddSinceToComment.state = (NSCellStateValue)[[VVDocumenterSetting defaultSetting] addSinceToComments]; + self.mtxSinceOptions.enabled = [[VVDocumenterSetting defaultSetting] addSinceToComments]; + [self.mtxSinceOptions selectCellAtRow:(NSInteger)[[VVDocumenterSetting defaultSetting] sinceOption] column:0]; + self.tfSinceVersion.enabled = [[VVDocumenterSetting defaultSetting] addSinceToComments]; + self.tfSinceVersion.stringValue = [[VVDocumenterSetting defaultSetting] sinceVersion]; + self.btnBriefDescription.state = (NSCellStateValue)[[VVDocumenterSetting defaultSetting] briefDescription]; self.btnUseHeaderDoc.state = (NSCellStateValue)[[VVDocumenterSetting defaultSetting] useHeaderDoc]; self.btnBlankLinesBetweenSections.state = (NSCellStateValue)[[VVDocumenterSetting defaultSetting] blankLinesBetweenSections]; @@ -82,6 +107,7 @@ - (void)windowDidLoad self.tfTrigger.delegate = self; self.tfDateInformaitonFormat.delegate = self; self.tfAuthoInformation.delegate = self; + self.tfSinceVersion.delegate = self; } - (IBAction)stepperPressed:(id)sender { @@ -96,6 +122,7 @@ - (IBAction)btnResetPressed:(id)sender { [[VVDocumenterSetting defaultSetting] setPrefixWithStar:YES]; [[VVDocumenterSetting defaultSetting] setPrefixWithSlashes:NO]; [[VVDocumenterSetting defaultSetting] setAddSinceToComments:NO]; + [[VVDocumenterSetting defaultSetting] setSinceVersion:@""]; [[VVDocumenterSetting defaultSetting] setBriefDescription:NO]; [[VVDocumenterSetting defaultSetting] setUseHeaderDoc:NO]; [[VVDocumenterSetting defaultSetting] setBlankLinesBetweenSections:YES]; @@ -111,6 +138,8 @@ - (IBAction)btnResetPressed:(id)sender { self.btnPrefixWithStar.state = NSOnState; self.btnPrefixWithSlashes.state = NSOffState; self.btnAddSinceToComment.state = NSOffState; + self.tfSinceVersion.enabled = NO; + self.mtxSinceOptions.enabled = NO; self.btnBriefDescription.state = NSOffState; [self.tfTrigger setStringValue:VVDDefaultTriggerString]; self.btnUseHeaderDoc.state = NSOffState; @@ -127,6 +156,11 @@ - (IBAction)btnResetPressed:(id)sender { } +- (IBAction)mtxSinceOptionPressed:(id)sender { + VVDSinceOption option = self.mtxSinceOptions.selectedRow; + [[VVDocumenterSetting defaultSetting] setSinceOption:option]; +} + - (IBAction)btnUseSpacesPressed:(id)sender { [[VVDocumenterSetting defaultSetting] setUseSpaces:self.btnUseSpaces.state]; [self updateUseSpace:self.btnUseSpaces.state]; @@ -140,7 +174,10 @@ - (IBAction)mtxPrefixSettingPressed:(id)sender { } - (IBAction)btnAddSinceToCommentsPressed:(id)sender { - [[VVDocumenterSetting defaultSetting] setAddSinceToComments:self.btnAddSinceToComment.state]; + BOOL enableSince = self.btnAddSinceToComment.state; + [[VVDocumenterSetting defaultSetting] setAddSinceToComments:enableSince]; + self.tfSinceVersion.enabled = enableSince; + self.mtxSinceOptions.enabled = enableSince; } - (IBAction)btnBriefDescriptionPressed:(id)sender { @@ -180,6 +217,9 @@ - (void)controlTextDidChange:(NSNotification *)notification if([notification object] == self.tfDateInformaitonFormat) { [[VVDocumenterSetting defaultSetting] setDateInformationFormat:self.tfDateInformaitonFormat.stringValue]; } + if ([notification object] == self.tfSinceVersion) { + [[VVDocumenterSetting defaultSetting] setSinceVersion:self.tfSinceVersion.stringValue]; + } } - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor diff --git a/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.xib b/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.xib index 5c4c6df..cc87211 100644 --- a/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.xib +++ b/VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.xib @@ -1,1797 +1,318 @@ - - - - 1080 - 14A361c - 6245 - 1339 - 755.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 6245 - - - NSBox - NSButton - NSButtonCell - NSCustomObject - NSMatrix - NSStepper - NSStepperCell - NSTextField - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - VVDSettingPanelWindowController - - - FirstResponder - - - NSApplication - - - 3 - 2 - {{508, 391}, {463, 519}} - 544735232 - VVDocumenter Setting - NSWindow - - - - - 256 - - - - 268 - {{67, 393}, {212, 35}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Use spaces instead of tabs - - YES - 13 - 1044 - - _NS:9 - - 1211912448 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - NO - - - - 268 - {{329, 402}, {60, 17}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - spaces - - _NS:1535 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - NO - 1 - - - - 268 - {{279, 399}, {37, 22}} - - - - _NS:9 - YES - - -2075131840 - 138417152 - 123 - - _NS:9 - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - - - NO - 1 - - - - 268 - {{11, 13}, {113, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - Reset Default - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - NO - - - - 268 - {{66, 480}, {107, 17}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - Trigger Input - - _NS:1535 - - - - - NO - 1 - - - - 268 - {{279, 477}, {96, 22}} - - - - _NS:9 - YES - - -1804599231 - 71304192 - - - _NS:9 - - YES - - - - NO - 1 - - - - 268 - {{149, 192}, {241, 22}} - - - - _NS:9 - YES - - -1804599231 - 71304192 - - - _NS:9 - - YES - - - - NO - 1 - - - - 268 - {{78, 434}, {295, 38}} - - - - _NS:1535 - YES - - 67108864 - 272629760 - VVDocumenter will inspect the input and insert document comment when it matches this. - - YES - 12 - 4883 - - _NS:1535 - - YES - - - 6 - System - controlShadowColor - - 3 - MC4zMzMzMzMzMzMzAA - - - - NO - 1 - - - - 268 - {{312, 396}, {19, 27}} - - - - _NS:1099 - YES - - 786464 - 0 - _NS:1099 - - 100 - 1 - YES - - NO - - - - 268 - {{67, 372}, {201, 18}} - - - - _NS:9 - YES - - 67108864 - 268435456 - Use @since to all comments - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{67, 342}, {187, 18}} - - - - _NS:9 - YES - - 67108864 - 268435456 - Use @brief for description - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{67, 312}, {272, 18}} - - - - _NS:9 - YES - - 67108864 - 268435456 - Use /*! (HeaderDoc style) instead of /** - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{67, 284}, {272, 18}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Add blank lines between sections - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{65, 61}, {325, 85}} - - - - _NS:9 - YES - NO - 3 - 1 - - - 67108864 - 0 - Prefix each comment line with whitespace only - - - 1 - 1211912448 - 0 - - NSRadioButton - - - - 200 - 25 - - - -2080374784 - 0 - Prefix each comment line with a star (objc only) - - - 2 - 1211912448 - 0 - - 549453824 - {18, 18} - - - - - - TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw -IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ -29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 -dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA -AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG -AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/ -0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/ -7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/ -5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/ -3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD -AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns -AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/ -6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/ -/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/ -///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl -YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA -AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD -AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu -AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB -AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES -AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS -AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAxIAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAMSExp -bm8CEAAAbW50clJHQiBYWVogB84AAgAJAAYAMQAAYWNzcE1TRlQAAAAASUVDIHNSR0IAAAAAAAAAAAAA -AAAAAPbWAAEAAAAA0y1IUCAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAARY3BydAAAAVAAAAAzZGVzYwAAAYQAAABsd3RwdAAAAfAAAAAUYmtwdAAAAgQAAAAUclhZWgAA -AhgAAAAUZ1hZWgAAAiwAAAAUYlhZWgAAAkAAAAAUZG1uZAAAAlQAAABwZG1kZAAAAsQAAACIdnVlZAAA -A0wAAACGdmlldwAAA9QAAAAkbHVtaQAAA/gAAAAUbWVhcwAABAwAAAAkdGVjaAAABDAAAAAMclRSQwAA -BDwAAAgMZ1RSQwAABDwAAAgMYlRSQwAABDwAAAgMdGV4dAAAAABDb3B5cmlnaHQgKGMpIDE5OTggSGV3 -bGV0dC1QYWNrYXJkIENvbXBhbnkAAGRlc2MAAAAAAAAAEnNSR0IgSUVDNjE5NjYtMi4xAAAAAAAAAAAA -AAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAFhZWiAAAAAAAADzUQABAAAAARbMWFlaIAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAA -b6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9kZXNjAAAAAAAA -ABZJRUMgaHR0cDovL3d3dy5pZWMuY2gAAAAAAAAAAAAAABZJRUMgaHR0cDovL3d3dy5pZWMuY2gAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZGVzYwAAAAAAAAAuSUVDIDYx -OTY2LTIuMSBEZWZhdWx0IFJHQiBjb2xvdXIgc3BhY2UgLSBzUkdCAAAAAAAAAAAAAAAuSUVDIDYxOTY2 -LTIuMSBEZWZhdWx0IFJHQiBjb2xvdXIgc3BhY2UgLSBzUkdCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRl -c2MAAAAAAAAALFJlZmVyZW5jZSBWaWV3aW5nIENvbmRpdGlvbiBpbiBJRUM2MTk2Ni0yLjEAAAAAAAAA -AAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYtMi4xAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAB2aWV3AAAAAAATpP4AFF8uABDPFAAD7cwABBMLAANcngAAAAFYWVogAAAAAABM -CVYAUAAAAFcf521lYXMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAKPAAAAAnNpZyAAAAAAQ1JUIGN1 -cnYAAAAAAAAEAAAAAAUACgAPABQAGQAeACMAKAAtADIANwA7AEAARQBKAE8AVABZAF4AYwBoAG0AcgB3 -AHwAgQCGAIsAkACVAJoAnwCkAKkArgCyALcAvADBAMYAywDQANUA2wDgAOUA6wDwAPYA+wEBAQcBDQET -ARkBHwElASsBMgE4AT4BRQFMAVIBWQFgAWcBbgF1AXwBgwGLAZIBmgGhAakBsQG5AcEByQHRAdkB4QHp -AfIB+gIDAgwCFAIdAiYCLwI4AkECSwJUAl0CZwJxAnoChAKOApgCogKsArYCwQLLAtUC4ALrAvUDAAML -AxYDIQMtAzgDQwNPA1oDZgNyA34DigOWA6IDrgO6A8cD0wPgA+wD+QQGBBMEIAQtBDsESARVBGMEcQR+ -BIwEmgSoBLYExATTBOEE8AT+BQ0FHAUrBToFSQVYBWcFdwWGBZYFpgW1BcUF1QXlBfYGBgYWBicGNwZI -BlkGagZ7BowGnQavBsAG0QbjBvUHBwcZBysHPQdPB2EHdAeGB5kHrAe/B9IH5Qf4CAsIHwgyCEYIWghu -CIIIlgiqCL4I0gjnCPsJEAklCToJTwlkCXkJjwmkCboJzwnlCfsKEQonCj0KVApqCoEKmAquCsUK3Arz -CwsLIgs5C1ELaQuAC5gLsAvIC+EL+QwSDCoMQwxcDHUMjgynDMAM2QzzDQ0NJg1ADVoNdA2ODakNww3e -DfgOEw4uDkkOZA5/DpsOtg7SDu4PCQ8lD0EPXg96D5YPsw/PD+wQCRAmEEMQYRB+EJsQuRDXEPURExEx -EU8RbRGMEaoRyRHoEgcSJhJFEmQShBKjEsMS4xMDEyMTQxNjE4MTpBPFE+UUBhQnFEkUahSLFK0UzhTw -FRIVNBVWFXgVmxW9FeAWAxYmFkkWbBaPFrIW1hb6Fx0XQRdlF4kXrhfSF/cYGxhAGGUYihivGNUY+hkg -GUUZaxmRGbcZ3RoEGioaURp3Gp4axRrsGxQbOxtjG4obshvaHAIcKhxSHHscoxzMHPUdHh1HHXAdmR3D -HeweFh5AHmoelB6+HukfEx8+H2kflB+/H+ogFSBBIGwgmCDEIPAhHCFIIXUhoSHOIfsiJyJVIoIiryLd -IwojOCNmI5QjwiPwJB8kTSR8JKsk2iUJJTglaCWXJccl9yYnJlcmhya3JugnGCdJJ3onqyfcKA0oPyhx -KKIo1CkGKTgpaymdKdAqAio1KmgqmyrPKwIrNitpK50r0SwFLDksbiyiLNctDC1BLXYtqy3hLhYuTC6C -Lrcu7i8kL1ovkS/HL/4wNTBsMKQw2zESMUoxgjG6MfIyKjJjMpsy1DMNM0YzfzO4M/E0KzRlNJ402DUT -NU01hzXCNf02NzZyNq426TckN2A3nDfXOBQ4UDiMOMg5BTlCOX85vDn5OjY6dDqyOu87LTtrO6o76Dwn -PGU8pDzjPSI9YT2hPeA+ID5gPqA+4D8hP2E/oj/iQCNAZECmQOdBKUFqQaxB7kIwQnJCtUL3QzpDfUPA -RANER0SKRM5FEkVVRZpF3kYiRmdGq0bwRzVHe0fASAVIS0iRSNdJHUljSalJ8Eo3Sn1KxEsMS1NLmkvi -TCpMcky6TQJNSk2TTdxOJU5uTrdPAE9JT5NP3VAnUHFQu1EGUVBRm1HmUjFSfFLHUxNTX1OqU/ZUQlSP -VNtVKFV1VcJWD1ZcVqlW91dEV5JX4FgvWH1Yy1kaWWlZuFoHWlZaplr1W0VblVvlXDVchlzWXSddeF3J -XhpebF69Xw9fYV+zYAVgV2CqYPxhT2GiYfViSWKcYvBjQ2OXY+tkQGSUZOllPWWSZedmPWaSZuhnPWeT -Z+loP2iWaOxpQ2maafFqSGqfavdrT2una/9sV2yvbQhtYG25bhJua27Ebx5veG/RcCtwhnDgcTpxlXHw -cktypnMBc11zuHQUdHB0zHUodYV14XY+dpt2+HdWd7N4EXhueMx5KnmJeed6RnqlewR7Y3vCfCF8gXzh -fUF9oX4BfmJ+wn8jf4R/5YBHgKiBCoFrgc2CMIKSgvSDV4O6hB2EgITjhUeFq4YOhnKG14c7h5+IBIhp -iM6JM4mZif6KZIrKizCLlov8jGOMyo0xjZiN/45mjs6PNo+ekAaQbpDWkT+RqJIRknqS45NNk7aUIJSK -lPSVX5XJljSWn5cKl3WX4JhMmLiZJJmQmfyaaJrVm0Kbr5wcnImc951kndKeQJ6unx2fi5/6oGmg2KFH -obaiJqKWowajdqPmpFakx6U4pammGqaLpv2nbqfgqFKoxKk3qamqHKqPqwKrdavprFys0K1ErbiuLa6h -rxavi7AAsHWw6rFgsdayS7LCszizrrQltJy1E7WKtgG2ebbwt2i34LhZuNG5SrnCuju6tbsuu6e8Ibyb -vRW9j74KvoS+/796v/XAcMDswWfB48JfwtvDWMPUxFHEzsVLxcjGRsbDx0HHv8g9yLzJOsm5yjjKt8s2 -y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2vvbgNwF3IrdEN2W3hzeot8p36/gNuC94UThzOJT4tvjY+Pr5HPk/OWE5g3mlucf56noMui86Ubp0Opb -6uXrcOv77IbtEe2c7ijutO9A78zwWPDl8XLx//KM8xnzp/Q09ML1UPXe9m32+/eK+Bn4qPk4+cf6V/rn -+3f8B/yY/Sn9uv5L/tz/bf//A - - - - - - 3 - MCAwAA - - - - 400 - 75 - - - 67108864 - 0 - Prefix each comment line with three slashes - - - 3 - 1211912448 - 2 - - - 200 - 25 - - - {325, 28} - {4, 2} - 1143480320 - NSActionCell - - 67108864 - 0 - Prefix each comment line with three slashes - - _NS:9 - 1211912448 - 2 - - NSImage - NSRadioButton - - - - - 200 - 25 - - 1 - - - - - - - - 12 - {{67, 152}, {323, 5}} - - - - _NS:9 - {0, 0} - - 67108864 - 0 - Box - - - - 6 - System - labelColor - - - - 3 - 2 - 0 - NO - - - - 268 - {{67, 252}, {272, 18}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Align argument comments - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{66, 217}, {326, 24}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Add Default User Information (objc only) - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{83, 194}, {60, 17}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - Author: - - _NS:1535 - - - - - NO - 1 - - - - 268 - {{225, 167}, {165, 22}} - - - - _NS:9 - YES - - -1804599231 - 4195328 - MM-dd-YYYY, HH:MM:ss - - _NS:9 - - YES - - - - NO - 1 - - - - 268 - {{83, 168}, {90, 18}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Add Date - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{172, 169}, {59, 17}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - Format: - - _NS:1535 - - - - - NO - 1 - - - {463, 519} - - - - - {{0, 0}, {1680, 1027}} - {10000000000000, 10000000000000} - YES - - - - NO - - - - window - - - - 3 - - - - btnResetPressed: - - - - 33 - - - - tfTrigger - - - - 36 - - - - btnUseSpaces - - - - 37 - - - - tfSpaceCount - - - - 38 - - - - btnUseSpacesPressed: - - - - 51 - - - - tfSpaceLabel - - - - 53 - - - - stepperCount - - - - 57 - - - - stepperPressed: - - - - 58 - - - - btnAddSinceToComment - - - - 1ef-Mr-TVa - - - - btnAddSinceToCommentsPressed: - - - - mx1-gQ-vXj - - - - btnUseHeaderDoc - - - - wor-rz-Ijg - - - - useHeaderDoc: - - - - 1Wy-E1-jLv - - - - btnPrefixWithSlashes - - - - GJD-9u-PLJ - - - - btnPrefixWithStar - - - - JBV-hz-QfR - - - - btnPrefixWithWhitespace - - - - oIB-Va-SeQ - - - - mtxPrefixOptions - - - - pMl-hs-b8d - - - - mtxPrefixSettingPressed: - - - - lCp-Ch-TTG - - - - blankLinesBetweenSections: - - - - Ut9-U7-XdV - - - - btnBlankLinesBetweenSections - - - - vCY-7n-Xqh - - - - alignArgumentComments: - - - - o62-1G-Tta - - - - btnAlightArgumentComments - - - - l9g-ge-CwY - - - - btnBriefDescriptionPressed: - - - - UE3-ix-FCS - - - - btnBriefDescription - - - - oHc-uk-ERk - - - - btnUseAuthorInformation - - - - Pqf-GX-Avo - - - - btnUseDateInformation - - - - s02-Tx-jGJ - - - - tfAuthoInformation - - - - as9-qR-Eq1 - - - - btnUseAuthorInformationPressed: - - - - cAF-1d-3Wh - - - - btnUseDateInformationPressed: - - - - bKa-IH-b3m - - - - tfDateInformaitonFormat - - - - df2-hk-v5B - - - - delegate - - - - 4 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9 - - - - - - - - 10 - - - - - 16 - - - - - - - - 17 - - - - - 22 - - - - - - - - 23 - - - - - 24 - - - - - - - - 25 - - - - - 26 - - - - - - - - 27 - - - - - 28 - - - - - - - - 29 - - - - - 30 - - - - - - - - 31 - - - - - - 54 - - - - - - - - 55 - - - - - ERW-1g-i3X - - - - - - - - eH9-9F-VR9 - - - - - bgb-aQ-BAa - - - - - - - - C3y-LS-75k - - - - - 9MP-VX-rsW - - - - - - - - - - - mxJ-X3-ycD - - - - - vMT-lx-3Ep - - - - - wZv-eZ-WK7 - - - - - IVu-o3-DBW - - - - - Qwl-tK-TKG - - - - - 6ax-Nw-Bq5 - - - - - - - - YoT-Nd-Bhd - - - - - g3M-cK-u5v - - - - - - - - 5tp-ni-55q - - - - - gfy-6Z-t8f - - - - - - - - wKY-lg-WfF - - - - - yp5-mf-NgJ - - - - - - - - 7e3-kk-v20 - - - - - zua-Qs-tG6 - - - - - - - - 3w5-ev-VuS - - - - - Haw-5R-IXR - - - - - - - - s2i-JB-wgP - - - - - b6P-6I-DiH - - - - - - - - y0w-1Y-908 - - - - - L0g-BX-Fh0 - - - - - - - - Krc-dg-Cog - - - - - whT-H5-Xdo - - - - - - - - To6-Zf-QbE - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - {424.5, 462.5} - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - VVDSettingPanelWindowController - NSWindowController - - IBProjectSource - ../VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.h - - - - VVDSettingPanelWindowController - - id - id - id - id - id - id - id - id - id - id - id - - - - alignArgumentComments: - id - - - blankLinesBetweenSections: - id - - - btnAddSinceToCommentsPressed: - id - - - btnBriefDescriptionPressed: - id - - - btnResetPressed: - id - - - btnUseAuthorInformationPressed: - id - - - btnUseDateInformationPressed: - id - - - btnUseSpacesPressed: - id - - - mtxPrefixSettingPressed: - id - - - stepperPressed: - id - - - useHeaderDoc: - id - - - - NSButton - NSButton - NSButton - NSButton - NSButtonCell - NSButtonCell - NSButtonCell - NSButton - NSButton - NSButton - NSButton - NSMatrix - NSStepper - NSTextField - NSTextField - NSTextField - NSTextField - NSTextField - - - - btnAddSinceToComment - NSButton - - - btnAlightArgumentComments - NSButton - - - btnBlankLinesBetweenSections - NSButton - - - btnBriefDescription - NSButton - - - btnPrefixWithSlashes - NSButtonCell - - - btnPrefixWithStar - NSButtonCell - - - btnPrefixWithWhitespace - NSButtonCell - - - btnUseAuthorInformation - NSButton - - - btnUseDateInformation - NSButton - - - btnUseHeaderDoc - NSButton - - - btnUseSpaces - NSButton - - - mtxPrefixOptions - NSMatrix - - - stepperCount - NSStepper - - - tfAuthoInformation - NSTextField - - - tfDateInformaitonFormat - NSTextField - - - tfSpaceCount - NSTextField - - - tfSpaceLabel - NSTextField - - - tfTrigger - NSTextField - - - - IBProjectSource - ../VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m - - - - - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSBox - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSBox.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMatrix - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSMatrix.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSStepper - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSStepper.h - - - - NSStepperCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSStepperCell.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindowController - NSResponder - - showWindow: - id - - - showWindow: - - showWindow: - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSWindowController.h - - - - - 0 - IBCocoaFramework - YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {16, 15} - {15, 15} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VVDocumenter-Xcode/Setting/VVDocumenterSetting.h b/VVDocumenter-Xcode/Setting/VVDocumenterSetting.h index 004136f..77ae120 100644 --- a/VVDocumenter-Xcode/Setting/VVDocumenterSetting.h +++ b/VVDocumenter-Xcode/Setting/VVDocumenterSetting.h @@ -3,11 +3,35 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-8-3. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import +typedef NS_ENUM(NSInteger, VVDSinceOption) { + VVDSinceOptionPlaceholder, + VVDSinceOptionProjectVersion, + VVDSinceOptionSpecificVersion, +}; + extern NSString *const VVDDefaultTriggerString; extern NSString *const VVDDefaultAuthorString; extern NSString *const VVDDefaultDateInfomationFormat; @@ -15,14 +39,15 @@ extern NSString *const VVDDefaultDateInfomationFormat; @interface VVDocumenterSetting : NSObject + (VVDocumenterSetting *)defaultSetting; -@property (readonly) BOOL useDvorakLayout; -@property (readonly) BOOL useWorkmanLayout; +@property (readonly) NSInteger keyVCode; @property BOOL useSpaces; @property NSInteger spaceCount; @property NSString *triggerString; +@property VVDSinceOption sinceOption; @property BOOL prefixWithStar; @property BOOL prefixWithSlashes; @property BOOL addSinceToComments; +@property NSString *sinceVersion; @property BOOL briefDescription; @property BOOL useHeaderDoc; @property BOOL blankLinesBetweenSections; diff --git a/VVDocumenter-Xcode/Setting/VVDocumenterSetting.m b/VVDocumenter-Xcode/Setting/VVDocumenterSetting.m index bcfabef..ce69b91 100644 --- a/VVDocumenter-Xcode/Setting/VVDocumenterSetting.m +++ b/VVDocumenter-Xcode/Setting/VVDocumenterSetting.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-8-3. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVDocumenterSetting.h" #import @@ -20,6 +38,8 @@ NSString *const kVVDPrefixWithStar = @"com.onevcat.VVDocumenter.prefixWithStar"; NSString *const kVVDPrefixWithSlashes = @"com.onevcat.VVDocumenter.prefixWithSlashes"; NSString *const kVVDAddSinceToComments = @"com.onevcat.VVDocumenter.addSinceToComments"; +NSString *const kVVDSinceVersion = @"com.onevcat.VVDocumenter.sinceVersion"; +NSString *const kVVDSinceOption = @"com.onevcat.VVDocumenter.sinceOption"; NSString *const kVVDBriefDescription = @"com.onevcat.VVDocumenter.briefDescription"; NSString *const kVVDUserHeaderDoc = @"com.onevcat.VVDocumenter.useHeaderDoc"; NSString *const kVVDNoBlankLinesBetweenFields = @"com.onevcat.VVDocumenter.noBlankLinesBetweenFields"; @@ -55,30 +75,33 @@ -(void) setUseSpaces:(BOOL)useSpace [[NSUserDefaults standardUserDefaults] synchronize]; } --(BOOL) useDvorakLayout +-(NSInteger) keyVCode { TISInputSourceRef inputSource = TISCopyCurrentKeyboardLayoutInputSource(); NSString *layoutID = (__bridge NSString *)TISGetInputSourceProperty(inputSource, kTISPropertyInputSourceID); CFRelease(inputSource); - - if ([layoutID rangeOfString:@"Dvorak" options:NSCaseInsensitiveSearch].location != NSNotFound && ![layoutID containsString:@"QWERTYCMD"]) { - return YES; - } else { - return NO; - } -} --(BOOL) useWorkmanLayout -{ - TISInputSourceRef inputSource = TISCopyCurrentKeyboardLayoutInputSource(); - NSString *layoutID = (__bridge NSString *)TISGetInputSourceProperty(inputSource, kTISPropertyInputSourceID); - CFRelease(inputSource); + // Possible dvorak layout SourceIDs: + // com.apple.keylayout.Dvorak (System Qwerty) + // But exclude: + // com.apple.keylayout.DVORAK-QWERTYCMD (System Qwerty ⌘) + // org.unknown.keylayout.DvorakImproved-Qwerty⌘ (http://www.macupdate.com/app/mac/24137/dvorak-improved-keyboard-layout) + if ([layoutID localizedCaseInsensitiveContainsString:@"dvorak"] && ![layoutID localizedCaseInsensitiveContainsString: @"qwerty"]) { + return kVK_ANSI_Period; + } - if ([layoutID rangeOfString:@"Workman" options:NSCaseInsensitiveSearch].location != NSNotFound && ![layoutID containsString:@"QWERTYCMD"]) { - return YES; - } else { - return NO; + // Possible workman layout SourceIDs (https://github.com/ojbucao/Workman): + // org.sil.ukelele.keyboardlayout.workman.workman + // org.sil.ukelele.keyboardlayout.workman.workmanextended + // org.sil.ukelele.keyboardlayout.workman.workman-io + // org.sil.ukelele.keyboardlayout.workman.workman-p + // org.sil.ukelele.keyboardlayout.workman.workman-pextended + // org.sil.ukelele.keyboardlayout.workman.workman-dead + if ([layoutID localizedCaseInsensitiveContainsString:@"workman"]) { + return kVK_ANSI_B; } + + return kVK_ANSI_V; } @@ -120,6 +143,17 @@ -(void) setTriggerString:(NSString *)triggerString [[NSUserDefaults standardUserDefaults] synchronize]; } +-(VVDSinceOption) sinceOption +{ + return (VVDSinceOption)[[NSUserDefaults standardUserDefaults] integerForKey:kVVDSinceOption]; +} + +- (void)setSinceOption:(VVDSinceOption)sinceOption +{ + [[NSUserDefaults standardUserDefaults] setInteger:sinceOption forKey:kVVDSinceOption]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + -(BOOL) prefixWithStar { return [[NSUserDefaults standardUserDefaults] boolForKey:kVVDPrefixWithStar]; @@ -153,6 +187,23 @@ -(void) setAddSinceToComments:(BOOL)add [[NSUserDefaults standardUserDefaults] synchronize]; } +- (NSString *)sinceVersion +{ + NSString *sinceVersion = [[NSUserDefaults standardUserDefaults] objectForKey:kVVDSinceVersion]; + + if ( ! sinceVersion ) { + sinceVersion = @""; + } + + return sinceVersion; +} + +- (void)setSinceVersion:(NSString *)sinceVersion +{ + [[NSUserDefaults standardUserDefaults] setObject:sinceVersion forKey:kVVDSinceVersion]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + -(BOOL) briefDescription { return [[NSUserDefaults standardUserDefaults] boolForKey:kVVDBriefDescription]; diff --git a/VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist b/VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist index 424ab2e..17e006d 100644 --- a/VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist +++ b/VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.onevcat.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -24,6 +24,7 @@ 1 DVTPlugInCompatibilityUUIDs + 9AFF134A-08DC-4096-8CEE-62A4BB123046 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 640F884E-CE55-4B40-87C0-8869546CAB7A @@ -39,9 +40,16 @@ E969541F-E6F9-4D25-8158-72DC3545A6C6 AABB7188-E14E-4433-AD3B-5CD791EAD9A3 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 + 0420B86A-AA43-4792-9ED0-6FE0F2B16A13 + CC0D0F4F-05B3-431A-8F33-F84AFCB2C651 + 7265231C-39B4-402C-89E1-16167C4CC990 + F41BD31E-2683-44B8-AE7F-5F09E919790E + E71C2CFE-BFD8-4044-8F06-00AE685A406C + ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C + E0A62D1F-3C18-4D74-BFE5-A4167D643966 NSHumanReadableCopyright - Copyright © 2013年 OneV's Den. All rights reserved. + Copyright © 2013年 OneV's Den. All rights reserved. NSPrincipalClass XC4Compatible diff --git a/VVDocumenter-Xcode/VVDocumenter.h b/VVDocumenter-Xcode/VVDocumenter.h index 8844499..5c498a7 100644 --- a/VVDocumenter-Xcode/VVDocumenter.h +++ b/VVDocumenter-Xcode/VVDocumenter.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/VVDocumenter.m b/VVDocumenter-Xcode/VVDocumenter.m index 7223804..e54c834 100755 --- a/VVDocumenter-Xcode/VVDocumenter.m +++ b/VVDocumenter-Xcode/VVDocumenter.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-17. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVDocumenter.h" #import "NSString+VVSyntax.h" diff --git a/VVDocumenter-Xcode/VVDocumenterManager.h b/VVDocumenter-Xcode/VVDocumenterManager.h index ec44348..ea371f9 100644 --- a/VVDocumenter-Xcode/VVDocumenterManager.h +++ b/VVDocumenter-Xcode/VVDocumenterManager.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-16. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenter-Xcode/VVDocumenterManager.m b/VVDocumenter-Xcode/VVDocumenterManager.m index 30b66ce..d273b47 100644 --- a/VVDocumenter-Xcode/VVDocumenterManager.m +++ b/VVDocumenter-Xcode/VVDocumenterManager.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-16. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVDocumenterManager.h" #import "NSTextView+VVTextGetter.h" @@ -167,12 +185,8 @@ - (void) textStorageDidChange:(NSNotification *)noti { //Cmd+delete Delete current line [kes sendKeyCode:kVK_Delete withModifierCommand:YES alt:NO shift:NO control:NO]; //if (shouldReplace) [textView setSelectedRange:resultToDocument.range]; - //Cmd+V, paste (If it is Dvorak layout, use '.', which is corresponding the key 'V' in a QWERTY layout) - NSInteger kKeyVCode = [[VVDocumenterSetting defaultSetting] useDvorakLayout] ? kVK_ANSI_Period : kVK_ANSI_V; - if ([[VVDocumenterSetting defaultSetting] useWorkmanLayout]) { - kKeyVCode = kVK_ANSI_B; - } - + //Cmd+V, paste (which key to actually use is based on the current keyboard layout) + NSInteger kKeyVCode = [[VVDocumenterSetting defaultSetting] keyVCode]; [kes sendKeyCode:kKeyVCode withModifierCommand:YES alt:NO shift:NO control:NO]; //The key down is just a defined finish signal by me. When we receive this key, we know operation above is finished. diff --git a/VVDocumenterTests/CommenterTests/CommenterTests.m b/VVDocumenterTests/CommenterTests/CommenterTests.m index c3230f6..35f11ab 100644 --- a/VVDocumenterTests/CommenterTests/CommenterTests.m +++ b/VVDocumenterTests/CommenterTests/CommenterTests.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-20. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import #import "VVCommenter.h" diff --git a/VVDocumenterTests/DocumenterTests/VVMethodTestsCode.plist b/VVDocumenterTests/DocumenterTests/VVMethodTestsCode.plist index 77f8ca0..f45dbba 100644 --- a/VVDocumenterTests/DocumenterTests/VVMethodTestsCode.plist +++ b/VVDocumenterTests/DocumenterTests/VVMethodTestsCode.plist @@ -355,7 +355,7 @@ /** * <#Description#> */ -typedef NS_ENUM(NSInteger, SIAlertViewBackgroundStyle){ +typedef NS_ENUM(NSInteger, SIAlertViewBackgroundStyle) { /** * <#Description#> */ @@ -438,10 +438,10 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: a <#a description#> - :param: b <#b description#> - :param: c <#c description#> - :param: d <#d description#> + - parameter a: <#a description#> + - parameter b: <#b description#> + - parameter c: <#c description#> + - parameter d: <#d description#> */ @@ -453,9 +453,9 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: personName <#personName description#> + - parameter personName: <#personName description#> - :returns: <#return value description#> + - returns: <#return value description#> */ @@ -467,9 +467,9 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: para <#para description#> + - parameter para: <#para description#> - :returns: <#return value description#> + - returns: <#return value description#> */ @@ -481,8 +481,8 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: miao <#miao description#> - :param: wu <#wu description#> + - parameter miao: <#miao description#> + - parameter wu: <#wu description#> */ @@ -494,12 +494,12 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: style <#style description#> - :param: gearing <#gearing description#> - :param: handlebar <#handlebar description#> - :param: centimeters <#centimeters description#> + - parameter style: <#style description#> + - parameter gearing: <#gearing description#> + - parameter handlebar: <#handlebar description#> + - parameter centimeters: <#centimeters description#> - :returns: <#return value description#> + - returns: <#return value description#> */ @@ -511,10 +511,10 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: input <#input description#> - :param: condition <#condition description#> + - parameter input: <#input description#> + - parameter condition: <#condition description#> - :returns: <#return value description#> + - returns: <#return value description#> */ @@ -526,10 +526,10 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: session <#session description#> - :param: task <#task description#> - :param: challenge <#challenge description#> - :param: completionHandler <#completionHandler description#> + - parameter session: <#session description#> + - parameter task: <#task description#> + - parameter challenge: <#challenge description#> + - parameter completionHandler: <#completionHandler description#> */ @@ -541,11 +541,11 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: a <#a description#> - :param: b <#b description#> - :param: c <#c description#> + - parameter a: <#a description#> + - parameter b: <#b description#> + - parameter c: <#c description#> - :returns: <#return value description#> + - returns: <#return value description#> */ @@ -557,9 +557,9 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: key <#key description#> + - parameter key: <#key description#> - :returns: <#return value description#> + - returns: <#return value description#> */ @@ -571,9 +571,83 @@ SIAlertViewBackgroundStyleSolid, /** <#Description#> - :param: input <#input description#> - :param: success <#success description#> - :param: failure <#failure description#> + - parameter input: <#input description#> + - parameter success: <#success description#> + - parameter failure: <#failure description#> + */ + + + source + func methodCouldThrows(count: Int) throws -> Int { + uniform + func methodCouldThrows(count: Int)throws -> Int { + result + /** + <#Description#> + + - parameter count: <#count description#> + + - throws: <#throws value description#> + + - returns: <#return value description#> + */ + + + source + func methodCouldThrows() throws { + uniform + func methodCouldThrows()throws { + result + /** + <#Description#> + + - throws: <#throws value description#> + */ + + + source + func methodCouldThrows(count: Int, name: String, f: (Int, String) throws -> Void) rethrows -> Int { + uniform + func methodCouldThrows(count: Int, name: String, f:(Int, String)throws -> Void)rethrows -> Int { + result + /** + <#Description#> + + - parameter count: <#count description#> + - parameter name: <#name description#> + - parameter f: <#f description#> + + - throws: <#throws value description#> + + - returns: <#return value description#> + */ + + + source + public class func amethod(count: Int) -> Int? { + uniform + public class func amethod(count: Int)-> Int? { + result + /** + <#Description#> + + - parameter count: <#count description#> + + - returns: <#return value description#> + */ + + + source + func testTuple(aTuple: (first: String, second: String, third: String)) -> (first: String, second: String, third: String)? { + uniform + func testTuple(aTuple:(first: String, second: String, third: String))->(first: String, second: String, third: String)? { + result + /** + <#Description#> + + - parameter aTuple: <#aTuple description#> + + - returns: <#return value description#> */ @@ -687,7 +761,7 @@ SIAlertViewBackgroundStyleSolid, uniform extension MyClass: SomeDelegate { result - // MARK: - <#Description#> + // MARK: - <#SomeDelegate#> source diff --git a/VVDocumenterTests/SyntaxTests/SyntaxTests.m b/VVDocumenterTests/SyntaxTests/SyntaxTests.m index 930c3b2..7b1ff4c 100755 --- a/VVDocumenterTests/SyntaxTests/SyntaxTests.m +++ b/VVDocumenterTests/SyntaxTests/SyntaxTests.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-19. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import #import "VVTestHelper.h" diff --git a/VVDocumenterTests/VVDocumenterTests-Info.plist b/VVDocumenterTests/VVDocumenterTests-Info.plist index 7d55e65..169b6f7 100644 --- a/VVDocumenterTests/VVDocumenterTests-Info.plist +++ b/VVDocumenterTests/VVDocumenterTests-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.onevcat.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/VVDocumenterTests/VVDocumenterTests.m b/VVDocumenterTests/VVDocumenterTests.m index ba7c296..5019b0c 100755 --- a/VVDocumenterTests/VVDocumenterTests.m +++ b/VVDocumenterTests/VVDocumenterTests.m @@ -1,10 +1,28 @@ // // VVDocumenterTests.m -// VVDocumenterTests +// VVDocumenter-Xcode // // Created by 王 巍 on 13-7-19. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import #import "VVDocumenter.h" diff --git a/VVDocumenterTests/VVTestHelper.h b/VVDocumenterTests/VVTestHelper.h index b11b4ed..c5a4bf5 100755 --- a/VVDocumenterTests/VVTestHelper.h +++ b/VVDocumenterTests/VVTestHelper.h @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-19. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import diff --git a/VVDocumenterTests/VVTestHelper.m b/VVDocumenterTests/VVTestHelper.m index 2162969..5212ee6 100755 --- a/VVDocumenterTests/VVTestHelper.m +++ b/VVDocumenterTests/VVTestHelper.m @@ -3,8 +3,26 @@ // VVDocumenter-Xcode // // Created by 王 巍 on 13-7-19. -// Copyright (c) 2013年 OneV's Den. All rights reserved. // +// Copyright (c) 2015 Wei Wang +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. #import "VVTestHelper.h" @@ -72,7 +90,10 @@ +(NSArray *) testCodes @"func sayHelloWorld() ->String", @"func testParamsType(var a: Int) {", @"init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int) {", - @"public subscript(key: KeyType)-> ValueType? {"]; + @"public subscript(key: KeyType)-> ValueType? {", + @"func methodCouldThrows(count: Int) throws -> Int {", + @"func methodCouldThrows() throws {", + @"func methodCouldThrows(count: Int, name: String, f: (Int, String) throws -> Void) rethrows -> Int {"]; /* //Now there is no difference between Objective-C (C) struct and Swift struct. Ignore this. @@ -143,7 +164,10 @@ +(NSArray *) uniformCodes @"func sayHelloWorld()->String", @"func testParamsType(var a: Int){", @"init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int){", - @"public subscript(key: KeyType)-> ValueType? {"]; + @"public subscript(key: KeyType)-> ValueType? {", + @"func methodCouldThrows(count: Int)throws -> Int {", + @"func methodCouldThrows()throws {", + @"func methodCouldThrows(count: Int, name: String, f:(Int, String)throws -> Void)rethrows -> Int {"]; /* //Now there is no difference between Objective-C (C) struct and Swift struct. Ignore this. diff --git a/vvdocumenter-swift.gif b/vvdocumenter-swift.gif index f4e4519..9522c90 100644 Binary files a/vvdocumenter-swift.gif and b/vvdocumenter-swift.gif differ