diff --git a/.gitmodules b/.gitmodules index 8e303d188..718ac5480 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "Carthage/Checkouts/LlamaKit"] - path = Carthage/Checkouts/LlamaKit - url = https://github.com/LlamaKit/LlamaKit.git [submodule "Carthage/Checkouts/SwiftXPC"] path = Carthage/Checkouts/SwiftXPC url = https://github.com/jpsim/SwiftXPC.git @@ -13,3 +10,6 @@ [submodule "Carthage/Checkouts/SWXMLHash"] path = Carthage/Checkouts/SWXMLHash url = https://github.com/drmohundro/SWXMLHash.git +[submodule "Carthage/Checkouts/Result"] + path = Carthage/Checkouts/Result + url = https://github.com/antitypical/Result.git diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..4be693b54 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: objective-c +osx_image: xcode7 +git: + submodules: false +branches: + only: + - master +script: script/cibuild +notifications: + email: false + slack: realmio:vPdpsG9NLDo2DNlbqtcMAQuE diff --git a/CHANGELOG.md b/CHANGELOG.md index edb5f28d1..93f12ef87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,54 @@ +## 0.4.4 + +##### Breaking + +* Simplified rpath's. + [JP Simard](https://github.com/jpsim) + +##### Enhancements + +None. + +##### Bug Fixes + +* Fixed a crash when parsing an empty documentation comment. + [JP Simard](https://github.com/jpsim) + [#236](https://github.com/realm/jazzy/issues/236) + + +## 0.4.3 + +##### Breaking + +None. + +##### Enhancements + +None. + +##### Bug Fixes + +* Fixed issue when installing 0.4.2 via Homebrew. + [JP Simard](https://github.com/jpsim) + + +## 0.4.2 + +##### Breaking + +None. + +##### Enhancements + +None. + +##### Bug Fixes + +* SourceKitten can now be installed alongside Carthage because + SourceKittenFramework now nests its Commandant and LlamaKit frameworks. + [JP Simard](https://github.com/jpsim) + + ## 0.4.1 ##### Breaking diff --git a/Cartfile b/Cartfile index 481aa95a8..7704df1d6 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "jpsim/SwiftXPC" ~> 1.0 -github "drmohundro/SWXMLHash" ~> 1.0 +github "jpsim/SwiftXPC" "swift-2.0" +github "drmohundro/SWXMLHash" "xcode-7.0" diff --git a/Cartfile.private b/Cartfile.private index a99553424..92345d88d 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,2 +1,2 @@ -github "Carthage/Commandant" ~> 0.5 +github "Carthage/Commandant" "swift-2.0" github "jspahrsummers/xcconfigs" >= 0.8 diff --git a/Cartfile.resolved b/Cartfile.resolved index c89017de9..4ce10ba52 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,5 +1,5 @@ -github "LlamaKit/LlamaKit" "v0.6.0" -github "drmohundro/SWXMLHash" "1.0.0" -github "jpsim/SwiftXPC" "1.0.0" -github "jspahrsummers/xcconfigs" "0.8" -github "Carthage/Commandant" "0.5" +github "antitypical/Result" "0.6-beta.1" +github "drmohundro/SWXMLHash" "2203b05b1e093b1dc3e32114953f937a6e7aa5f5" +github "jpsim/SwiftXPC" "d32e70f1b35cfa833be85fd40e70401f4190f5b0" +github "jspahrsummers/xcconfigs" "0.8.1" +github "Carthage/Commandant" "cc47af4a9e7a7d56bd1202d52762c1c66184c936" diff --git a/Carthage/Checkouts/Commandant b/Carthage/Checkouts/Commandant index 3866cadd4..cc47af4a9 160000 --- a/Carthage/Checkouts/Commandant +++ b/Carthage/Checkouts/Commandant @@ -1 +1 @@ -Subproject commit 3866cadd431b1c3ba8091383b80ec023beb1897f +Subproject commit cc47af4a9e7a7d56bd1202d52762c1c66184c936 diff --git a/Carthage/Checkouts/LlamaKit b/Carthage/Checkouts/LlamaKit deleted file mode 160000 index e28d7f6e8..000000000 --- a/Carthage/Checkouts/LlamaKit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e28d7f6e82fbd5dcd5388b36e2acf4eedb44b4e8 diff --git a/Carthage/Checkouts/Result b/Carthage/Checkouts/Result new file mode 160000 index 000000000..18a10d680 --- /dev/null +++ b/Carthage/Checkouts/Result @@ -0,0 +1 @@ +Subproject commit 18a10d680af395d93b47ff4a3d8b0af3b8cad094 diff --git a/Carthage/Checkouts/SWXMLHash b/Carthage/Checkouts/SWXMLHash index 3f64d009c..2203b05b1 160000 --- a/Carthage/Checkouts/SWXMLHash +++ b/Carthage/Checkouts/SWXMLHash @@ -1 +1 @@ -Subproject commit 3f64d009ca1e2b737bf93d22bcaa837d3be1d90c +Subproject commit 2203b05b1e093b1dc3e32114953f937a6e7aa5f5 diff --git a/Carthage/Checkouts/SwiftXPC b/Carthage/Checkouts/SwiftXPC index bfc256492..d32e70f1b 160000 --- a/Carthage/Checkouts/SwiftXPC +++ b/Carthage/Checkouts/SwiftXPC @@ -1 +1 @@ -Subproject commit bfc256492840ff6e8d05b851cb57af38d83469bf +Subproject commit d32e70f1b35cfa833be85fd40e70401f4190f5b0 diff --git a/Carthage/Checkouts/xcconfigs b/Carthage/Checkouts/xcconfigs index 813127f87..99624a6af 160000 --- a/Carthage/Checkouts/xcconfigs +++ b/Carthage/Checkouts/xcconfigs @@ -1 +1 @@ -Subproject commit 813127f87f66fa14a7da03d3fa8410c02d2075d6 +Subproject commit 99624a6af366c015b678a1135e4c558776a59be6 diff --git a/Makefile b/Makefile index 95d5e211d..30aa7003c 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,10 @@ XCODEFLAGS=-workspace 'SourceKitten.xcworkspace' -scheme 'sourcekitten' DSTROOT= BUILT_BUNDLE=$(TEMPORARY_FOLDER)/Applications/sourcekitten.app SOURCEKITTEN_FRAMEWORK_BUNDLE=$(BUILT_BUNDLE)/Contents/Frameworks/SourceKittenFramework.framework -COMMANDANT_FRAMEWORK_BUNDLE=$(BUILT_BUNDLE)/Contents/Frameworks/Commandant.framework -LLAMAKIT_FRAMEWORK_BUNDLE=$(BUILT_BUNDLE)/Contents/Frameworks/LlamaKit.framework SOURCEKITTEN_EXECUTABLE=$(BUILT_BUNDLE)/Contents/MacOS/sourcekitten -FRAMEWORKS_FOLDER=/Library/Frameworks -BINARIES_FOLDER=/usr/local/bin +FRAMEWORKS_FOLDER=$(PREFIX)/Frameworks +BINARIES_FOLDER=$(PREFIX)/bin OUTPUT_PACKAGE=SourceKitten.pkg @@ -39,8 +37,6 @@ install: package uninstall: rm -rf "$(FRAMEWORKS_FOLDER)/SourceKittenFramework.framework" - rm -rf "$(FRAMEWORKS_FOLDER)/Commandant.framework" - rm -rf "$(FRAMEWORKS_FOLDER)/LlamaKit.framework" rm -f "$(BINARIES_FOLDER)/sourcekitten" installables: clean bootstrap @@ -48,18 +44,13 @@ installables: clean bootstrap mkdir -p "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)" mv -f "$(SOURCEKITTEN_FRAMEWORK_BUNDLE)" "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/SourceKittenFramework.framework" - mv -f "$(COMMANDANT_FRAMEWORK_BUNDLE)" "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/Commandant.framework" - mv -f "$(LLAMAKIT_FRAMEWORK_BUNDLE)" "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/LlamaKit.framework" mv -f "$(SOURCEKITTEN_EXECUTABLE)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)/sourcekitten" rm -rf "$(BUILT_BUNDLE)" prefix_install: installables - mkdir -p "$(PREFIX)/Frameworks" "$(PREFIX)/bin" - cp -rf "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/SourceKittenFramework.framework" "$(PREFIX)/Frameworks/" - cp -rf "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/Commandant.framework" "$(PREFIX)/Frameworks/" - cp -rf "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/LlamaKit.framework" "$(PREFIX)/Frameworks/" - cp -f "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)/sourcekitten" "$(PREFIX)/bin/" - install_name_tool -add_rpath "@executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks/" "$(PREFIX)/bin/sourcekitten" + mkdir -p "$(FRAMEWORKS_FOLDER)" "$(BINARIES_FOLDER)" + cp -rf "$(TEMPORARY_FOLDER)$(FRAMEWORKS_FOLDER)/SourceKittenFramework.framework" "$(FRAMEWORKS_FOLDER)/" + cp -f "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)/sourcekitten" "$(BINARIES_FOLDER)/" package: installables pkgbuild \ diff --git a/README.md b/README.md index 5706d35ee..312fe1057 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ An adorable little framework and command line tool for interacting with [SourceK SourceKitten links and communicates with `sourcekitd.framework` to parse the Swift AST, extract comment docs for Swift or Objective-C projects, get syntax data for a Swift file and lots more! +![Test Status](https://travis-ci.org/jpsim/SourceKitten.svg?branch=master) + ## Installation Install the `sourcekitten` command line tool by running `git clone` for this repo followed by `make install` in the root directory. Make sure that Xcode 6.3 is set in `xcode-select` before running `make`. diff --git a/Source/SourceKittenFramework/Array+SourceKitten.swift b/Source/SourceKittenFramework/Array+SourceKitten.swift index ee5bb024a..62704e182 100644 --- a/Source/SourceKittenFramework/Array+SourceKitten.swift +++ b/Source/SourceKittenFramework/Array+SourceKitten.swift @@ -9,8 +9,8 @@ /** Returns an array containing the last contiguous group of elements matching the filter. -:param: array Array to filter. -:param: filter Closure to filter elements. +- parameter array: Array to filter. +- parameter filter: Closure to filter elements. */ public func filterLastContiguous(array: [T], filter: T -> Bool) -> [T] { // remove trailing elements until the last one matches the filter diff --git a/Source/SourceKittenFramework/ClangTranslationUnit.swift b/Source/SourceKittenFramework/ClangTranslationUnit.swift index 3f87eed74..004058736 100644 --- a/Source/SourceKittenFramework/ClangTranslationUnit.swift +++ b/Source/SourceKittenFramework/ClangTranslationUnit.swift @@ -14,8 +14,8 @@ public struct ClangTranslationUnit { /** Create a ClangTranslationUnit by passing Objective-C header files and clang compiler arguments. - :param: headerFiles Objective-C header files to document. - :param: compilerArguments Clang compiler arguments. + - parameter headerFiles: Objective-C header files to document. + - parameter compilerArguments: Clang compiler arguments. */ public init(headerFiles: [String], compilerArguments: [String]) { let cStringCompilerArguments = compilerArguments.map { ($0 as NSString).UTF8String } @@ -30,44 +30,31 @@ public struct ClangTranslationUnit { } } - /** - Failable initializer to create a ClangTranslationUnit by passing an array of Objective-C header - files followed by `xcodebuild` arguments. Optionally pass in a `path`. - - :param: headerFilesAndXcodeBuildArguments Array of Objective-C header files followed by `xcodebuild` arguments. - :param: path Path to run `xcodebuild` from. Uses current path by default. - */ - public init?(headerFilesAndXcodeBuildArguments: [String], inPath path: String = NSFileManager.defaultManager().currentDirectoryPath) { - let (headerFiles, xcodebuildArguments) = parseHeaderFilesAndXcodebuildArguments(headerFilesAndXcodeBuildArguments) - self.init(headerFiles: headerFiles, xcodeBuildArguments: xcodebuildArguments, inPath: path) - } - /** Failable initializer to create a ClangTranslationUnit by passing Objective-C header files and `xcodebuild` arguments. Optionally pass in a `path`. - :param: headerFiles Objective-C header files to document. - :param: xcodeBuildArguments The arguments necessary pass in to `xcodebuild` to link these header files. - :param: path Path to run `xcodebuild` from. Uses current path by default. + - parameter headerFiles: Objective-C header files to document. + - parameter xcodeBuildArguments: The arguments necessary pass in to `xcodebuild` to link these header files. + - parameter path: Path to run `xcodebuild` from. Uses current path by default. */ public init?(headerFiles: [String], xcodeBuildArguments: [String], inPath path: String = NSFileManager.defaultManager().currentDirectoryPath) { let xcodeBuildOutput = runXcodeBuild(xcodeBuildArguments + ["-dry-run"], inPath: path) ?? "" - if let clangArguments = parseCompilerArguments(xcodeBuildOutput, language: .ObjC, moduleName: nil) { - self.init(headerFiles: headerFiles, compilerArguments: clangArguments) - return + guard let clangArguments = parseCompilerArguments(xcodeBuildOutput, language: .ObjC, moduleName: nil) else { + fputs("could not parse compiler arguments\n", stderr) + fputs("\(xcodeBuildOutput)\n", stderr) + return nil } - fputs("could not parse compiler arguments\n", stderr) - fputs("\(xcodeBuildOutput)\n", stderr) - return nil + self.init(headerFiles: headerFiles, compilerArguments: clangArguments) } } -// MARK: Printable +// MARK: CustomStringConvertible -extension ClangTranslationUnit: Printable { +extension ClangTranslationUnit: CustomStringConvertible { /// A textual XML representation of `ClangTranslationUnit`. public var description: String { - let commentXMLs = join("\n", clangTranslationUnits.map({commentXML($0)}).reduce([], combine: +)) + let commentXMLs = "\n".join(clangTranslationUnits.map({commentXML($0)}).reduce([], combine: +)) return "\n\n" + commentXMLs + "\n" } } @@ -77,13 +64,13 @@ extension ClangTranslationUnit: Printable { /** Returns an array of XML comments by iterating over a Clang translation unit. -:param: translationUnit Clang translation unit created from Clang index, file path and compiler arguments. +- parameter translationUnit: Clang translation unit created from Clang index, file path and compiler arguments. -:returns: An array of XML comments by iterating over a Clang translation unit. +- returns: An array of XML comments by iterating over a Clang translation unit. */ public func commentXML(translationUnit: CXTranslationUnit) -> [String] { var commentXMLs = [String]() - clang_visitChildrenWithBlock(clang_getTranslationUnitCursor(translationUnit)) { cursor, parent in + clang_visitChildrenWithBlock(clang_getTranslationUnitCursor(translationUnit)) { cursor, _ in if let commentXML = String.fromCString(clang_getCString(clang_FullComment_getAsXML(clang_Cursor_getParsedComment(cursor)))) { commentXMLs.append(commentXML) } @@ -91,20 +78,3 @@ public func commentXML(translationUnit: CXTranslationUnit) -> [String] { } return commentXMLs } - -/** -Extracts Objective-C header files and `xcodebuild` arguments from an array of header files followed by `xcodebuild` arguments. - -:param: sourcekittenArguments Array of Objective-C header files followed by `xcodebuild` arguments. - -:returns: Tuple of header files and xcodebuild arguments. -*/ -public func parseHeaderFilesAndXcodebuildArguments(sourcekittenArguments: [String]) -> (headerFiles: [String], xcodebuildArguments: [String]) { - var xcodebuildArguments = sourcekittenArguments - var headerFiles = [String]() - while let headerFile = xcodebuildArguments.first where headerFile.isObjectiveCHeaderFile() { - headerFiles.append(headerFile.absolutePathRepresentation()) - xcodebuildArguments.removeAtIndex(0) - } - return (headerFiles, xcodebuildArguments) -} diff --git a/Source/SourceKittenFramework/Dictionary+Merge.swift b/Source/SourceKittenFramework/Dictionary+Merge.swift index ef10f9bb6..e0b909222 100644 --- a/Source/SourceKittenFramework/Dictionary+Merge.swift +++ b/Source/SourceKittenFramework/Dictionary+Merge.swift @@ -9,12 +9,12 @@ /** Returns a new dictionary by adding the entries of dict2 into dict1, overriding if the key exists. -:param: dict1 Dictionary to merge into. -:param: dict2 Dictionary to merge from (optional). +- parameter dict1: Dictionary to merge into. +- parameter dict2: Dictionary to merge from (optional). -:returns: A new dictionary by adding the entries of dict2 into dict1, overriding if the key exists. +- returns: A new dictionary by adding the entries of dict2 into dict1, overriding if the key exists. */ -internal func merge(var dict1: [K: V], dict2: [K: V]?) -> [K: V] { +internal func merge(var dict1: [K: V], _ dict2: [K: V]?) -> [K: V] { if let dict2 = dict2 { for (key, value) in dict2 { dict1[key] = value diff --git a/Source/SourceKittenFramework/File.swift b/Source/SourceKittenFramework/File.swift index 73b9dfaf3..d5856a9b2 100644 --- a/Source/SourceKittenFramework/File.swift +++ b/Source/SourceKittenFramework/File.swift @@ -8,7 +8,6 @@ import Foundation import SwiftXPC -import SWXMLHash /// Represents a source file. public struct File { @@ -20,13 +19,13 @@ public struct File { /** Failable initializer by path. Fails if file contents could not be read as a UTF8 string. - :param: path File path. + - parameter path: File path. */ public init?(path: String) { self.path = path - if let contents = NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding, error: nil) as? String { - self.contents = contents - } else { + do { + self.contents = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String + } catch { fputs("Could not read contents of `\(path)`\n", stderr) return nil } @@ -35,7 +34,7 @@ public struct File { /** Initializer by file contents. File path is nil. - :param: contents File contents. + - parameter contents: File contents. */ public init(contents: String) { path = nil @@ -45,16 +44,16 @@ public struct File { /** Parse source declaration string from XPC dictionary. - :param: dictionary XPC dictionary to extract declaration from. + - parameter dictionary: XPC dictionary to extract declaration from. - :returns: Source declaration if successfully parsed. + - returns: Source declaration if successfully parsed. */ public func parseDeclaration(dictionary: XPCDictionary) -> String? { if !shouldParseDeclaration(dictionary) { return nil } - return flatMap(SwiftDocKey.getOffset(dictionary)) { start in - let end = map(SwiftDocKey.getBodyOffset(dictionary)) { Int($0) } + return SwiftDocKey.getOffset(dictionary).flatMap { start in + let end = SwiftDocKey.getBodyOffset(dictionary).map { Int($0) } let start = Int(start) let length = (end ?? start) - start return contents.substringLinesWithByteRange(start: start, length: length)? @@ -65,18 +64,18 @@ public struct File { /** Parse line numbers containing the declaration's implementation from XPC dictionary. - :param: dictionary XPC dictionary to extract declaration from. + - parameter dictionary: XPC dictionary to extract declaration from. - :returns: Line numbers containing the declaration's implementation. + - returns: Line numbers containing the declaration's implementation. */ public func parseScopeRange(dictionary: XPCDictionary) -> (start: Int, end: Int)? { if !shouldParseDeclaration(dictionary) { return nil } - return flatMap(SwiftDocKey.getOffset(dictionary)) { start in + return SwiftDocKey.getOffset(dictionary).flatMap { start in let start = Int(start) - let end = flatMap(SwiftDocKey.getBodyOffset(dictionary)) { bodyOffset in - return map(SwiftDocKey.getBodyLength(dictionary)) { bodyLength in + let end = SwiftDocKey.getBodyOffset(dictionary).flatMap { bodyOffset in + return SwiftDocKey.getBodyLength(dictionary).map { bodyLength in return Int(bodyOffset + bodyLength) } } ?? start @@ -88,9 +87,9 @@ public struct File { /** Extract mark-style comment string from doc dictionary. e.g. '// MARK: - The Name' - :param: dictionary Doc dictionary to parse. + - parameter dictionary: Doc dictionary to parse. - :returns: Mark name if successfully parsed. + - returns: Mark name if successfully parsed. */ private func markNameFromDictionary(dictionary: XPCDictionary) -> String? { precondition(SwiftDocKey.getKind(dictionary)! == SyntaxKind.CommentMark.rawValue) @@ -108,8 +107,8 @@ public struct File { Returns a copy of the input dictionary with comment mark names, cursor.info information and parsed declarations for the top-level of the input dictionary and its substructures. - :param: dictionary Dictionary to process. - :param: cursorInfoRequest Cursor.Info request to get declaration information. + - parameter dictionary: Dictionary to process. + - parameter cursorInfoRequest: Cursor.Info request to get declaration information. */ public func processDictionary(var dictionary: XPCDictionary, cursorInfoRequest: xpc_object_t? = nil, syntaxMap: SyntaxMap? = nil) -> XPCDictionary { if let cursorInfoRequest = cursorInfoRequest { @@ -131,11 +130,11 @@ public struct File { } // Parse `key.doc.full_as_xml` and add to dictionary - if let parsedXMLDocs = flatMap(SwiftDocKey.getFullXMLDocs(dictionary), { parseFullXMLDocs($0) }) { + if let parsedXMLDocs = (SwiftDocKey.getFullXMLDocs(dictionary).flatMap(parseFullXMLDocs)) { dictionary = merge(dictionary, parsedXMLDocs) // Parse documentation comment and add to dictionary - if let commentBody = flatMap(syntaxMap, { getDocumentationCommentBody(dictionary, syntaxMap: $0) }) { + if let commentBody = (syntaxMap.flatMap { getDocumentationCommentBody(dictionary, syntaxMap: $0) }) { dictionary[SwiftDocKey.DocumentationComment.rawValue] = commentBody } } @@ -151,9 +150,9 @@ public struct File { Returns a copy of the input dictionary with additional cursorinfo information at the given `documentationTokenOffsets` that haven't yet been documented. - :param: dictionary Dictionary to insert new docs into. - :param: documentedTokenOffsets Offsets that are likely documented. - :param: cursorInfoRequest Cursor.Info request to get declaration information. + - parameter dictionary: Dictionary to insert new docs into. + - parameter documentedTokenOffsets: Offsets that are likely documented. + - parameter cursorInfoRequest: Cursor.Info request to get declaration information. */ internal func furtherProcessDictionary(var dictionary: XPCDictionary, documentedTokenOffsets: [Int], cursorInfoRequest: xpc_object_t, syntaxMap: SyntaxMap) -> XPCDictionary { let offsetMap = generateOffsetMap(documentedTokenOffsets, dictionary: dictionary) @@ -161,7 +160,8 @@ public struct File { let response = processDictionary(Request.sendCursorInfoRequest(cursorInfoRequest, atOffset: Int64(offset))!, cursorInfoRequest: nil, syntaxMap: syntaxMap) if let kind = SwiftDocKey.getKind(response), _ = SwiftDeclarationKind(rawValue: kind), - inserted = insertDoc(response, parent: dictionary, offset: Int64(offsetMap[offset]!)) { // Safe to force unwrap + parentOffset = offsetMap[offset].flatMap({ Int64($0) }), + inserted = insertDoc(response, parent: dictionary, offset: parentOffset) { dictionary = inserted } } @@ -172,27 +172,27 @@ public struct File { Update input dictionary's substructure by running `processDictionary(_:cursorInfoRequest:syntaxMap:)` on its elements, only keeping comment marks and declarations. - :param: dictionary Input dictionary to process its substructure. - :param: cursorInfoRequest Cursor.Info request to get declaration information. + - parameter dictionary: Input dictionary to process its substructure. + - parameter cursorInfoRequest: Cursor.Info request to get declaration information. - :returns: A copy of the input dictionary's substructure processed by running - `processDictionary(_:cursorInfoRequest:syntaxMap:)` on its elements, only keeping comment marks - and declarations. + - returns: A copy of the input dictionary's substructure processed by running + `processDictionary(_:cursorInfoRequest:syntaxMap:)` on its elements, only keeping comment marks + and declarations. */ private func newSubstructure(dictionary: XPCDictionary, cursorInfoRequest: xpc_object_t?, syntaxMap: SyntaxMap?) -> XPCArray? { return SwiftDocKey.getSubstructure(dictionary)? - .filter({ - return isDeclarationOrCommentMark($0 as! XPCDictionary) - }).map { - return self.processDictionary($0 as! XPCDictionary, cursorInfoRequest: cursorInfoRequest, syntaxMap: syntaxMap) + .map({ $0 as! XPCDictionary }) + .filter(isDeclarationOrCommentMark) + .map { + processDictionary($0, cursorInfoRequest: cursorInfoRequest, syntaxMap: syntaxMap) } } /** Returns an updated copy of the input dictionary with comment mark names and cursor.info information. - :param: dictionary Dictionary to update. - :param: cursorInfoRequest Cursor.Info request to get declaration information. + - parameter dictionary: Dictionary to update. + - parameter cursorInfoRequest: Cursor.Info request to get declaration information. */ private func dictWithCommentMarkNamesCursorInfo(dictionary: XPCDictionary, cursorInfoRequest: xpc_object_t) -> XPCDictionary? { if let kind = SwiftDocKey.getKind(dictionary) { @@ -218,10 +218,10 @@ public struct File { /** Returns whether or not a doc should be inserted into a parent at the provided offset. - :param: parent Parent dictionary to evaluate. - :param: offset Offset to search for in parent dictionary. + - parameter parent: Parent dictionary to evaluate. + - parameter offset: Offset to search for in parent dictionary. - :returns: True if a doc should be inserted in the parent at the provided offset. + - returns: True if a doc should be inserted in the parent at the provided offset. */ private func shouldInsert(parent: XPCDictionary, offset: Int64) -> Bool { return (offset == 0) || @@ -233,17 +233,17 @@ public struct File { Parent will be traversed until the offset is found. Returns nil if offset could not be found. - :param: doc Document dictionary to insert. - :param: parent Parent to traverse to find insertion point. - :param: offset Offset to insert document dictionary. + - parameter doc: Document dictionary to insert. + - parameter parent: Parent to traverse to find insertion point. + - parameter offset: Offset to insert document dictionary. - :returns: Parent with doc inserted if successful. + - returns: Parent with doc inserted if successful. */ private func insertDoc(doc: XPCDictionary, var parent: XPCDictionary, offset: Int64) -> XPCDictionary? { if shouldInsert(parent, offset: offset) { var substructure = SwiftDocKey.getSubstructure(parent)! var insertIndex = substructure.count - for (index, structure) in enumerate(substructure.reverse()) { + for (index, structure) in substructure.reverse().enumerate() { if SwiftDocKey.getOffset(structure as! XPCDictionary)! < offset { break } @@ -268,9 +268,10 @@ public struct File { } /** - Returns true if path is nil or if path is equal to `key.filepath` in the input dictionary. + Returns true if path is nil or if path has the same last path component as `key.filepath` in the + input dictionary. - :param: dictionary Dictionary to parse. + - parameter dictionary: Dictionary to parse. */ internal func shouldTreatAsSameFile(dictionary: XPCDictionary) -> Bool { return path == SwiftDocKey.getFilePath(dictionary) @@ -279,7 +280,7 @@ public struct File { /** Returns true if the input dictionary contains a parseable declaration. - :param: dictionary Dictionary to parse. + - parameter dictionary: Dictionary to parse. */ private func shouldParseDeclaration(dictionary: XPCDictionary) -> Bool { let sameFile = shouldTreatAsSameFile(dictionary) @@ -293,17 +294,17 @@ public struct File { /** Parses `dictionary`'s documentation comment body. - :param: dictionary Dictionary to parse. - :param: syntaxMap SyntaxMap for current file. + - parameter dictionary: Dictionary to parse. + - parameter syntaxMap: SyntaxMap for current file. - :returns: `dictionary`'s documentation comment body as a string, without any documentation - syntax (`/** ... */` or `/// ...`). + - returns: `dictionary`'s documentation comment body as a string, without any documentation + syntax (`/** ... */` or `/// ...`). */ public func getDocumentationCommentBody(dictionary: XPCDictionary, syntaxMap: SyntaxMap) -> String? { - return flatMap(SwiftDocKey.getOffset(dictionary)) { offset in - return flatMap(syntaxMap.commentRangeBeforeOffset(Int(offset))) { commentByteRange in - return flatMap(contents.byteRangeToNSRange(start: commentByteRange.start, length: commentByteRange.length)) { nsRange in - return contents.commentBody(range: nsRange) + return SwiftDocKey.getOffset(dictionary).flatMap { offset in + return syntaxMap.commentRangeBeforeOffset(Int(offset)).flatMap { commentByteRange in + return contents.byteRangeToNSRange(start: commentByteRange.start, length: commentByteRange.length).flatMap { nsRange in + return contents.commentBody(nsRange) } } } @@ -313,19 +314,16 @@ public struct File { /** Traverse the dictionary replacing SourceKit UIDs with their string value. -:param: dictionary Dictionary to replace UIDs. +- parameter dictionary: Dictionary to replace UIDs. -:returns: Dictionary with UIDs replaced by strings. +- returns: Dictionary with UIDs replaced by strings. */ internal func replaceUIDsWithSourceKitStrings(var dictionary: XPCDictionary) -> XPCDictionary { for key in dictionary.keys { if let uid = dictionary[key] as? UInt64, uidString = stringForSourceKitUID(uid) { dictionary[key] = uidString - } else if var array = dictionary[key] as? XPCArray { - for (index, dict) in enumerate(array) { - array[index] = replaceUIDsWithSourceKitStrings(dict as! XPCDictionary) - } - dictionary[key] = array + } else if let array = dictionary[key] as? XPCArray { + dictionary[key] = array.map { replaceUIDsWithSourceKitStrings($0 as! XPCDictionary) } as XPCArray } else if let dict = dictionary[key] as? XPCDictionary { dictionary[key] = replaceUIDsWithSourceKitStrings(dict) } @@ -336,7 +334,7 @@ internal func replaceUIDsWithSourceKitStrings(var dictionary: XPCDictionary) -> /** Returns true if the dictionary represents a source declaration or a mark-style comment. -:param: dictionary Dictionary to parse. +- parameter dictionary: Dictionary to parse. */ private func isDeclarationOrCommentMark(dictionary: XPCDictionary) -> Bool { if let kind = SwiftDocKey.getKind(dictionary) { @@ -345,56 +343,3 @@ private func isDeclarationOrCommentMark(dictionary: XPCDictionary) -> Bool { } return false } - -/** -Parse XML from `key.doc.full_as_xml` from `cursor.info` request. - -:param: xmlDocs Contents of `key.doc.full_as_xml` from SourceKit. - -:returns: XML parsed as an `XPCDictionary`. -*/ -public func parseFullXMLDocs(xmlDocs: String) -> XPCDictionary? { - let cleanXMLDocs = xmlDocs.stringByReplacingOccurrencesOfString("", withString: "") - .stringByReplacingOccurrencesOfString("", withString: "") - return map(SWXMLHash.parse(cleanXMLDocs).children.first) { rootXML in - var docs = XPCDictionary() - docs[SwiftDocKey.DocType.rawValue] = rootXML.element?.name - docs[SwiftDocKey.DocFile.rawValue] = rootXML.element?.attributes["file"] - docs[SwiftDocKey.DocLine.rawValue] = map(rootXML.element?.attributes["line"]) { - Int64(($0 as NSString).integerValue) - } - docs[SwiftDocKey.DocColumn.rawValue] = map(rootXML.element?.attributes["column"]) { - Int64(($0 as NSString).integerValue) - } - docs[SwiftDocKey.DocName.rawValue] = rootXML["Name"].element?.text - docs[SwiftDocKey.DocUSR.rawValue] = rootXML["USR"].element?.text - docs[SwiftDocKey.DocDeclaration.rawValue] = rootXML["Declaration"].element?.text - let parameters = rootXML["Parameters"].children - if parameters.count > 0 { - docs[SwiftDocKey.DocParameters.rawValue] = map(parameters) { - return [ - "name": $0["Name"].element?.text ?? "", - "discussion": childrenAsArray($0["Discussion"]) ?? [] - ] as XPCDictionary - } as XPCArray - } - docs[SwiftDocKey.DocDiscussion.rawValue] = childrenAsArray(rootXML["Discussion"]) - docs[SwiftDocKey.DocResultDiscussion.rawValue] = childrenAsArray(rootXML["ResultDiscussion"]) - return docs - } -} - -/** -Returns an `XPCArray` of `XPCDictionary` items from `indexer` children, if any. - -:param: indexer `XMLIndexer` to traverse. -*/ -private func childrenAsArray(indexer: XMLIndexer) -> XPCArray? { - let children = indexer.children - if children.count > 0 { - return map(compact(map(children, { $0.element }))) { - [$0.name: $0.text ?? ""] as XPCDictionary - } as XPCArray - } - return nil -} diff --git a/Source/SourceKittenFramework/Info.plist b/Source/SourceKittenFramework/Info.plist index 27a23f7db..5a42a6807 100644 --- a/Source/SourceKittenFramework/Info.plist +++ b/Source/SourceKittenFramework/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.4.1 + 0.4.4 CFBundleSignature ???? CFBundleVersion diff --git a/Source/SourceKittenFramework/Language.swift b/Source/SourceKittenFramework/Language.swift index 6e2899253..634f831e5 100644 --- a/Source/SourceKittenFramework/Language.swift +++ b/Source/SourceKittenFramework/Language.swift @@ -13,93 +13,3 @@ public enum Language { /// Objective-C. case ObjC } - -/** -Partially filters compiler arguments from `xcodebuild` to something that SourceKit/Clang will accept. - -:param: args Compiler arguments, as parsed from `xcodebuild`. - -:returns: A tuple of partially filtered compiler arguments in `.0`, and whether or not there are - more flags to remove in `.1`. -*/ -private func partiallyFilterArguments(var args: [String]) -> ([String], Bool) { - var didRemove = false - let flagsToRemove = [ - "-output-file-map" - ] - for flag in flagsToRemove { - if let index = find(args, flag) { - didRemove = true - args.removeAtIndex(index.successor()) - args.removeAtIndex(index) - } - } - return (args, didRemove) -} - -/** -Filters compiler arguments from `xcodebuild` to something that SourceKit/Clang will accept. - -:param: args Compiler arguments, as parsed from `xcodebuild`. - -:returns: Filtered compiler arguments. -*/ -private func filterArguments(var args: [String]) -> [String] { - args.extend(["-D", "DEBUG"]) - var shouldContinueToFilterArguments = true - while shouldContinueToFilterArguments { - (args, shouldContinueToFilterArguments) = partiallyFilterArguments(args) - } - return args.filter({ - !contains([ - "-parseable-output", - "-incremental", - "-serialize-diagnostics", - "-emit-dependencies" - ], $0) - }).map { - if $0 == "-O" { - return "-Onone" - } else if $0 == "-DNDEBUG=1" { - return "-DDEBUG=1" - } - return $0 - } -} - -/** -Parses the compiler arguments needed to compile the `language` files. - -:param: xcodebuildOutput Output of `xcodebuild` to be parsed for compiler arguments. -:param: language Language to parse for. -:param: moduleName Name of the Module for which to extract compiler arguments. - -:returns: Compiler arguments, filtered for suitable use by SourceKit if `.Swift` or Clang if `.ObjC`. -*/ -internal func parseCompilerArguments(xcodebuildOutput: NSString, #language: Language, #moduleName: String?) -> [String]? { - let pattern: String = { - if language == .ObjC { - return "/usr/bin/clang.*" - } else if let moduleName = moduleName { - return "/usr/bin/swiftc.*-module-name \(moduleName) .*" - } - return "/usr/bin/swiftc.*" - }() - let regex = NSRegularExpression(pattern: pattern, options: nil, error: nil)! // Safe to force unwrap - let range = NSRange(location: 0, length: xcodebuildOutput.length) - - if let regexMatch = regex.firstMatchInString(xcodebuildOutput as! String, options: nil, range: range) { - let escapedSpacePlaceholder = "\u{0}" - let args = filterArguments(xcodebuildOutput - .substringWithRange(regexMatch.range) - .stringByReplacingOccurrencesOfString("\\ ", withString: escapedSpacePlaceholder) - .componentsSeparatedByString(" ")) - - // Remove first argument (swiftc/clang) and re-add spaces in arguments - return Array(args[1.. String? { - fputs("Running xcodebuild\n", stderr) - - let task = NSTask() - task.launchPath = "/usr/bin/xcodebuild" - task.currentDirectoryPath = path - task.arguments = arguments + ["clean", "build", "CODE_SIGN_IDENTITY=", "CODE_SIGNING_REQUIRED=NO"] - - let pipe = NSPipe() - task.standardOutput = pipe - task.standardError = pipe - - task.launch() - - let file = pipe.fileHandleForReading - let xcodebuildOutput = NSString(data: file.readDataToEndOfFile(), encoding: NSUTF8StringEncoding) - file.closeFile() - - return xcodebuildOutput as! String? -} - -/** -Parses likely module name from compiler or `xcodebuild` arguments. - -Will the following values, in this priority: module name, target name, scheme name. - -:param: arguments Compiler or `xcodebuild` arguments to parse. - -:returns: Module name if successful. -*/ -private func moduleNameFromArguments(arguments: [String]) -> String? { - let flags = ["-module-name", "-target", "-scheme"] - for flag in flags { - if let flagIndex = find(arguments, flag) { - if flagIndex + 1 < arguments.count { - return arguments[flagIndex + 1] - } - } - } - return nil -} diff --git a/Source/SourceKittenFramework/OffsetMap.swift b/Source/SourceKittenFramework/OffsetMap.swift index ddac02002..1af589c1e 100644 --- a/Source/SourceKittenFramework/OffsetMap.swift +++ b/Source/SourceKittenFramework/OffsetMap.swift @@ -17,13 +17,13 @@ extension File { Creates an OffsetMap containing offset locations at which there are declarations that likely have documentation comments, but haven't been documented by SourceKitten yet. - :param: documentedTokenOffsets Offsets where there are declarations that likely - have documentation comments. - :param: dictionary Docs dictionary to check for which offsets are already - documented. + - parameter documentedTokenOffsets: Offsets where there are declarations that likely + have documentation comments. + - parameter dictionary: Docs dictionary to check for which offsets are already + documented. - :returns: OffsetMap containing offset locations at which there are declarations that likely - have documentation comments, but haven't been documented by SourceKitten yet. + - returns: OffsetMap containing offset locations at which there are declarations that likely + have documentation comments, but haven't been documented by SourceKitten yet. */ public func generateOffsetMap(documentedTokenOffsets: [Int], dictionary: XPCDictionary) -> OffsetMap { var offsetMap = OffsetMap() @@ -31,7 +31,7 @@ extension File { offsetMap[offset] = 0 } offsetMap = mapOffsets(dictionary, offsetMap: offsetMap) - let alreadyDocumentedOffsets = offsetMap.keys.filter { $0 == offsetMap[$0] } + let alreadyDocumentedOffsets = offsetMap.filter({ $0.0 == $0.1 }).map { $0.0 } for alreadyDocumentedOffset in alreadyDocumentedOffsets { offsetMap.removeValueForKey(alreadyDocumentedOffset) } @@ -42,24 +42,25 @@ extension File { Creates a new OffsetMap that matches all offsets in the offsetMap parameter's keys to its nearest, currently documented parent offset. - :param: dictionary Already documented dictionary. - :param: offsetMap Dictionary mapping potentially documented offsets to its nearest parent - offset. + - parameter dictionary: Already documented dictionary. + - parameter offsetMap: Dictionary mapping potentially documented offsets to its nearest parent + offset. - :returns: OffsetMap of potentially documented declaration offsets to its nearest parent offset. + - returns: OffsetMap of potentially documented declaration offsets to its nearest parent offset. */ private func mapOffsets(dictionary: XPCDictionary, var offsetMap: OffsetMap) -> OffsetMap { // Only map if we're in the correct file - if shouldTreatAsSameFile(dictionary) { - if let rangeStart = SwiftDocKey.getNameOffset(dictionary), - rangeLength = SwiftDocKey.getNameLength(dictionary) { - let bodyLength = SwiftDocKey.getBodyLength(dictionary) - let offsetsInRange = offsetMap.keys.filter { - $0 >= Int(rangeStart) && $0 <= Int(rangeStart + rangeLength + (bodyLength ?? 0)) - } - for offset in offsetsInRange { - offsetMap[offset] = Int(rangeStart) - } + if let rangeStart = SwiftDocKey.getNameOffset(dictionary), + rangeLength = SwiftDocKey.getNameLength(dictionary) where + shouldTreatAsSameFile(dictionary) { + let bodyLength = SwiftDocKey.getBodyLength(dictionary) ?? 0 + let rangeMax = Int(rangeStart + rangeLength + bodyLength) + let rangeStart = Int(rangeStart) + let offsetsInRange = offsetMap.keys.filter { + $0 >= rangeStart && $0 <= rangeMax + } + for offset in offsetsInRange { + offsetMap[offset] = rangeStart } } // Recurse! diff --git a/Source/SourceKittenFramework/Request.swift b/Source/SourceKittenFramework/Request.swift index 5b7d69382..b1e2904cf 100644 --- a/Source/SourceKittenFramework/Request.swift +++ b/Source/SourceKittenFramework/Request.swift @@ -18,9 +18,9 @@ private var uidStringMap = [UInt64: String]() /** Cache SourceKit requests for strings from UIDs -:param: uid UID received from sourcekitd* responses +- parameter uid: UID received from sourcekitd* responses. -:returns: Cached UID string if available, other +- returns: Cached UID string if available, nil otherwise. */ internal func stringForSourceKitUID(uid: UInt64) -> String? { if uid < 4_300_000_000 { @@ -28,11 +28,9 @@ internal func stringForSourceKitUID(uid: UInt64) -> String? { return nil } else if let string = uidStringMap[uid] { return string - } else { - if let uidString = String(UTF8String: sourcekitd_uid_get_string_ptr(uid)) { - uidStringMap[uid] = uidString - return uidString - } + } else if let uidString = String(UTF8String: sourcekitd_uid_get_string_ptr(uid)) { + uidStringMap[uid] = uidString + return uidString } return nil } @@ -54,20 +52,20 @@ public enum Request { if let path = file.path { return toXPC([ "key.request": openRequestUID, - "key.name": "", + "key.name": path, "key.sourcefile": path ]) } else { return toXPC([ "key.request": openRequestUID, - "key.name": "", - "key.sourcetext": file.contents as String + "key.name": String(file.contents.hash), + "key.sourcetext": file.contents ]) } case .CursorInfo(let file, let offset, let arguments): return toXPC([ "key.request": sourcekitd_uid_get_from_cstr("source.request.cursorinfo"), - "key.name": "", + "key.name": file, "key.sourcefile": file, "key.offset": offset, "key.compilerargs": (arguments.map { $0 as XPCRepresentable } as XPCArray) @@ -80,10 +78,10 @@ public enum Request { /** Create a Request.CursorInfo.xpcValue() from a file path and compiler arguments. - :param: filePath Path of the file to create request. - :param: arguments Compiler arguments. + - parameter filePath: Path of the file to create request. + - parameter arguments: Compiler arguments. - :returns: xpc_object_t representation of the Request, if successful. + - returns: xpc_object_t representation of the Request, if successful. */ internal static func cursorInfoRequestForFilePath(filePath: String?, arguments: [String]) -> xpc_object_t? { if let path = filePath { @@ -95,10 +93,10 @@ public enum Request { /** Send a Request.CursorInfo by updating its offset. Returns SourceKit response if successful. - :param: request xpc_object_t representation of Request.CursorInfo - :param: offset Offset to update request. + - parameter request: xpc_object_t representation of Request.CursorInfo + - parameter offset: Offset to update request. - :returns: SourceKit response if successful. + - returns: SourceKit response if successful. */ internal static func sendCursorInfoRequest(request: xpc_object_t, atOffset offset: Int64) -> XPCDictionary? { if offset == 0 { @@ -111,22 +109,22 @@ public enum Request { /** Sends the request to SourceKit and return the response as an XPCDictionary. - :returns: SourceKit output as an XPC dictionary. + - returns: SourceKit output as an XPC dictionary. */ public func send() -> XPCDictionary { dispatch_once(&sourceKitInitializationToken) { sourcekitd_initialize() } - if let response = sourcekitd_send_request_sync(xpcValue) { - return replaceUIDsWithSourceKitStrings(fromXPC(response)) + guard let response = sourcekitd_send_request_sync(xpcValue) else { + fatalError("SourceKit response nil for request \(self)") } - fatalError("SourceKit response nil for request \(self)") + return replaceUIDsWithSourceKitStrings(fromXPC(response)) } } -// MARK: Printable +// MARK: CustomStringConvertible -extension Request: Printable { +extension Request: CustomStringConvertible { /// A textual representation of `Request`. public var description: String { return xpcValue.description } } diff --git a/Source/SourceKittenFramework/SequenceType+SourceKitten.swift b/Source/SourceKittenFramework/SequenceType+SourceKitten.swift deleted file mode 100644 index 57c708017..000000000 --- a/Source/SourceKittenFramework/SequenceType+SourceKitten.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SequenceType+SourceKitten.swift -// SourceKitten -// -// Created by JP Simard on 2015-01-11. -// Copyright (c) 2015 SourceKitten. All rights reserved. -// - -/** -Returns an array of the non-nil elements of the input sequence. - -:param: sequence Sequence to compact. - -:returns: An array of the non-nil elements of the input sequence. -*/ -public func compact>(sequence: S) -> [T] { - return filter(sequence, { - $0 != nil - }).map { - $0! // Safe to force unwrap - } -} diff --git a/Source/SourceKittenFramework/SourceDeclaration.swift b/Source/SourceKittenFramework/SourceDeclaration.swift new file mode 100644 index 000000000..04b120676 --- /dev/null +++ b/Source/SourceKittenFramework/SourceDeclaration.swift @@ -0,0 +1,65 @@ +// +// SourceDeclaration.swift +// SourceKitten +// +// Created by JP Simard on 7/15/15. +// Copyright © 2015 SourceKitten. All rights reserved. +// + +import SwiftXPC +import SWXMLHash + +/** +Parse XML from `key.doc.full_as_xml` from `cursor.info` request. + +- parameter xmlDocs: Contents of `key.doc.full_as_xml` from SourceKit. + +- returns: XML parsed as an `XPCDictionary`. +*/ +public func parseFullXMLDocs(xmlDocs: String) -> XPCDictionary? { + let cleanXMLDocs = xmlDocs.stringByReplacingOccurrencesOfString("", withString: "") + .stringByReplacingOccurrencesOfString("", withString: "") + .stringByReplacingOccurrencesOfString("", withString: "`") + .stringByReplacingOccurrencesOfString("", withString: "`") + return SWXMLHash.parse(cleanXMLDocs).children.first.map { rootXML in + var docs = XPCDictionary() + docs[SwiftDocKey.DocType.rawValue] = rootXML.element?.name + docs[SwiftDocKey.DocFile.rawValue] = rootXML.element?.attributes["file"] + docs[SwiftDocKey.DocLine.rawValue] = rootXML.element?.attributes["line"].flatMap { + Int64($0) + } + docs[SwiftDocKey.DocColumn.rawValue] = rootXML.element?.attributes["column"].flatMap { + Int64($0) + } + docs[SwiftDocKey.DocName.rawValue] = rootXML["Name"].element?.text + docs[SwiftDocKey.DocUSR.rawValue] = rootXML["USR"].element?.text + docs[SwiftDocKey.DocDeclaration.rawValue] = rootXML["Declaration"].element?.text + let parameters = rootXML["Parameters"].children + if parameters.count > 0 { + docs[SwiftDocKey.DocParameters.rawValue] = parameters.map { + [ + "name": $0["Name"].element?.text ?? "", + "discussion": childrenAsArray($0["Discussion"]) ?? [] + ] as XPCDictionary + } as XPCArray + } + docs[SwiftDocKey.DocDiscussion.rawValue] = childrenAsArray(rootXML["Discussion"]) + docs[SwiftDocKey.DocResultDiscussion.rawValue] = childrenAsArray(rootXML["ResultDiscussion"]) + return docs + } +} + +/** +Returns an `XPCArray` of `XPCDictionary` items from `indexer` children, if any. + +- parameter indexer: `XMLIndexer` to traverse. +*/ +private func childrenAsArray(indexer: XMLIndexer) -> XPCArray? { + let children = indexer.children + if children.count > 0 { + return children.flatMap({ $0.element }).map { + [$0.name: $0.text ?? ""] as XPCDictionary + } as XPCArray + } + return nil +} diff --git a/Source/SourceKittenFramework/SourceKittenFramework.h b/Source/SourceKittenFramework/SourceKittenFramework.h index ecd61b4c6..baaeb8fbf 100644 --- a/Source/SourceKittenFramework/SourceKittenFramework.h +++ b/Source/SourceKittenFramework/SourceKittenFramework.h @@ -17,5 +17,7 @@ FOUNDATION_EXPORT const unsigned char SourceKittenFrameworkVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import // Ideally this would be in a bridging header, but due to rdar://17633863, we can't have nice things. +// TODO: use clang-c's modulemap instead. #import +#import #import diff --git a/Source/SourceKittenFramework/String+SourceKitten.swift b/Source/SourceKittenFramework/String+SourceKitten.swift index db82b332a..8e486bed8 100644 --- a/Source/SourceKittenFramework/String+SourceKitten.swift +++ b/Source/SourceKittenFramework/String+SourceKitten.swift @@ -14,9 +14,9 @@ extension NSString { /** Binary search for NSString index equivalent to byte offset. - :param: offset Byte offset. + - parameter offset: Byte offset. - :returns: NSString index, if any. + - returns: NSString index, if any. */ private func indexOfByteOffset(offset: Int) -> Int? { var usedLength = 0 @@ -30,7 +30,7 @@ extension NSString { maxLength: Int.max, usedLength: &usedLength, encoding: NSUTF8StringEncoding, - options: nil, + options: [], range: NSRange(location: 0, length: midpoint), remainingRange: nil) if usedLength < offset { @@ -50,12 +50,15 @@ extension NSString { Returns a copy of `self` with the trailing contiguous characters belonging to `characterSet` removed. - :param: characterSet Character set to check for membership. + - parameter characterSet: Character set to check for membership. */ public func stringByTrimmingTrailingCharactersInSet(characterSet: NSCharacterSet) -> String { + if length == 0 { + return self as String + } var charBuffer = [unichar](count: length, repeatedValue: 0) getCharacters(&charBuffer) - for newLength in reverse(1...length) { + for newLength in (1...length).reverse() { if !characterSet.characterIsMember(charBuffer[newLength - 1]) { return substringWithRange(NSRange(location: 0, length: newLength)) } @@ -66,27 +69,27 @@ extension NSString { /** Returns self represented as an absolute path. - :param: rootDirectory Absolute parent path if not already an absolute path. + - parameter rootDirectory: Absolute parent path if not already an absolute path. */ public func absolutePathRepresentation(rootDirectory: String = NSFileManager.defaultManager().currentDirectoryPath) -> String { if absolutePath { return self as String } - return NSString.pathWithComponents([rootDirectory, self]).stringByStandardizingPath + return (NSString.pathWithComponents([rootDirectory, self as String]) as NSString).stringByStandardizingPath } /** Converts a range of byte offsets in `self` to an `NSRange` suitable for filtering `self` as an `NSString`. - :param: start Starting byte offset. - :param: length Length of bytes to include in range. + - parameter start: Starting byte offset. + - parameter length: Length of bytes to include in range. - :returns: An equivalent `NSRange`. + - returns: An equivalent `NSRange`. */ - public func byteRangeToNSRange(# start: Int, length: Int) -> NSRange? { - return flatMap(indexOfByteOffset(start)) { stringStart in - return map(self.indexOfByteOffset(start + length)) { stringEnd in + public func byteRangeToNSRange(start start: Int, length: Int) -> NSRange? { + return indexOfByteOffset(start).flatMap { stringStart in + return indexOfByteOffset(start + length).map { stringEnd in return NSRange(location: stringStart, length: stringEnd - stringStart) } } @@ -95,48 +98,43 @@ extension NSString { /** Returns a substring with the provided byte range. - :param: start Starting byte offset. - :param: length Length of bytes to include in range. + - parameter start: Starting byte offset. + - parameter length: Length of bytes to include in range. */ - public func substringWithByteRange(# start: Int, length: Int) -> String? { - return map(byteRangeToNSRange(start: start, length: length)) { - self.substringWithRange($0) - } + public func substringWithByteRange(start start: Int, length: Int) -> String? { + return byteRangeToNSRange(start: start, length: length).map(substringWithRange) } /** Returns a substring starting at the beginning of `start`'s line and ending at the end of `end`'s line. Returns `start`'s entire line if `end` is nil. - :param: start Starting byte offset. - :param: length Length of bytes to include in range. + - parameter start: Starting byte offset. + - parameter length: Length of bytes to include in range. */ - public func substringLinesWithByteRange(# start: Int, length: Int) -> String? { - return map(byteRangeToNSRange(start: start, length: length)) { range in - var lineStart = 0 - var lineEnd = 0 - self.getLineStart(&lineStart, end: &lineEnd, contentsEnd: nil, forRange: range) - return self.substringWithRange(NSRange(location: lineStart, length: lineEnd - lineStart)) + public func substringLinesWithByteRange(start start: Int, length: Int) -> String? { + return byteRangeToNSRange(start: start, length: length).map { range in + var lineStart = 0, lineEnd = 0 + getLineStart(&lineStart, end: &lineEnd, contentsEnd: nil, forRange: range) + return substringWithRange(NSRange(location: lineStart, length: lineEnd - lineStart)) } } /** Returns line numbers containing starting and ending byte offsets. - :param: start Starting byte offset. - :param: length Length of bytes to include in range. + - parameter start: Starting byte offset. + - parameter length: Length of bytes to include in range. */ - public func lineRangeWithByteRange(# start: Int, length: Int) -> (start: Int, end: Int)? { - return flatMap(byteRangeToNSRange(start: start, length: length)) { range in - var numberOfLines = 0 - var index = 0 - var lineRangeStart = 0 + public func lineRangeWithByteRange(start start: Int, length: Int) -> (start: Int, end: Int)? { + return byteRangeToNSRange(start: start, length: length).flatMap { range in + var numberOfLines = 0, index = 0, lineRangeStart = 0 while index < self.length { numberOfLines++ if index <= range.location { lineRangeStart = numberOfLines } - index = NSMaxRange(self.lineRangeForRange(NSRange(location: index, length: 1))) + index = NSMaxRange(lineRangeForRange(NSRange(location: index, length: 1))) if index > NSMaxRange(range) { return (lineRangeStart, numberOfLines) } @@ -144,14 +142,12 @@ extension NSString { return nil } } -} -extension String { /** Returns true if self is an Objective-C header file. */ public func isObjectiveCHeaderFile() -> Bool { - return contains(["h", "hpp", "hh"], pathExtension) + return ["h", "hpp", "hh"].contains(pathExtension) } /** @@ -160,7 +156,9 @@ extension String { public func isSwiftFile() -> Bool { return pathExtension == "swift" } +} +extension String { /** Returns whether or not the `token` can be documented. Either because it is a `SyntaxKind.Identifier` or because it is a function treated as a `SyntaxKind.Keyword`: @@ -169,14 +167,13 @@ extension String { - `init` - `deinit` - :param: token Token to process. + - parameter token: Token to process. */ public func isTokenDocumentable(token: SyntaxToken) -> Bool { if token.type == SyntaxKind.Keyword.rawValue { let keywordFunctions = ["subscript", "init", "deinit"] - return map((self as NSString).substringWithByteRange(start: token.offset, length: token.length)) { - contains(keywordFunctions, $0) - } ?? false + return ((self as NSString).substringWithByteRange(start: token.offset, length: token.length)) + .map(keywordFunctions.contains) ?? false } return token.type == SyntaxKind.Identifier.rawValue } @@ -184,57 +181,54 @@ extension String { /** Find integer offsets of documented Swift tokens in self. - :param: syntaxMap Syntax Map returned from SourceKit editor.open request. + - parameter syntaxMap: Syntax Map returned from SourceKit editor.open request. - :returns: Array of documented token offsets. + - returns: Array of documented token offsets. */ public func documentedTokenOffsets(syntaxMap: SyntaxMap) -> [Int] { - let documentableOffsets = syntaxMap.tokens.filter({ - self.isTokenDocumentable($0) - }).map { + let documentableOffsets = syntaxMap.tokens.filter(isTokenDocumentable).map { $0.offset } - let regex = NSRegularExpression(pattern: "(///.*\\n|\\*/\\n)", options: nil, error: nil)! // Safe to force unwrap - let range = NSRange(location: 0, length: count(utf16)) - let matches = regex.matchesInString(self, options: nil, range: range) as! [NSTextCheckingResult] + let regex = try! NSRegularExpression(pattern: "(///.*\\n|\\*/\\n)", options: []) // Safe to force try + let range = NSRange(location: 0, length: utf16.count) + let matches = regex.matchesInString(self, options: [], range: range) - return compact(matches.map({ match in + return matches.flatMap { match in documentableOffsets.filter({ $0 >= match.range.location }).first - })) + } } /** Returns the body of the comment if the string is a comment. - :param: range Range to restrict the search for a comment body. + - parameter range: Range to restrict the search for a comment body. */ - public func commentBody(var range: NSRange? = nil) -> String? { + public func commentBody(range: NSRange? = nil) -> String? { let nsString = self as NSString let patterns: [(pattern: String, options: NSRegularExpressionOptions)] = [ - ("^\\s*\\/\\*\\*\\s*(.+)\\*\\/", .AnchorsMatchLines | .DotMatchesLineSeparators), // multi: ^\s*\/\*\*\s*(.+)\*\/ - ("^\\s*\\/\\/\\/(.+)?", .AnchorsMatchLines) // single: ^\s*\/\/\/(.+)? + ("^\\s*\\/\\*\\*\\s*(.+)\\*\\/", [.AnchorsMatchLines, .DotMatchesLineSeparators]), // multi: ^\s*\/\*\*\s*(.+)\*\/ + ("^\\s*\\/\\/\\/(.+)?", .AnchorsMatchLines) // single: ^\s*\/\/\/(.+)? ] - if range == nil { - range = NSRange(location: 0, length: nsString.length) - } + let range = range ?? NSRange(location: 0, length: nsString.length) for pattern in patterns { - let regex = NSRegularExpression(pattern: pattern.pattern, options: pattern.options, error: nil)! // Safe to force unwrap - let matches = regex.matchesInString(self, options: nil, range: range!) as! [NSTextCheckingResult] - let bodyParts: [String] = flatMap(matches) { match in + let regex = try! NSRegularExpression(pattern: pattern.pattern, options: pattern.options) // Safe to force try + let matches = regex.matchesInString(self, options: [], range: range) + let bodyParts = matches.flatMap { match -> [String] in let numberOfRanges = match.numberOfRanges if numberOfRanges < 1 { return [] } - return map(1..= minLeadingWhitespace { + if line.characters.count >= minLeadingWhitespace { lines.append(line[advance(line.startIndex, minLeadingWhitespace).. Int { let utf16View = utf16 diff --git a/Source/SourceKittenFramework/Structure.swift b/Source/SourceKittenFramework/Structure.swift index 5268b6973..76e466dea 100644 --- a/Source/SourceKittenFramework/Structure.swift +++ b/Source/SourceKittenFramework/Structure.swift @@ -17,7 +17,7 @@ public struct Structure { /** Initialize a Structure by passing in a File. - :param: file File to parse for structural information. + - parameter file: File to parse for structural information. */ public init(file: File) { var tmpDictionary = Request.EditorOpen(file).send() @@ -26,11 +26,11 @@ public struct Structure { } } -// MARK: Printable +// MARK: CustomStringConvertible -extension Structure: Printable { +extension Structure: CustomStringConvertible { /// A textual JSON representation of `Structure`. - public var description: String { return toJSON(dictionary) } + public var description: String { return toJSON(toAnyObject(dictionary)) } } // MARK: Equatable @@ -40,10 +40,10 @@ extension Structure: Equatable {} /** Returns true if `lhs` Structure is equal to `rhs` Structure. -:param: lhs Structure to compare to `rhs`. -:param: rhs Structure to compare to `lhs`. +- parameter lhs: Structure to compare to `rhs`. +- parameter rhs: Structure to compare to `lhs`. -:returns: True if `lhs` Structure is equal to `rhs` Structure. +- returns: True if `lhs` Structure is equal to `rhs` Structure. */ public func ==(lhs: Structure, rhs: Structure) -> Bool { return lhs.dictionary == rhs.dictionary diff --git a/Source/SourceKittenFramework/SwiftDeclarationKind.swift b/Source/SourceKittenFramework/SwiftDeclarationKind.swift index 8966e1958..1a0aa4cac 100644 --- a/Source/SourceKittenFramework/SwiftDeclarationKind.swift +++ b/Source/SourceKittenFramework/SwiftDeclarationKind.swift @@ -6,13 +6,15 @@ // Copyright (c) 2015 SourceKitten. All rights reserved. // -/// Declaration kind values. +/// Swift declaration kinds. /// Found in `strings SourceKitService | grep source.lang.swift.decl.`. public enum SwiftDeclarationKind: String { /// `class`. case Class = "source.lang.swift.decl.class" /// `enum`. case Enum = "source.lang.swift.decl.enum" + /// `enumcase`. + case Enumcase = "source.lang.swift.decl.enumcase" /// `enumelement`. case Enumelement = "source.lang.swift.decl.enumelement" /// `extension`. @@ -21,6 +23,8 @@ public enum SwiftDeclarationKind: String { case ExtensionClass = "source.lang.swift.decl.extension.class" /// `extension.enum`. case ExtensionEnum = "source.lang.swift.decl.extension.enum" + /// `extension.protocol`. + case ExtensionProtocol = "source.lang.swift.decl.extension.protocol" /// `extension.struct`. case ExtensionStruct = "source.lang.swift.decl.extension.struct" /// `function.accessor.address`. diff --git a/Source/SourceKittenFramework/SwiftDocKey.swift b/Source/SourceKittenFramework/SwiftDocKey.swift index 69ca2a7ad..721bf2fa7 100644 --- a/Source/SourceKittenFramework/SwiftDocKey.swift +++ b/Source/SourceKittenFramework/SwiftDocKey.swift @@ -81,10 +81,10 @@ internal enum SwiftDocKey: String { /** Returns the typed value of a dictionary key. - :param: key SwiftDoctKey to get from the dictionary. - :param: dictionary Dictionary to get value from. + - parameter key: SwiftDoctKey to get from the dictionary. + - parameter dictionary: Dictionary to get value from. - :returns: Typed value of a dictionary key. + - returns: Typed value of a dictionary key. */ private static func get(key: SwiftDocKey, _ dictionary: XPCDictionary) -> T? { return dictionary[key.rawValue] as! T? @@ -93,176 +93,143 @@ internal enum SwiftDocKey: String { /** Get kind string from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Kind string if successful. + - returns: Kind string if successful. */ internal static func getKind(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.Kind, dictionary) + return get(.Kind, dictionary) } /** Get syntax map data from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Syntax map data if successful. + - returns: Syntax map data if successful. */ internal static func getSyntaxMap(dictionary: XPCDictionary) -> NSData? { - return SwiftDocKey.get(.SyntaxMap, dictionary) + return get(.SyntaxMap, dictionary) } /** Get offset int from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Offset int if successful. + - returns: Offset int if successful. */ internal static func getOffset(dictionary: XPCDictionary) -> Int64? { - return SwiftDocKey.get(.Offset, dictionary) + return get(.Offset, dictionary) } /** Get length int from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Length int if successful. + - returns: Length int if successful. */ internal static func getLength(dictionary: XPCDictionary) -> Int64? { - return SwiftDocKey.get(.Length, dictionary) + return get(.Length, dictionary) } /** Get type name string from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Type name string if successful. + - returns: Type name string if successful. */ internal static func getTypeName(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.TypeName, dictionary) + return get(.TypeName, dictionary) } /** Get annotated declaration string from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Annotated declaration string if successful. + - returns: Annotated declaration string if successful. */ internal static func getAnnotatedDeclaration(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.AnnotatedDeclaration, dictionary) + return get(.AnnotatedDeclaration, dictionary) } /** Get substructure array from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Substructure array if successful. + - returns: Substructure array if successful. */ internal static func getSubstructure(dictionary: XPCDictionary) -> XPCArray? { - return SwiftDocKey.get(.Substructure, dictionary) - } - - /** - Get parsed declaration string from dictionary. - - :param: dictionary Dictionary to get value from. - - :returns: Parsed declaration string if successful. - */ - internal static func getParsedDeclaration(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.ParsedDeclaration, dictionary) + return get(.Substructure, dictionary) } /** Get name offset int from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Name offset int if successful. + - returns: Name offset int if successful. */ internal static func getNameOffset(dictionary: XPCDictionary) -> Int64? { - return SwiftDocKey.get(.NameOffset, dictionary) + return get(.NameOffset, dictionary) } /** Get length int from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Length int if successful. + - returns: Length int if successful. */ internal static func getNameLength(dictionary: XPCDictionary) -> Int64? { - return SwiftDocKey.get(.NameLength, dictionary) + return get(.NameLength, dictionary) } /** Get body offset int from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Body offset int if successful. + - returns: Body offset int if successful. */ internal static func getBodyOffset(dictionary: XPCDictionary) -> Int64? { - return SwiftDocKey.get(.BodyOffset, dictionary) + return get(.BodyOffset, dictionary) } /** Get body length int from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Body length int if successful. + - returns: Body length int if successful. */ internal static func getBodyLength(dictionary: XPCDictionary) -> Int64? { - return SwiftDocKey.get(.BodyLength, dictionary) + return get(.BodyLength, dictionary) } /** Get file path string from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: File path string if successful. + - returns: File path string if successful. */ internal static func getFilePath(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.FilePath, dictionary) - } - - /** - Get name string from dictionary. - - :param: dictionary Dictionary to get value from. - - :returns: Name string if successful. - */ - internal static func getName(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.Name, dictionary) - } - - /** - Get diagnostic stage string from dictionary. - - :param: dictionary Dictionary to get value from. - - :returns: Diagnostic stage string if successful. - */ - internal static func getDiagnosticStage(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.DiagnosticStage, dictionary) + return get(.FilePath, dictionary) } /** Get full xml docs string from dictionary. - :param: dictionary Dictionary to get value from. + - parameter dictionary: Dictionary to get value from. - :returns: Full xml docs string if successful. + - returns: Full xml docs string if successful. */ internal static func getFullXMLDocs(dictionary: XPCDictionary) -> String? { - return SwiftDocKey.get(.FullXMLDocs, dictionary) + return get(.FullXMLDocs, dictionary) } } diff --git a/Source/SourceKittenFramework/SwiftDocs.swift b/Source/SourceKittenFramework/SwiftDocs.swift index 6d4d51c9b..cae352aef 100644 --- a/Source/SourceKittenFramework/SwiftDocs.swift +++ b/Source/SourceKittenFramework/SwiftDocs.swift @@ -20,8 +20,8 @@ public struct SwiftDocs { /** Create docs for the specified Swift file and compiler arguments. - :param: file Swift file to document - :param: arguments compiler arguments to pass to SourceKit + - parameter file: Swift file to document. + - parameter arguments: compiler arguments to pass to SourceKit. */ public init(file: File, arguments: [String]) { self.init( @@ -34,9 +34,9 @@ public struct SwiftDocs { /** Create docs for the specified Swift file, editor.open SourceKit response and cursor info request. - :param: file Swift file to document - :param: dictionary editor.open response from SourceKit - :param: cursorInfoRequest SourceKit xpc dictionary to use to send cursorinfo request. + - parameter file: Swift file to document. + - parameter dictionary: editor.open response from SourceKit. + - parameter cursorInfoRequest: SourceKit xpc dictionary to use to send cursorinfo request. */ public init(file: File, var dictionary: XPCDictionary, cursorInfoRequest: xpc_object_t?) { self.file = file @@ -56,9 +56,11 @@ public struct SwiftDocs { } } -// MARK: Printable +// MARK: CustomStringConvertible -extension SwiftDocs: Printable { +extension SwiftDocs: CustomStringConvertible { /// A textual JSON representation of `SwiftDocs`. - public var description: String { return toJSON([file.path ?? "": docsDictionary]) } + public var description: String { + return toJSON(toAnyObject([file.path ?? "": docsDictionary])) + } } diff --git a/Source/SourceKittenFramework/SwiftXPC+JSON.swift b/Source/SourceKittenFramework/SwiftXPC+JSON.swift index b08d3fd75..5799ed0a0 100644 --- a/Source/SourceKittenFramework/SwiftXPC+JSON.swift +++ b/Source/SourceKittenFramework/SwiftXPC+JSON.swift @@ -9,58 +9,40 @@ import Foundation import SwiftXPC -/** -Convert XPCDictionary to JSON. - -:param: dictionary XPCDictionary to convert. - -:returns: Converted JSON. -*/ -public func toJSON(dictionary: XPCDictionary) -> String { - return toJSON(toAnyObject(dictionary)) -} - -/** -Convert XPCArray of XPCDictionary's to JSON. - -:param: array XPCArray of XPCDictionary's to convert. - -:returns: Converted JSON. -*/ -public func toJSON(array: XPCArray) -> String { - return toJSON(array.map { toAnyObject($0 as! XPCDictionary) }) -} - /** JSON Object to JSON String. -:param: object Object to convert to JSON. +- parameter object: Object to convert to JSON. -:returns: JSON string representation of the input object. +- returns: JSON string representation of the input object. */ public func toJSON(object: AnyObject) -> String { - if let prettyJSONData = NSJSONSerialization.dataWithJSONObject(object, - options: .PrettyPrinted, - error: nil), - jsonString = NSString(data: prettyJSONData, encoding: NSUTF8StringEncoding) as? String { - return jsonString - } + do { + let prettyJSONData = try NSJSONSerialization.dataWithJSONObject(object, options: .PrettyPrinted) + if let jsonString = NSString(data: prettyJSONData, encoding: NSUTF8StringEncoding) as? String { + return jsonString + } + } catch {} return "" } /** -Convert XPCDictionary to `[String: AnyObject]` for conversion using NSJSONSerialization. See toJSON(_:) +Convert XPCDictionary to `[String: AnyObject]`. -:param: dictionary XPCDictionary to convert. +- parameter dictionary: XPCDictionary to convert. -:returns: JSON-serializable Dictionary. +- returns: JSON-serializable Dictionary. */ public func toAnyObject(dictionary: XPCDictionary) -> [String: AnyObject] { var anyDictionary = [String: AnyObject]() for (key, object) in dictionary { switch object { + case let object as AnyObject: + anyDictionary[key] = object case let object as XPCArray: anyDictionary[key] = object.map { toAnyObject($0 as! XPCDictionary) } + case let object as [XPCDictionary]: + anyDictionary[key] = object.map { toAnyObject($0) } case let object as XPCDictionary: anyDictionary[key] = toAnyObject(object) case let object as String: diff --git a/Source/SourceKittenFramework/SyntaxKind.swift b/Source/SourceKittenFramework/SyntaxKind.swift index 73e29ca2d..68d1dd604 100644 --- a/Source/SourceKittenFramework/SyntaxKind.swift +++ b/Source/SourceKittenFramework/SyntaxKind.swift @@ -25,14 +25,22 @@ public enum SyntaxKind: String { case CommentMark = "source.lang.swift.syntaxtype.comment.mark" /// `comment.url`. case CommentURL = "source.lang.swift.syntaxtype.comment.url" + /// `doccomment`. + case DocComment = "source.lang.swift.syntaxtype.doccomment" + /// `doccomment.field`. + case DocCommentField = "source.lang.swift.syntaxtype.doccomment.field" /// `identifier`. case Identifier = "source.lang.swift.syntaxtype.identifier" /// `keyword`. case Keyword = "source.lang.swift.syntaxtype.keyword" /// `number`. case Number = "source.lang.swift.syntaxtype.number" + /// `objectliteral`. + case Objectliteral = "source.lang.swift.syntaxtype.objectliteral" /// `parameter`. case Parameter = "source.lang.swift.syntaxtype.parameter" + /// `placeholder`. + case Placeholder = "source.lang.swift.syntaxtype.placeholder" /// `string`. case String = "source.lang.swift.syntaxtype.string" /// `string_interpolation_anchor`. @@ -43,9 +51,9 @@ public enum SyntaxKind: String { /** Returns true if the input is a comment-like syntax kind string. - :param: string Input string. + - parameter string: Input string. */ internal static func isCommentLike(string: Swift.String) -> Bool { - return contains([Comment.rawValue, CommentMark.rawValue, CommentURL.rawValue], string) + return [Comment, CommentMark, CommentURL, DocComment, DocCommentField].map({ $0.rawValue }).contains(string) } } diff --git a/Source/SourceKittenFramework/SyntaxMap.swift b/Source/SourceKittenFramework/SyntaxMap.swift index f7a26195a..c6c5c4686 100644 --- a/Source/SourceKittenFramework/SyntaxMap.swift +++ b/Source/SourceKittenFramework/SyntaxMap.swift @@ -17,7 +17,7 @@ public struct SyntaxMap { /** Create a SyntaxMap by passing in tokens directly. - :param: tokens Array of SyntaxToken's. + - parameter tokens: Array of SyntaxToken's. */ public init(tokens: [SyntaxToken]) { self.tokens = tokens @@ -26,14 +26,14 @@ public struct SyntaxMap { /** Create a SyntaxMap by passing in NSData from a SourceKit `editor.open` response to be parsed. - :param: data NSData from a SourceKit `editor.open` response + - parameter data: NSData from a SourceKit `editor.open` response */ public init(data: NSData) { var numberOfTokens = 0 data.getBytes(&numberOfTokens, range: NSRange(location: 8, length: 8)) numberOfTokens = numberOfTokens >> 4 - tokens = map(stride(from: 16, through: numberOfTokens * 16, by: 16)) { parserOffset in + tokens = stride(from: 16, through: numberOfTokens * 16, by: 16).map { parserOffset in var uid = UInt64(0), offset = 0, length = 0 data.getBytes(&uid, range: NSRange(location: parserOffset, length: 8)) data.getBytes(&offset, range: NSRange(location: 8 + parserOffset, length: 4)) @@ -50,7 +50,7 @@ public struct SyntaxMap { /** Create a SyntaxMap from a SourceKit `editor.open` response. - :param: sourceKitResponse SourceKit `editor.open` response. + - parameter sourceKitResponse: SourceKit `editor.open` response. */ public init(sourceKitResponse: XPCDictionary) { self.init(data: SwiftDocKey.getSyntaxMap(sourceKitResponse)!) @@ -59,7 +59,7 @@ public struct SyntaxMap { /** Create a SyntaxMap from a File to be parsed. - :param: file File to be parsed. + - parameter file: File to be parsed. */ public init(file: File) { self.init(sourceKitResponse: Request.EditorOpen(file).send()) @@ -69,33 +69,33 @@ public struct SyntaxMap { Returns the range of the last contiguous comment-like block from the tokens in `self` prior to `offset`. - :param: offset Last possible byte offset of the range's start. + - parameter offset: Last possible byte offset of the range's start. */ public func commentRangeBeforeOffset(offset: Int) -> (start: Int, length: Int)? { let tokensBeforeOffset = tokens.filter { $0.offset < offset } let commentTokensImmediatelyPrecedingOffset = filterLastContiguous(tokensBeforeOffset) { SyntaxKind.isCommentLike($0.type) } - return flatMap(commentTokensImmediatelyPrecedingOffset.first) { firstToken in - return map(commentTokensImmediatelyPrecedingOffset.last) { lastToken in + return commentTokensImmediatelyPrecedingOffset.first.flatMap { firstToken in + return commentTokensImmediatelyPrecedingOffset.last.map { lastToken in return (firstToken.offset, lastToken.offset + lastToken.length - firstToken.offset) } } } } -// MARK: Printable +// MARK: CustomStringConvertible -extension SyntaxMap: Printable { +extension SyntaxMap: CustomStringConvertible { /// A textual JSON representation of `SyntaxMap`. public var description: String { - if let jsonData = NSJSONSerialization.dataWithJSONObject(tokens.map { $0.dictionaryValue }, - options: .PrettyPrinted, - error: nil) { + do { + let jsonData = try NSJSONSerialization.dataWithJSONObject(tokens.map { $0.dictionaryValue }, + options: .PrettyPrinted) if let jsonString = NSString(data: jsonData, encoding: NSUTF8StringEncoding) as String? { return jsonString } - } + } catch {} return "[\n\n]" // Empty JSON Array } } @@ -107,13 +107,16 @@ extension SyntaxMap: Equatable {} /** Returns true if `lhs` SyntaxMap is equal to `rhs` SyntaxMap. -:param: lhs SyntaxMap to compare to `rhs`. -:param: rhs SyntaxMap to compare to `lhs`. +- parameter lhs: SyntaxMap to compare to `rhs`. +- parameter rhs: SyntaxMap to compare to `lhs`. -:returns: True if `lhs` SyntaxMap is equal to `rhs` SyntaxMap. +- returns: True if `lhs` SyntaxMap is equal to `rhs` SyntaxMap. */ public func ==(lhs: SyntaxMap, rhs: SyntaxMap) -> Bool { - for (index, value) in enumerate(lhs.tokens) { + if lhs.tokens.count != rhs.tokens.count { + return false + } + for (index, value) in lhs.tokens.enumerate() { if rhs.tokens[index] != value { return false } diff --git a/Source/SourceKittenFramework/SyntaxToken.swift b/Source/SourceKittenFramework/SyntaxToken.swift index b2c605823..a9796df39 100644 --- a/Source/SourceKittenFramework/SyntaxToken.swift +++ b/Source/SourceKittenFramework/SyntaxToken.swift @@ -23,9 +23,9 @@ public struct SyntaxToken { /** Create a SyntaxToken by directly passing in its property values. - :param: type Token type. See SyntaxKind. - :param: offset Token offset. - :param: length Token length. + - parameter type: Token type. See SyntaxKind. + - parameter offset: Token offset. + - parameter length: Token length. */ public init(type: String, offset: Int, length: Int) { self.type = type @@ -41,18 +41,18 @@ extension SyntaxToken: Equatable {} /** Returns true if `lhs` SyntaxToken is equal to `rhs` SyntaxToken. -:param: lhs SyntaxToken to compare to `rhs`. -:param: rhs SyntaxToken to compare to `lhs`. +- parameter lhs: SyntaxToken to compare to `rhs`. +- parameter rhs: SyntaxToken to compare to `lhs`. -:returns: True if `lhs` SyntaxToken is equal to `rhs` SyntaxToken. +- returns: True if `lhs` SyntaxToken is equal to `rhs` SyntaxToken. */ public func ==(lhs: SyntaxToken, rhs: SyntaxToken) -> Bool { return (lhs.type == rhs.type) && (lhs.offset == rhs.offset) && (lhs.length == rhs.length) } -// MARK: Printable +// MARK: CustomStringConvertible -extension SyntaxToken: Printable { +extension SyntaxToken: CustomStringConvertible { /// A textual JSON representation of `SyntaxToken`. public var description: String { return toJSON(dictionaryValue) } } diff --git a/Source/SourceKittenFramework/Xcode.swift b/Source/SourceKittenFramework/Xcode.swift new file mode 100644 index 000000000..8ef01b939 --- /dev/null +++ b/Source/SourceKittenFramework/Xcode.swift @@ -0,0 +1,166 @@ +// +// Xcode.swift +// SourceKitten +// +// Created by JP Simard on 7/15/15. +// Copyright © 2015 SourceKitten. All rights reserved. +// + +import Foundation + +/** +Run `xcodebuild clean build` along with any passed in build arguments. + +- parameter arguments: Arguments to pass to `xcodebuild`. +- parameter path: Path to run `xcodebuild` from. + +- returns: `xcodebuild`'s STDERR+STDOUT output combined. +*/ +internal func runXcodeBuild(arguments: [String], inPath path: String) -> String? { + fputs("Running xcodebuild\n", stderr) + + let task = NSTask() + task.launchPath = "/usr/bin/xcodebuild" + task.currentDirectoryPath = path + task.arguments = arguments + ["clean", "build", "CODE_SIGN_IDENTITY=", "CODE_SIGNING_REQUIRED=NO"] + + let pipe = NSPipe() + task.standardOutput = pipe + task.standardError = pipe + + task.launch() + + let file = pipe.fileHandleForReading + let xcodebuildOutput = NSString(data: file.readDataToEndOfFile(), encoding: NSUTF8StringEncoding) + file.closeFile() + + return xcodebuildOutput as String? +} + +/** +Parses likely module name from compiler or `xcodebuild` arguments. + +Will the following values, in this priority: module name, target name, scheme name. + +- parameter arguments: Compiler or `xcodebuild` arguments to parse. + +- returns: Module name if successful. +*/ +internal func moduleNameFromArguments(arguments: [String]) -> String? { + let flags = ["-module-name", "-target", "-scheme"] + for flag in flags { + if let flagIndex = arguments.indexOf(flag) { + if flagIndex + 1 < arguments.count { + return arguments[flagIndex + 1] + } + } + } + return nil +} + +/** +Partially filters compiler arguments from `xcodebuild` to something that SourceKit/Clang will accept. + +- parameter args: Compiler arguments, as parsed from `xcodebuild`. + +- returns: A tuple of partially filtered compiler arguments in `.0`, and whether or not there are + more flags to remove in `.1`. +*/ +private func partiallyFilterArguments(var args: [String]) -> ([String], Bool) { + var didRemove = false + let flagsToRemove = [ + "-output-file-map" + ] + for flag in flagsToRemove { + if let index = args.indexOf(flag) { + didRemove = true + args.removeAtIndex(index.successor()) + args.removeAtIndex(index) + } + } + return (args, didRemove) +} + +/** +Filters compiler arguments from `xcodebuild` to something that SourceKit/Clang will accept. + +- parameter args: Compiler arguments, as parsed from `xcodebuild`. + +- returns: Filtered compiler arguments. +*/ +private func filterArguments(var args: [String]) -> [String] { + args.extend(["-D", "DEBUG"]) + var shouldContinueToFilterArguments = true + while shouldContinueToFilterArguments { + (args, shouldContinueToFilterArguments) = partiallyFilterArguments(args) + } + return args.filter { + ![ + "-parseable-output", + "-incremental", + "-serialize-diagnostics", + "-emit-dependencies" + ].contains($0) + }.map { + if $0 == "-O" { + return "-Onone" + } else if $0 == "-DNDEBUG=1" { + return "-DDEBUG=1" + } + return $0 + } +} + +/** +Parses the compiler arguments needed to compile the `language` files. + +- parameter xcodebuildOutput: Output of `xcodebuild` to be parsed for compiler arguments. +- parameter language: Language to parse for. +- parameter moduleName: Name of the Module for which to extract compiler arguments. + +- returns: Compiler arguments, filtered for suitable use by SourceKit if `.Swift` or Clang if `.ObjC`. +*/ +internal func parseCompilerArguments(xcodebuildOutput: NSString, language: Language, moduleName: String?) -> [String]? { + let pattern: String + if language == .ObjC { + pattern = "/usr/bin/clang.*" + } else if let moduleName = moduleName { + pattern = "/usr/bin/swiftc.*-module-name \(moduleName) .*" + } else { + pattern = "/usr/bin/swiftc.*" + } + let regex = try! NSRegularExpression(pattern: pattern, options: []) // Safe to force try + let range = NSRange(location: 0, length: xcodebuildOutput.length) + + guard let regexMatch = regex.firstMatchInString(xcodebuildOutput as String, options: [], range: range) else { + return nil + } + + let escapedSpacePlaceholder = "\u{0}" + let args = filterArguments(xcodebuildOutput + .substringWithRange(regexMatch.range) + .stringByReplacingOccurrencesOfString("\\ ", withString: escapedSpacePlaceholder) + .componentsSeparatedByString(" ")) + + // Remove first argument (swiftc/clang) and re-add spaces in arguments + return (args[1.. (headerFiles: [String], xcodebuildArguments: [String]) { + var xcodebuildArguments = sourcekittenArguments + var headerFiles = [String]() + while let headerFile = xcodebuildArguments.first where headerFile.isObjectiveCHeaderFile() { + headerFiles.append(headerFile.absolutePathRepresentation()) + xcodebuildArguments.removeAtIndex(0) + } + return (headerFiles, xcodebuildArguments) +} diff --git a/Source/SourceKittenFramework/clang-c/BuildSystem.h b/Source/SourceKittenFramework/clang-c/BuildSystem.h index 0c551a220..13bce28fb 100644 --- a/Source/SourceKittenFramework/clang-c/BuildSystem.h +++ b/Source/SourceKittenFramework/clang-c/BuildSystem.h @@ -73,7 +73,7 @@ clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay, * * \param options is reserved, always pass 0. * \param out_buffer_ptr pointer to receive the buffer pointer, which should be - * disposed using \c free(). + * disposed using \c clang_free(). * \param out_buffer_size pointer to receive the buffer size. * \returns 0 for success, non-zero to indicate an error. */ @@ -82,6 +82,14 @@ clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options, char **out_buffer_ptr, unsigned *out_buffer_size); +/** + * \brief free memory allocated by libclang, such as the buffer returned by + * \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer(). + * + * \param buffer memory pointer to free. + */ +CINDEX_LINKAGE void clang_free(void *buffer); + /** * \brief Dispose a \c CXVirtualFileOverlay object. */ @@ -122,7 +130,7 @@ clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor, * * \param options is reserved, always pass 0. * \param out_buffer_ptr pointer to receive the buffer pointer, which should be - * disposed using \c free(). + * disposed using \c clang_free(). * \param out_buffer_size pointer to receive the buffer size. * \returns 0 for success, non-zero to indicate an error. */ diff --git a/Source/SourceKittenFramework/clang-c/Index.h b/Source/SourceKittenFramework/clang-c/Index.h index fc3abe41a..4c3d04cd3 100644 --- a/Source/SourceKittenFramework/clang-c/Index.h +++ b/Source/SourceKittenFramework/clang-c/Index.h @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 29 +#define CINDEX_VERSION_MINOR 30 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -2225,7 +2225,19 @@ enum CXCursorKind { */ CXCursor_OMPTeamsDirective = 253, - CXCursor_LastStmt = CXCursor_OMPTeamsDirective, + /** \brief OpenMP taskgroup directive. + */ + CXCursor_OMPTaskgroupDirective = 254, + + /** \brief OpenMP cancellation point directive. + */ + CXCursor_OMPCancellationPointDirective = 255, + + /** \brief OpenMP cancel directive. + */ + CXCursor_OMPCancelDirective = 256, + + CXCursor_LastStmt = CXCursor_OMPCancelDirective, /** * \brief Cursor that represents the translation unit itself. @@ -2276,7 +2288,12 @@ enum CXCursorKind { */ CXCursor_ModuleImportDecl = 600, CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl, - CXCursor_LastExtraDecl = CXCursor_ModuleImportDecl + CXCursor_LastExtraDecl = CXCursor_ModuleImportDecl, + + /** + * \brief A code completion overload candidate. + */ + CXCursor_OverloadCandidate = 700 }; /** @@ -2849,7 +2866,7 @@ enum CXCallingConv { CXCallingConv_X86Pascal = 5, CXCallingConv_AAPCS = 6, CXCallingConv_AAPCS_VFP = 7, - CXCallingConv_PnaclCall = 8, + /* Value 8 was PnaclCall, but it was never used, so it could safely be re-used. */ CXCallingConv_IntelOclBicc = 9, CXCallingConv_X86_64Win64 = 10, CXCallingConv_X86_64SysV = 11, @@ -2998,7 +3015,7 @@ CINDEX_LINKAGE int clang_Cursor_getNumTemplateArguments(CXCursor C); * respectively. */ CINDEX_LINKAGE enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind( - CXCursor C, unsigned i); + CXCursor C, unsigned I); /** * \brief Retrieve a CXType representing the type of a TemplateArgument of a @@ -3019,7 +3036,7 @@ CINDEX_LINKAGE enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind( * Invalid types will be returned for I == 1 or 2. */ CINDEX_LINKAGE CXType clang_Cursor_getTemplateArgumentType(CXCursor C, - unsigned i); + unsigned I); /** * \brief Retrieve the value of an Integral TemplateArgument (of a function @@ -3039,7 +3056,7 @@ CINDEX_LINKAGE CXType clang_Cursor_getTemplateArgumentType(CXCursor C, * For I == 0, this function's behavior is undefined. */ CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue(CXCursor C, - unsigned i); + unsigned I); /** * \brief Retrieve the value of an Integral TemplateArgument (of a function @@ -3059,7 +3076,7 @@ CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue(CXCursor C, * For I == 0, this function's behavior is undefined. */ CINDEX_LINKAGE unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue( - CXCursor C, unsigned i); + CXCursor C, unsigned I); /** * \brief Determine whether two CXTypes represent the same type. @@ -3276,6 +3293,28 @@ CINDEX_LINKAGE long long clang_Type_getSizeOf(CXType T); */ CINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S); +/** + * \brief Return the offset of the field represented by the Cursor. + * + * If the cursor is not a field declaration, -1 is returned. + * If the cursor semantic parent is not a record field declaration, + * CXTypeLayoutError_Invalid is returned. + * If the field's type declaration is an incomplete type, + * CXTypeLayoutError_Incomplete is returned. + * If the field's type declaration is a dependent type, + * CXTypeLayoutError_Dependent is returned. + * If the field's name S is not found, + * CXTypeLayoutError_InvalidFieldName is returned. + */ +CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField(CXCursor C); + +/** + * \brief Determine whether the given cursor represents an anonymous record + * declaration. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C); + + enum CXRefQualifierKind { /** \brief No ref-qualifier was provided. */ CXRefQualifier_None = 0, @@ -5601,7 +5640,7 @@ typedef enum { * reused after indexing is finished. Set to \c NULL if you do not require it. * * \returns 0 on success or if there were errors from which the compiler could - * recover. If there is a failure from which the there is no recovery, returns + * recover. If there is a failure from which there is no recovery, returns * a non-zero \c CXErrorCode. * * The rest of the parameters are the same as #clang_parseTranslationUnit. @@ -5632,7 +5671,7 @@ CINDEX_LINKAGE int clang_indexSourceFile(CXIndexAction, * * The parameters are the same as #clang_indexSourceFile. * - * \returns If there is a failure from which the there is no recovery, returns + * \returns If there is a failure from which there is no recovery, returns * non-zero, otherwise returns 0. */ CINDEX_LINKAGE int clang_indexTranslationUnit(CXIndexAction, @@ -5664,15 +5703,50 @@ CINDEX_LINKAGE CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc loc); /** - * @} + * \brief Visitor invoked for each field found by a traversal. + * + * This visitor function will be invoked for each field found by + * \c clang_Type_visitFields. Its first argument is the cursor being + * visited, its second argument is the client data provided to + * \c clang_Type_visitFields. + * + * The visitor should return one of the \c CXVisitorResult values + * to direct \c clang_Type_visitFields. + */ +typedef enum CXVisitorResult (*CXFieldVisitor)(CXCursor C, + CXClientData client_data); + +/** + * \brief Visit the fields of a particular type. + * + * This function visits all the direct fields of the given cursor, + * invoking the given \p visitor function with the cursors of each + * visited field. The traversal may be ended prematurely, if + * the visitor returns \c CXFieldVisit_Break. + * + * \param T the record type whose field may be visited. + * + * \param visitor the visitor function that will be invoked for each + * field of \p T. + * + * \param client_data pointer data supplied by the client, which will + * be passed to the visitor each time it is invoked. + * + * \returns a non-zero value if the traversal was terminated + * prematurely by the visitor returning \c CXFieldVisit_Break. */ +CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, + CXFieldVisitor visitor, + CXClientData client_data); + /** * @} */ -/* Include the comment API for compatibility. This will eventually go away. */ -#import +/** + * @} + */ #ifdef __cplusplus } diff --git a/Source/SourceKittenFramework/clang-c/Makefile b/Source/SourceKittenFramework/clang-c/Makefile new file mode 100644 index 000000000..b29e29ea1 --- /dev/null +++ b/Source/SourceKittenFramework/clang-c/Makefile @@ -0,0 +1,38 @@ +CLANG_LEVEL := ../.. +DIRS := + +include $(CLANG_LEVEL)/Makefile + +IntIncludeDir = $(DESTDIR)$(PROJ_internal_prefix)/include + +install-local:: + $(Echo) Installing Clang C API include files + $(Verb) $(MKDIR) $(IntIncludeDir) + $(Verb) if test -d "$(PROJ_SRC_DIR)" ; then \ + cd $(PROJ_SRC_DIR)/.. && \ + for hdr in `find clang-c -type f '!' '(' -name '*~' \ + -o -name '.#*' -o -name '*.in' -o -name '*.txt' \ + -o -name 'Makefile' -o -name '*.td' ')' -print \ + | grep -v CVS | grep -v .svn | grep -v .dir` ; do \ + instdir=`dirname "$(IntIncludeDir)/$$hdr"` ; \ + if test \! -d "$$instdir" ; then \ + $(EchoCmd) Making install directory $$instdir ; \ + $(MKDIR) $$instdir ;\ + fi ; \ + $(DataInstall) $$hdr $(IntIncludeDir)/$$hdr ; \ + done ; \ + fi +ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) + $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include/clang-c" ; then \ + cd $(PROJ_OBJ_ROOT)/tools/clang/include && \ + for hdr in `find clang-c -type f '!' '(' -name 'Makefile' ')' -print \ + | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \ + instdir=`dirname "$(IntIncludeDir)/$$hdr"` ; \ + if test \! -d "$$instdir" ; then \ + $(EchoCmd) Making install directory $$instdir ; \ + $(MKDIR) $$instdir ;\ + fi ; \ + $(DataInstall) $$hdr $(IntIncludeDir)/$$hdr ; \ + done ; \ + fi +endif diff --git a/Source/SourceKittenFramework/clang-c/module.modulemap b/Source/SourceKittenFramework/clang-c/module.modulemap new file mode 100644 index 000000000..95a59d623 --- /dev/null +++ b/Source/SourceKittenFramework/clang-c/module.modulemap @@ -0,0 +1,4 @@ +module Clang_C { + umbrella "." + module * { export * } +} diff --git a/Source/SourceKittenFramework/sourcekitd.swift b/Source/SourceKittenFramework/sourcekitd.swift index a4be5ffac..ac083eb1f 100644 --- a/Source/SourceKittenFramework/sourcekitd.swift +++ b/Source/SourceKittenFramework/sourcekitd.swift @@ -20,7 +20,7 @@ Cancel request /** Initialize the SourceKit XPC service. This should only be done once per session (as Xcode does). -:returns: ??? maybe 0 for success and 1 for failure? +- returns: ??? maybe 0 for success and 1 for failure? */ @asmname("sourcekitd_initialize") internal func sourcekitd_initialize() -> Int diff --git a/Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift b/Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift index 86db6488f..ec9815110 100644 --- a/Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift +++ b/Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift @@ -9,7 +9,7 @@ import SourceKittenFramework import XCTest -let fixturesDirectory = NSFileManager.defaultManager().currentDirectoryPath + "/Source/SourceKittenFrameworkTests/Fixtures/" +let fixturesDirectory = (__FILE__ as NSString).stringByDeletingLastPathComponent + "/Fixtures/" func sdkPath() -> String { let task = NSTask() diff --git a/Source/SourceKittenFrameworkTests/FileTests.swift b/Source/SourceKittenFrameworkTests/FileTests.swift new file mode 100644 index 000000000..7899154f3 --- /dev/null +++ b/Source/SourceKittenFrameworkTests/FileTests.swift @@ -0,0 +1,16 @@ +// +// FileTests.swift +// SourceKitten +// +// Created by JP Simard on 7/15/15. +// Copyright © 2015 SourceKitten. All rights reserved. +// + +import SourceKittenFramework +import XCTest + +class FileTests: XCTestCase { + func testUnreadablePath() { + XCTAssert(File(path: "/dev/null") == nil) + } +} diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json b/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json index 5cd79f11a..19f506805 100644 --- a/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json +++ b/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json @@ -1,5 +1,5 @@ { - "Bicycle.swift": { + "Bicycle.swift" : { "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.class", @@ -8,7 +8,7 @@ "key.doc.comment" : "🚲 A two-wheeled, human-powered mode of transportation.", "key.namelength" : 7, "key.doc.line" : 4, - "key.bodylength" : 2273, + "key.bodylength" : 2193, "key.length" : 7, "key.doc.column" : 14, "key.parsed_scope.end" : 89, @@ -35,7 +35,7 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 354, + "key.offset" : 334, "key.parsed_declaration" : "public enum Style", "key.doc.comment" : "Frame and construction style.\n\n- Road: For streets or trails.\n- Touring: For long journeys.\n- Cruiser: For casual trips around town.\n- Hybrid: For general-purpose transportation.", "key.namelength" : 5, @@ -46,12 +46,12 @@ "key.parsed_scope.end" : 15, "key.usr" : "s:OC7Bicycle7Bicycle5Style", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 354, + "key.nameoffset" : 334, "key.annotated_decl" : "public enum Style<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 13, "key.filepath" : "Bicycle.swift", - "key.bodyoffset" : 361, + "key.bodyoffset" : 341, "key.doc.declaration" : "public enum Style", "key.name" : "Style", "key.typename" : "Bicycle.Style.Type", @@ -61,21 +61,93 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "Style<\/Name>s:OC7Bicycle7Bicycle5Style<\/USR>public enum Style<\/Declaration>Frame and construction style.<\/Para><\/Abstract>]]><\/rawHTML>]]><\/rawHTML>Road: For streets or trails.]]><\/rawHTML>]]><\/rawHTML>Touring: For long journeys.]]><\/rawHTML>]]><\/rawHTML>Cruiser: For casual trips around town.]]><\/rawHTML>]]><\/rawHTML>Hybrid: For general-purpose transportation.]]><\/rawHTML>]]><\/rawHTML><\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "Style<\/Name>s:OC7Bicycle7Bicycle5Style<\/USR>public enum Style<\/Declaration>Frame and construction style.<\/Para><\/Abstract>Road: For streets or trails.<\/Para><\/Item>Touring: For long journeys.<\/Para><\/Item>Cruiser: For casual trips around town.<\/Para><\/Item>Hybrid: For general-purpose transportation.<\/Para><\/Item><\/List-Bullet><\/Discussion><\/Other>", "key.doc.name" : "Style", "key.substructure" : [ - + { + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 355, + "key.parsed_declaration" : "case Road, Touring, Cruiser, Hybrid", + "key.namelength" : 4, + "key.length" : 4, + "key.name" : "Road", + "key.typename" : "Bicycle.Style.Type -> Bicycle.Style", + "key.parsed_scope.end" : 14, + "key.usr" : "s:FOC7Bicycle7Bicycle5Style4RoadFMS1_S1_", + "key.nameoffset" : 355, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 14, + "key.filepath" : "Bicycle.swift" + }, + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 361, + "key.parsed_declaration" : "case Road, Touring, Cruiser, Hybrid", + "key.namelength" : 7, + "key.length" : 7, + "key.name" : "Touring", + "key.typename" : "Bicycle.Style.Type -> Bicycle.Style", + "key.parsed_scope.end" : 14, + "key.usr" : "s:FOC7Bicycle7Bicycle5Style7TouringFMS1_S1_", + "key.nameoffset" : 361, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 14, + "key.filepath" : "Bicycle.swift" + }, + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 370, + "key.parsed_declaration" : "case Road, Touring, Cruiser, Hybrid", + "key.namelength" : 7, + "key.length" : 7, + "key.name" : "Cruiser", + "key.typename" : "Bicycle.Style.Type -> Bicycle.Style", + "key.parsed_scope.end" : 14, + "key.usr" : "s:FOC7Bicycle7Bicycle5Style7CruiserFMS1_S1_", + "key.nameoffset" : 370, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 14, + "key.filepath" : "Bicycle.swift" + }, + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 379, + "key.parsed_declaration" : "case Road, Touring, Cruiser, Hybrid", + "key.namelength" : 6, + "key.length" : 6, + "key.name" : "Hybrid", + "key.typename" : "Bicycle.Style.Type -> Bicycle.Style", + "key.parsed_scope.end" : 14, + "key.usr" : "s:FOC7Bicycle7Bicycle5Style6HybridFMS1_S1_", + "key.nameoffset" : 379, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 14, + "key.filepath" : "Bicycle.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 350, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 35 + } ], "key.doc.usr" : "s:OC7Bicycle7Bicycle5Style", "key.doc.discussion" : [ { - "Para" : "
  • Road: For streets or trails.<\/li>
  • Touring: For long journeys.<\/li>
  • Cruiser: For casual trips around town.<\/li>
  • Hybrid: For general-purpose transportation.<\/li><\/ul>" + "List-Bullet" : "" } ] }, { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 601, + "key.offset" : 569, "key.parsed_declaration" : "public enum Gearing", "key.doc.comment" : "Mechanism for converting pedal power into motion.\n\n- Fixed: A single, fixed gear.\n- Freewheel: A variable-speed, disengageable gear.", "key.namelength" : 7, @@ -86,12 +158,12 @@ "key.parsed_scope.end" : 26, "key.usr" : "s:OC7Bicycle7Bicycle7Gearing", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 601, + "key.nameoffset" : 569, "key.annotated_decl" : "public enum Gearing<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 23, "key.filepath" : "Bicycle.swift", - "key.bodyoffset" : 610, + "key.bodyoffset" : 578, "key.doc.declaration" : "public enum Gearing", "key.name" : "Gearing", "key.typename" : "Bicycle.Gearing.Type", @@ -101,21 +173,70 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "Gearing<\/Name>s:OC7Bicycle7Bicycle7Gearing<\/USR>public enum Gearing<\/Declaration>Mechanism for converting pedal power into motion.<\/Para><\/Abstract>]]><\/rawHTML>]]><\/rawHTML>Fixed: A single, fixed gear.]]><\/rawHTML>]]><\/rawHTML>Freewheel: A variable-speed, disengageable gear.]]><\/rawHTML>]]><\/rawHTML><\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "Gearing<\/Name>s:OC7Bicycle7Bicycle7Gearing<\/USR>public enum Gearing<\/Declaration>Mechanism for converting pedal power into motion.<\/Para><\/Abstract>Fixed: A single, fixed gear.<\/Para><\/Item>Freewheel: A variable-speed, disengageable gear.<\/Para><\/Item><\/List-Bullet><\/Discussion><\/Other>", "key.doc.name" : "Gearing", "key.substructure" : [ - + { + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 592, + "key.parsed_declaration" : "case Fixed", + "key.namelength" : 5, + "key.length" : 5, + "key.name" : "Fixed", + "key.typename" : "Bicycle.Gearing.Type -> Bicycle.Gearing", + "key.parsed_scope.end" : 24, + "key.usr" : "s:FOC7Bicycle7Bicycle7Gearing5FixedFMS1_S1_", + "key.nameoffset" : 592, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 24, + "key.filepath" : "Bicycle.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 587, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 10 + }, + { + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 611, + "key.parsed_declaration" : "case Freewheel(speeds: Int)", + "key.namelength" : 9, + "key.length" : 9, + "key.name" : "Freewheel", + "key.typename" : "Bicycle.Gearing.Type -> (speeds: Int) -> Bicycle.Gearing", + "key.parsed_scope.end" : 25, + "key.usr" : "s:FOC7Bicycle7Bicycle7Gearing9FreewheelFMS1_FT6speedsSi_S1_", + "key.nameoffset" : 611, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 25, + "key.filepath" : "Bicycle.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 606, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 27 + } ], "key.doc.usr" : "s:OC7Bicycle7Bicycle7Gearing", "key.doc.discussion" : [ { - "Para" : "
    • Fixed: A single, fixed gear.<\/li>
    • Freewheel: A variable-speed, disengageable gear.<\/li><\/ul>" + "List-Bullet" : "" } ] }, { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 889, + "key.offset" : 837, "key.parsed_declaration" : "enum Handlebar", "key.doc.comment" : "Hardware used for steering.\n\n- Riser: A casual handlebar.\n- Café: An upright handlebar.\n- Drop: A classic handlebar.\n- Bullhorn: A powerful handlebar.", "key.namelength" : 9, @@ -126,12 +247,12 @@ "key.parsed_scope.end" : 38, "key.usr" : "s:OC7Bicycle7Bicycle9Handlebar", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 889, + "key.nameoffset" : 837, "key.annotated_decl" : "enum Handlebar<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 36, "key.filepath" : "Bicycle.swift", - "key.bodyoffset" : 900, + "key.bodyoffset" : 848, "key.doc.declaration" : "enum Handlebar", "key.name" : "Handlebar", "key.typename" : "Bicycle.Handlebar.Type", @@ -141,137 +262,194 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "Handlebar<\/Name>s:OC7Bicycle7Bicycle9Handlebar<\/USR>enum Handlebar<\/Declaration>Hardware used for steering.<\/Para><\/Abstract>]]><\/rawHTML>]]><\/rawHTML>Riser: A casual handlebar.]]><\/rawHTML>]]><\/rawHTML>Café: An upright handlebar.]]><\/rawHTML>]]><\/rawHTML>Drop: A classic handlebar.]]><\/rawHTML>]]><\/rawHTML>Bullhorn: A powerful handlebar.]]><\/rawHTML>]]><\/rawHTML><\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "Handlebar<\/Name>s:OC7Bicycle7Bicycle9Handlebar<\/USR>enum Handlebar<\/Declaration>Hardware used for steering.<\/Para><\/Abstract>Riser: A casual handlebar.<\/Para><\/Item>Café: An upright handlebar.<\/Para><\/Item>Drop: A classic handlebar.<\/Para><\/Item>Bullhorn: A powerful handlebar.<\/Para><\/Item><\/List-Bullet><\/Discussion><\/Other>", "key.doc.name" : "Handlebar", "key.substructure" : [ - + { + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 862, + "key.parsed_declaration" : "case Riser, Café, Drop, Bullhorn", + "key.namelength" : 5, + "key.length" : 5, + "key.name" : "Riser", + "key.typename" : "Bicycle.Handlebar.Type -> Bicycle.Handlebar", + "key.parsed_scope.end" : 37, + "key.usr" : "s:FOC7Bicycle7Bicycle9Handlebar5RiserFMS1_S1_", + "key.nameoffset" : 862, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 37, + "key.filepath" : "Bicycle.swift" + }, + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 869, + "key.parsed_declaration" : "case Riser, Café, Drop, Bullhorn", + "key.namelength" : 5, + "key.length" : 5, + "key.name" : "Café", + "key.typename" : "Bicycle.Handlebar.Type -> Bicycle.Handlebar", + "key.parsed_scope.end" : 37, + "key.usr" : "s:FOC7Bicycle7Bicycle9HandlebarX7Caf_dmaFMS1_S1_", + "key.nameoffset" : 869, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 37, + "key.filepath" : "Bicycle.swift" + }, + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 876, + "key.parsed_declaration" : "case Riser, Café, Drop, Bullhorn", + "key.namelength" : 4, + "key.length" : 4, + "key.name" : "Drop", + "key.typename" : "Bicycle.Handlebar.Type -> Bicycle.Handlebar", + "key.parsed_scope.end" : 37, + "key.usr" : "s:FOC7Bicycle7Bicycle9Handlebar4DropFMS1_S1_", + "key.nameoffset" : 876, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 37, + "key.filepath" : "Bicycle.swift" + }, + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 882, + "key.parsed_declaration" : "case Riser, Café, Drop, Bullhorn", + "key.namelength" : 8, + "key.length" : 8, + "key.name" : "Bullhorn", + "key.typename" : "Bicycle.Handlebar.Type -> Bicycle.Handlebar", + "key.parsed_scope.end" : 37, + "key.usr" : "s:FOC7Bicycle7Bicycle9Handlebar8BullhornFMS1_S1_", + "key.nameoffset" : 882, + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.parsed_scope.start" : 37, + "key.filepath" : "Bicycle.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 857, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 33 + } ], "key.doc.usr" : "s:OC7Bicycle7Bicycle9Handlebar", "key.doc.discussion" : [ { - "Para" : "
      • Riser: A casual handlebar.<\/li>
      • Café: An upright handlebar.<\/li>
      • Drop: A classic handlebar.<\/li>
      • Bullhorn: A powerful handlebar.<\/li><\/ul>" + "List-Bullet" : "" } ] }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 992, + "key.offset" : 940, "key.parsed_declaration" : "let style: Style", "key.doc.comment" : "The style of the bicycle.", "key.namelength" : 5, "key.doc.line" : 41, "key.length" : 5, + "key.doc.declaration" : "let style: Bicycle.Bicycle.Style", + "key.typename" : "Bicycle.Style", + "key.name" : "style", "key.doc.column" : 9, "key.parsed_scope.end" : 41, "key.usr" : "s:vC7Bicycle7Bicycle5styleOS0_5Style", - "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 992, - "key.annotated_decl" : "let style: Bicycle<\/Type>.Style<\/Type><\/Declaration>", - "key.accessibility" : "source.lang.swift.accessibility.internal", - "key.parsed_scope.start" : 41, - "key.filepath" : "Bicycle.swift", - "key.doc.declaration" : "let style: Bicycle.Style", - "key.typename" : "Bicycle.Style", - "key.name" : "style", "key.doc.type" : "Other", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "style<\/Name>s:vC7Bicycle7Bicycle5styleOS0_5Style<\/USR>let style: Bicycle.Style<\/Declaration>The style of the bicycle.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "style<\/Name>s:vC7Bicycle7Bicycle5styleOS0_5Style<\/USR>let style: Bicycle.Bicycle.Style<\/Declaration>The style of the bicycle.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 940, + "key.doc.file" : "Bicycle.swift", + "key.annotated_decl" : "let style: Bicycle<\/Type>.Style<\/Type><\/Declaration>", "key.doc.name" : "style", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vC7Bicycle7Bicycle5styleOS0_5Style" + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:vC7Bicycle7Bicycle5styleOS0_5Style", + "key.parsed_scope.start" : 41, + "key.filepath" : "Bicycle.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1050, + "key.offset" : 998, "key.parsed_declaration" : "let gearing: Gearing", "key.doc.comment" : "The gearing of the bicycle.", "key.namelength" : 7, "key.doc.line" : 44, "key.length" : 7, + "key.doc.declaration" : "let gearing: Bicycle.Bicycle.Gearing", + "key.typename" : "Bicycle.Gearing", + "key.name" : "gearing", "key.doc.column" : 9, "key.parsed_scope.end" : 44, "key.usr" : "s:vC7Bicycle7Bicycle7gearingOS0_7Gearing", - "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 1050, - "key.annotated_decl" : "let gearing: Bicycle<\/Type>.Gearing<\/Type><\/Declaration>", - "key.accessibility" : "source.lang.swift.accessibility.internal", - "key.parsed_scope.start" : 44, - "key.filepath" : "Bicycle.swift", - "key.doc.declaration" : "let gearing: Bicycle.Gearing", - "key.typename" : "Bicycle.Gearing", - "key.name" : "gearing", "key.doc.type" : "Other", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "gearing<\/Name>s:vC7Bicycle7Bicycle7gearingOS0_7Gearing<\/USR>let gearing: Bicycle.Gearing<\/Declaration>The gearing of the bicycle.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "gearing<\/Name>s:vC7Bicycle7Bicycle7gearingOS0_7Gearing<\/USR>let gearing: Bicycle.Bicycle.Gearing<\/Declaration>The gearing of the bicycle.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 998, + "key.doc.file" : "Bicycle.swift", + "key.annotated_decl" : "let gearing: Bicycle<\/Type>.Gearing<\/Type><\/Declaration>", "key.doc.name" : "gearing", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vC7Bicycle7Bicycle7gearingOS0_7Gearing" + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:vC7Bicycle7Bicycle7gearingOS0_7Gearing", + "key.parsed_scope.start" : 44, + "key.filepath" : "Bicycle.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1114, + "key.offset" : 1062, "key.parsed_declaration" : "let handlebar: Handlebar", "key.doc.comment" : "The handlebar of the bicycle.", "key.namelength" : 9, "key.doc.line" : 47, "key.length" : 9, + "key.doc.declaration" : "let handlebar: Bicycle.Bicycle.Handlebar", + "key.typename" : "Bicycle.Handlebar", + "key.name" : "handlebar", "key.doc.column" : 9, "key.parsed_scope.end" : 47, "key.usr" : "s:vC7Bicycle7Bicycle9handlebarOS0_9Handlebar", - "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 1114, - "key.annotated_decl" : "let handlebar: Bicycle<\/Type>.Handlebar<\/Type><\/Declaration>", - "key.accessibility" : "source.lang.swift.accessibility.internal", - "key.parsed_scope.start" : 47, - "key.filepath" : "Bicycle.swift", - "key.doc.declaration" : "let handlebar: Bicycle.Handlebar", - "key.typename" : "Bicycle.Handlebar", - "key.name" : "handlebar", "key.doc.type" : "Other", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "handlebar<\/Name>s:vC7Bicycle7Bicycle9handlebarOS0_9Handlebar<\/USR>let handlebar: Bicycle.Handlebar<\/Declaration>The handlebar of the bicycle.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "handlebar<\/Name>s:vC7Bicycle7Bicycle9handlebarOS0_9Handlebar<\/USR>let handlebar: Bicycle.Bicycle.Handlebar<\/Declaration>The handlebar of the bicycle.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 1062, + "key.doc.file" : "Bicycle.swift", + "key.annotated_decl" : "let handlebar: Bicycle<\/Type>.Handlebar<\/Type><\/Declaration>", "key.doc.name" : "handlebar", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vC7Bicycle7Bicycle9handlebarOS0_9Handlebar" + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:vC7Bicycle7Bicycle9handlebarOS0_9Handlebar", + "key.parsed_scope.start" : 47, + "key.filepath" : "Bicycle.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1191, + "key.offset" : 1139, "key.parsed_declaration" : "let frameSize: Int", "key.doc.comment" : "The size of the frame, in centimeters.", "key.namelength" : 9, "key.doc.line" : 50, "key.length" : 9, - "key.doc.column" : 9, - "key.parsed_scope.end" : 50, - "key.usr" : "s:vC7Bicycle7Bicycle9frameSizeSi", - "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 1191, - "key.annotated_decl" : "let frameSize: Int<\/Type><\/Declaration>", - "key.accessibility" : "source.lang.swift.accessibility.internal", - "key.parsed_scope.start" : 50, - "key.filepath" : "Bicycle.swift", "key.doc.declaration" : "let frameSize: Int", "key.typename" : "Int", "key.name" : "frameSize", + "key.doc.column" : 9, + "key.parsed_scope.end" : 50, + "key.usr" : "s:vC7Bicycle7Bicycle9frameSizeSi", "key.doc.type" : "Other", "key.attributes" : [ { @@ -279,15 +457,18 @@ } ], "key.doc.full_as_xml" : "frameSize<\/Name>s:vC7Bicycle7Bicycle9frameSizeSi<\/USR>let frameSize: Int<\/Declaration>The size of the frame, in centimeters.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 1139, + "key.doc.file" : "Bicycle.swift", + "key.annotated_decl" : "let frameSize: Int<\/Type><\/Declaration>", "key.doc.name" : "frameSize", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vC7Bicycle7Bicycle9frameSizeSi" + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:vC7Bicycle7Bicycle9frameSizeSi", + "key.parsed_scope.start" : 50, + "key.filepath" : "Bicycle.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1282, + "key.offset" : 1230, "key.parsed_declaration" : "private(set) var numberOfTrips: Int", "key.doc.comment" : "The number of trips travelled by the bicycle.", "key.namelength" : 13, @@ -297,7 +478,7 @@ "key.parsed_scope.end" : 53, "key.usr" : "s:vC7Bicycle7Bicycle13numberOfTripsSi", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 1282, + "key.nameoffset" : 1230, "key.annotated_decl" : "private(set) var numberOfTrips: Int<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 53, @@ -313,15 +494,12 @@ ], "key.doc.full_as_xml" : "numberOfTrips<\/Name>s:vC7Bicycle7Bicycle13numberOfTripsSi<\/USR>private(set) var numberOfTrips: Int<\/Declaration>The number of trips travelled by the bicycle.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "numberOfTrips", - "key.substructure" : [ - - ], "key.setter_accessibility" : "source.lang.swift.accessibility.private", "key.doc.usr" : "s:vC7Bicycle7Bicycle13numberOfTripsSi" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1387, + "key.offset" : 1335, "key.parsed_declaration" : "private(set) var distanceTravelled: Double", "key.doc.comment" : "The total distance travelled by the bicycle, in meters.", "key.namelength" : 17, @@ -331,7 +509,7 @@ "key.parsed_scope.end" : 56, "key.usr" : "s:vC7Bicycle7Bicycle17distanceTravelledSd", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 1387, + "key.nameoffset" : 1335, "key.annotated_decl" : "private(set) var distanceTravelled: Double<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 56, @@ -347,20 +525,17 @@ ], "key.doc.full_as_xml" : "distanceTravelled<\/Name>s:vC7Bicycle7Bicycle17distanceTravelledSd<\/USR>private(set) var distanceTravelled: Double<\/Declaration>The total distance travelled by the bicycle, in meters.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "distanceTravelled", - "key.substructure" : [ - - ], "key.setter_accessibility" : "source.lang.swift.accessibility.private", "key.doc.usr" : "s:vC7Bicycle7Bicycle17distanceTravelledSd" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 1809, + "key.offset" : 1754, "key.parsed_declaration" : "init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int)", - "key.doc.comment" : "Initializes a new bicycle with the provided parts and specifications.\n\n:param: style The style of the bicycle\n:param: gearing The gearing of the bicycle\n:param: handlebar The handlebar of the bicycle\n:param: centimeters The frame size of the bicycle, in centimeters\n\n:returns: A beautiful, brand-new, custom built just for you.", + "key.doc.comment" : "Initializes a new bicycle with the provided parts and specifications.\n\n- parameter style: The style of the bicycle\n- parameter gearing: The gearing of the bicycle\n- parameter handlebar: The handlebar of the bicycle\n- parameter centimeters: The frame size of the bicycle, in centimeters\n\n- returns: A beautiful, brand-new, custom built just for you.", "key.namelength" : 86, "key.doc.line" : 68, - "key.bodylength" : 204, + "key.bodylength" : 192, "key.length" : 86, "key.doc.parameters" : [ { @@ -400,12 +575,12 @@ "key.parsed_scope.end" : 76, "key.usr" : "s:FC7Bicycle7BicyclecFMS0_FT5styleOS0_5Style7gearingOS0_7Gearing9handlebarOS0_9Handlebar9frameSizeSi_S0_", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 1809, + "key.nameoffset" : 1754, "key.annotated_decl" : "init(style: Style<\/Type>, gearing: Gearing<\/Type>, handlebar: Handlebar<\/Type>, frameSize centimeters: Int<\/Type>)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 68, "key.filepath" : "Bicycle.swift", - "key.bodyoffset" : 1897, + "key.bodyoffset" : 1842, "key.doc.declaration" : "init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int)", "key.name" : "init(style:gearing:handlebar:frameSize:)", "key.typename" : "Bicycle.Type -> (style: Bicycle.Style, gearing: Bicycle.Gearing, handlebar: Bicycle.Handlebar, frameSize: Int) -> Bicycle", @@ -429,12 +604,12 @@ }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2222, + "key.offset" : 2152, "key.parsed_declaration" : "func travel(distance meters: Double)", - "key.doc.comment" : "Take a bike out for a spin.\n\n:param: meters The distance to travel in meters.", + "key.doc.comment" : "Take a bike out for a spin.\n\n- parameter meters: The distance to travel in meters.", "key.namelength" : 31, "key.doc.line" : 83, - "key.bodylength" : 119, + "key.bodylength" : 109, "key.length" : 31, "key.doc.parameters" : [ { @@ -450,12 +625,12 @@ "key.parsed_scope.end" : 88, "key.usr" : "s:FC7Bicycle7Bicycle6travelFS0_FT8distanceSd_T_", "key.doc.file" : "Bicycle.swift", - "key.nameoffset" : 2222, + "key.nameoffset" : 2152, "key.annotated_decl" : "func travel(distance meters: Double<\/Type>)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 83, "key.filepath" : "Bicycle.swift", - "key.bodyoffset" : 2255, + "key.bodyoffset" : 2185, "key.doc.declaration" : "func travel(distance meters: Double)", "key.name" : "travel(distance:)", "key.typename" : "Bicycle -> (distance: Double) -> ()", @@ -478,6 +653,6 @@ ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 2378 + "key.length" : 2298 } } diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.swift b/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.swift index 8ec84a344..f0ed580d1 100644 --- a/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.swift +++ b/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.swift @@ -3,22 +3,22 @@ import Foundation /// 🚲 A two-wheeled, human-powered mode of transportation. public class Bicycle { /** - Frame and construction style. + Frame and construction style. - - Road: For streets or trails. - - Touring: For long journeys. - - Cruiser: For casual trips around town. - - Hybrid: For general-purpose transportation. + - Road: For streets or trails. + - Touring: For long journeys. + - Cruiser: For casual trips around town. + - Hybrid: For general-purpose transportation. */ public enum Style { case Road, Touring, Cruiser, Hybrid } /** - Mechanism for converting pedal power into motion. + Mechanism for converting pedal power into motion. - - Fixed: A single, fixed gear. - - Freewheel: A variable-speed, disengageable gear. + - Fixed: A single, fixed gear. + - Freewheel: A variable-speed, disengageable gear. */ public enum Gearing { case Fixed @@ -26,12 +26,12 @@ public class Bicycle { } /** - Hardware used for steering. + Hardware used for steering. - - Riser: A casual handlebar. - - Café: An upright handlebar. - - Drop: A classic handlebar. - - Bullhorn: A powerful handlebar. + - Riser: A casual handlebar. + - Café: An upright handlebar. + - Drop: A classic handlebar. + - Bullhorn: A powerful handlebar. */ enum Handlebar { case Riser, Café, Drop, Bullhorn @@ -56,14 +56,14 @@ public class Bicycle { private(set) var distanceTravelled: Double /** - Initializes a new bicycle with the provided parts and specifications. + Initializes a new bicycle with the provided parts and specifications. - :param: style The style of the bicycle - :param: gearing The gearing of the bicycle - :param: handlebar The handlebar of the bicycle - :param: centimeters The frame size of the bicycle, in centimeters + - parameter style: The style of the bicycle + - parameter gearing: The gearing of the bicycle + - parameter handlebar: The handlebar of the bicycle + - parameter centimeters: The frame size of the bicycle, in centimeters - :returns: A beautiful, brand-new, custom built just for you. + - returns: A beautiful, brand-new, custom built just for you. */ init(style: Style, gearing: Gearing, handlebar: Handlebar, frameSize centimeters: Int) { self.style = style @@ -71,19 +71,19 @@ public class Bicycle { self.handlebar = handlebar self.frameSize = centimeters - self.numberOfTrips = 0 - self.distanceTravelled = 0.0 + numberOfTrips = 0 + distanceTravelled = 0 } /** - Take a bike out for a spin. + Take a bike out for a spin. - :param: meters The distance to travel in meters. + - parameter meters: The distance to travel in meters. */ func travel(distance meters: Double) { if meters > 0.0 { - self.distanceTravelled += meters - self.numberOfTrips++ + distanceTravelled += meters + numberOfTrips++ } } } diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Commandant.json b/Source/SourceKittenFrameworkTests/Fixtures/Commandant.json index 5ab5dc25f..ce426d619 100644 --- a/Source/SourceKittenFrameworkTests/Fixtures/Commandant.json +++ b/Source/SourceKittenFrameworkTests/Fixtures/Commandant.json @@ -3,23 +3,30 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.struct", - "key.offset" : 567, + "key.offset" : 565, "key.parsed_declaration" : "public struct HelpCommand: CommandType", "key.doc.comment" : "A basic implementation of a `help` command, using information available in a\n`CommandRegistry`.\n\nIf you want to use this command, initialize it with the registry, then add\nit to that same registry:\n\n\tlet commands: CommandRegistry = …\n\tlet helpCommand = HelpCommand(registry: commands)\n\tcommands.register(helpCommand)", "key.namelength" : 11, "key.doc.line" : 21, - "key.bodylength" : 1156, + "key.bodylength" : 1168, "key.length" : 11, "key.doc.column" : 15, - "key.parsed_scope.end" : 62, + "key.parsed_scope.end" : 61, "key.usr" : "s:V10Commandant11HelpCommand", "key.doc.file" : "Commandant\/HelpCommand.swift", - "key.nameoffset" : 567, + "key.nameoffset" : 565, "key.annotated_decl" : "public struct HelpCommand<ClientError> : CommandType<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 591, + "key.length" : 11 + } + ], "key.parsed_scope.start" : 21, "key.filepath" : "Commandant\/HelpCommand.swift", - "key.bodyoffset" : 606, + "key.bodyoffset" : 604, "key.doc.declaration" : "public struct HelpCommand : CommandType", "key.name" : "HelpCommand", "key.typename" : "HelpCommand.Type", @@ -29,7 +36,7 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "HelpCommand<\/Name>s:V10Commandant11HelpCommand<\/USR>public struct HelpCommand<ClientError> : CommandType<\/Declaration>A basic implementation of a ]]><\/rawHTML>help]]><\/rawHTML> command, using information available in a\n`CommandRegistry`.<\/Para><\/Abstract>If you want to use this command, initialize it with the registry, then add\nit to that same registry:<\/Para>let commands: CommandRegistry<MyErrorType> = …\nlet helpCommand = HelpCommand(registry: commands)\ncommands.register(helpCommand)<\/Verbatim><\/Discussion><\/Class>", + "key.doc.full_as_xml" : "HelpCommand<\/Name>s:V10Commandant11HelpCommand<\/USR>public struct HelpCommand<ClientError> : CommandType<\/Declaration>A basic implementation of a help<\/codeVoice> command, using information available in a CommandRegistry<\/codeVoice>.<\/Para><\/Abstract>If you want to use this command, initialize it with the registry, then add it to that same registry:<\/Para> = …]]><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/CodeListing><\/Discussion><\/Class>", "key.doc.name" : "HelpCommand", "key.inheritedtypes" : [ { @@ -39,74 +46,65 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 619, + "key.offset" : 617, "key.parsed_declaration" : "public let verb = \"help\"", "key.namelength" : 4, "key.length" : 4, "key.typename" : "String", "key.name" : "verb", "key.parsed_scope.end" : 22, - "key.usr" : "s:vV10Commandant11HelpCommand4verbSS", "key.overrides" : [ { "key.usr" : "s:vP10Commandant11CommandType4verbSS" } ], - "key.nameoffset" : 619, + "key.usr" : "s:vV10Commandant11HelpCommand4verbSS", + "key.nameoffset" : 617, "key.annotated_decl" : "public let verb: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 22, "key.filepath" : "Commandant\/HelpCommand.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 645, + "key.offset" : 643, "key.parsed_declaration" : "public let function = \"Display general or command-specific help\"", "key.namelength" : 8, "key.length" : 8, "key.typename" : "String", "key.name" : "function", "key.parsed_scope.end" : 23, - "key.usr" : "s:vV10Commandant11HelpCommand8functionSS", "key.overrides" : [ { "key.usr" : "s:vP10Commandant11CommandType8functionSS" } ], - "key.nameoffset" : 645, + "key.usr" : "s:vV10Commandant11HelpCommand8functionSS", + "key.nameoffset" : 643, "key.annotated_decl" : "public let function: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 23, "key.filepath" : "Commandant\/HelpCommand.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 713, + "key.offset" : 711, "key.parsed_declaration" : "private let registry: CommandRegistry", "key.namelength" : 8, "key.length" : 8, "key.typename" : "CommandRegistry", "key.name" : "registry", "key.parsed_scope.end" : 25, - "key.usr" : "s:vV10Commandant11HelpCommandP33_38F61CE0DF9D73793CEDF5D1C31403318registryGCS_15CommandRegistryQ__", - "key.nameoffset" : 713, + "key.usr" : "s:vV10Commandant11HelpCommandP33_38F61CE0DF9D73793CEDF5D1C31403318registryGCS_15CommandRegistryq__", + "key.nameoffset" : 711, "key.annotated_decl" : "private let registry: CommandRegistry<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 25, "key.filepath" : "Commandant\/HelpCommand.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 848, + "key.offset" : 846, "key.parsed_declaration" : "public init(registry: CommandRegistry)", "key.doc.comment" : "Initializes the command to provide help from the given registry of\ncommands.", "key.namelength" : 44, @@ -115,14 +113,14 @@ "key.length" : 44, "key.doc.column" : 9, "key.parsed_scope.end" : 31, - "key.usr" : "s:FV10Commandant11HelpCommandcU__FMGS0_Q__FT8registryGCS_15CommandRegistryQ___GS0_Q__", + "key.usr" : "s:FV10Commandant11HelpCommandcurFMGS0_q__FT8registryGCS_15CommandRegistryq___GS0_q__", "key.doc.file" : "Commandant\/HelpCommand.swift", - "key.nameoffset" : 848, + "key.nameoffset" : 846, "key.annotated_decl" : "public init(registry: CommandRegistry<\/Type><ClientError>)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 29, "key.filepath" : "Commandant\/HelpCommand.swift", - "key.bodyoffset" : 894, + "key.bodyoffset" : 892, "key.doc.declaration" : "public init(registry: CommandRegistry)", "key.name" : "init(registry:)", "key.typename" : " HelpCommand.Type -> (registry: CommandRegistry) -> HelpCommand", @@ -132,32 +130,32 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "init(registry:)<\/Name>s:FV10Commandant11HelpCommandcU__FMGS0_Q__FT8registryGCS_15CommandRegistryQ___GS0_Q__<\/USR>public init(registry: CommandRegistry<ClientError>)<\/Declaration>Initializes the command to provide help from the given registry of\ncommands.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "init(registry:)<\/Name>s:FV10Commandant11HelpCommandcurFMGS0_q__FT8registryGCS_15CommandRegistryq___GS0_q__<\/USR>public init(registry: CommandRegistry<ClientError>)<\/Declaration>Initializes the command to provide help from the given registry of commands.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "init(registry:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FV10Commandant11HelpCommandcU__FMGS0_Q__FT8registryGCS_15CommandRegistryQ___GS0_Q__" + "key.doc.usr" : "s:FV10Commandant11HelpCommandcurFMGS0_q__FT8registryGCS_15CommandRegistryq___GS0_q__" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 939, + "key.offset" : 937, "key.parsed_declaration" : "public func run(mode: CommandMode) -> Result<(), CommandantError>", "key.namelength" : 22, - "key.bodyoffset" : 1007, - "key.bodylength" : 753, + "key.bodyoffset" : 1005, + "key.bodylength" : 765, "key.length" : 22, "key.name" : "run(_:)", "key.typename" : " HelpCommand -> (CommandMode) -> Result<(), CommandantError>", - "key.parsed_scope.end" : 61, - "key.usr" : "s:FV10Commandant11HelpCommand3runU__FGS0_Q__FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQ___", + "key.parsed_scope.end" : 60, + "key.usr" : "s:FV10Commandant11HelpCommand3runurFGS0_q__FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorq___", "key.overrides" : [ { - "key.usr" : "s:FP10Commandant11CommandType3runUS0__U__FQPS0_FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQS1_11ClientError__" + "key.usr" : "s:FP10Commandant11CommandType3runuRq_S0__Fq_FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorqq_S0_11ClientError__" } ], - "key.nameoffset" : 939, - "key.annotated_decl" : "public func run(mode: CommandMode<\/Type>) -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 937, + "key.annotated_decl" : "public func run(mode: CommandMode<\/Type>) -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.substructure" : [ @@ -169,26 +167,26 @@ "key.doc.usr" : "s:V10Commandant11HelpCommand", "key.doc.discussion" : [ { - "Para" : "If you want to use this command, initialize it with the registry, then add\nit to that same registry:" + "Para" : "If you want to use this command, initialize it with the registry, then add it to that same registry:" }, { - "Verbatim" : "let commands: CommandRegistry = …\nlet helpCommand = HelpCommand(registry: commands)\ncommands.register(helpCommand)" + "CodeListing" : "" } ] }, { "key.kind" : "source.lang.swift.decl.struct", - "key.offset" : 1780, + "key.offset" : 1790, "key.parsed_declaration" : "private struct HelpOptions: OptionsType", "key.namelength" : 11, - "key.bodyoffset" : 1819, - "key.bodylength" : 361, + "key.bodyoffset" : 1829, + "key.bodylength" : 366, "key.length" : 11, "key.name" : "HelpOptions", "key.typename" : "HelpOptions.Type", - "key.parsed_scope.end" : 79, + "key.parsed_scope.end" : 78, "key.usr" : "s:V10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptions", - "key.nameoffset" : 1780, + "key.nameoffset" : 1790, "key.inheritedtypes" : [ { "key.name" : "OptionsType" @@ -199,106 +197,110 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1825, + "key.offset" : 1835, "key.parsed_declaration" : "let verb: String?", "key.namelength" : 4, "key.length" : 4, "key.typename" : "String?", "key.name" : "verb", - "key.parsed_scope.end" : 65, + "key.parsed_scope.end" : 64, "key.usr" : "s:vV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptions4verbGSqSS_", - "key.nameoffset" : 1825, + "key.nameoffset" : 1835, "key.annotated_decl" : "let verb: String<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", - "key.substructure" : [ - - ], - "key.parsed_scope.start" : 65, + "key.parsed_scope.start" : 64, "key.filepath" : "Commandant\/HelpCommand.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 1842, + "key.offset" : 1852, "key.parsed_declaration" : "init(verb: String?)", "key.namelength" : 19, - "key.bodyoffset" : 1863, + "key.bodyoffset" : 1873, "key.bodylength" : 21, "key.length" : 19, "key.name" : "init(verb:)", "key.typename" : " HelpOptions.Type -> (verb: String?) -> HelpOptions", - "key.parsed_scope.end" : 69, - "key.usr" : "s:FV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptionscU__FMGS0_Q__FT4verbGSqSS__GS0_Q__", - "key.nameoffset" : 1842, + "key.parsed_scope.end" : 68, + "key.usr" : "s:FV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptionscurFMGS0_q__FT4verbGSqSS__GS0_q__", + "key.nameoffset" : 1852, "key.annotated_decl" : "init(verb: String<\/Type>?)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", "key.substructure" : [ ], - "key.parsed_scope.start" : 67, + "key.parsed_scope.start" : 66, "key.filepath" : "Commandant\/HelpCommand.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.static", - "key.offset" : 1900, + "key.offset" : 1910, "key.parsed_declaration" : "static func create(verb: String) -> HelpOptions", "key.namelength" : 20, - "key.bodyoffset" : 1937, - "key.bodylength" : 49, + "key.bodyoffset" : 1947, + "key.bodylength" : 54, "key.length" : 20, "key.name" : "create(_:)", "key.typename" : " HelpOptions.Type -> (String) -> HelpOptions", - "key.parsed_scope.end" : 73, - "key.usr" : "s:ZFV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptions6createU__FMGS0_Q__FSSGS0_Q__", - "key.nameoffset" : 1900, + "key.parsed_scope.end" : 72, + "key.usr" : "s:ZFV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptions6createurFMGS0_q__FSSGS0_q__", + "key.nameoffset" : 1910, "key.annotated_decl" : "static func create(verb: String<\/Type>) -> HelpOptions<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", "key.substructure" : [ ], - "key.parsed_scope.start" : 71, + "key.parsed_scope.start" : 70, "key.filepath" : "Commandant\/HelpCommand.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.static", - "key.offset" : 2002, + "key.offset" : 2017, "key.parsed_declaration" : "static func evaluate(m: CommandMode) -> Result>", "key.namelength" : 24, - "key.bodyoffset" : 2081, + "key.bodyoffset" : 2096, "key.bodylength" : 97, "key.length" : 24, "key.name" : "evaluate(_:)", "key.typename" : " HelpOptions.Type -> (CommandMode) -> Result, CommandantError>", - "key.parsed_scope.end" : 78, - "key.usr" : "s:ZFV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptions8evaluateU__FMGS0_Q__FOS_11CommandModeGO8LlamaKit6ResultGS0_Q__GOS_15CommandantErrorQ___", + "key.parsed_scope.end" : 77, + "key.usr" : "s:ZFV10CommandantP33_38F61CE0DF9D73793CEDF5D1C314033111HelpOptions8evaluateurFMGS0_q__FOS_11CommandModeGO6Result6ResultGS0_q__GOS_15CommandantErrorq___", "key.overrides" : [ { - "key.usr" : "s:ZFP10Commandant11OptionsType8evaluateUS0__U__FMQPS0_FOS_11CommandModeGO8LlamaKit6ResultS1_GOS_15CommandantErrorQS1_11ClientError__" + "key.usr" : "s:ZFP10Commandant11OptionsType8evaluateuRq_S0__FMq_FOS_11CommandModeGO6Result6Resultq_GOS_15CommandantErrorqq_S0_11ClientError__" } ], - "key.nameoffset" : 2002, - "key.annotated_decl" : "static func evaluate(m: CommandMode<\/Type>) -> Result<\/Type><HelpOptions<\/Type><ClientError>, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 2017, + "key.annotated_decl" : "static func evaluate(m: CommandMode<\/Type>) -> Result<\/Type><HelpOptions<\/Type><ClientError>, CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", "key.substructure" : [ ], - "key.parsed_scope.start" : 75, + "key.parsed_scope.start" : 74, "key.filepath" : "Commandant\/HelpCommand.swift" } ], - "key.parsed_scope.start" : 64, + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 1816, + "key.length" : 11 + } + ], + "key.parsed_scope.start" : 63, "key.filepath" : "Commandant\/HelpCommand.swift" } ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 2182 + "key.length" : 2197 } }, { "Commandant\/Option.swift" : { "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.protocol", - "key.offset" : 1292, + "key.offset" : 1290, "key.parsed_declaration" : "public protocol OptionsType", "key.doc.comment" : "Represents a record of options for a command, which can be parsed from\na list of command-line arguments.\n\nThis is most helpful when used in conjunction with the `Option` and `Switch`\ntypes, and `<*>` and `<|` combinators.\n\nExample:\n\n\tstruct LogOptions: OptionsType {\n\t\tlet verbosity: Int\n\t\tlet outputFilename: String\n\t\tlet logName: String\n\n\t\tstatic func create(verbosity: Int)(outputFilename: String)(logName: String) -> LogOptions {\n\t\t\treturn LogOptions(verbosity: verbosity, outputFilename: outputFilename, logName: logName)\n\t\t}\n\n\t\tstatic func evaluate(m: CommandMode) -> Result {\n\t\t\treturn create\n\t\t\t\t<*> m <| Option(key: \"verbose\", defaultValue: 0, usage: \"the verbosity level with which to read the logs\")\n\t\t\t\t<*> m <| Option(key: \"outputFilename\", defaultValue: \"\", usage: \"a file to print output to, instead of stdout\")\n\t\t\t\t<*> m <| Switch(flag: \"d\", key: \"delete\", defaultValue: false, usage: \"delete the logs when finished\")\n\t\t\t\t<*> m <| Option(usage: \"the log to read\")\n\t\t}\n\t}", "key.namelength" : 11, @@ -309,13 +311,13 @@ "key.parsed_scope.end" : 44, "key.usr" : "s:P10Commandant11OptionsType", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 1292, + "key.nameoffset" : 1290, "key.annotated_decl" : "public protocol OptionsType<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.runtime_name" : "_TtP8__main__11OptionsType_", "key.parsed_scope.start" : 37, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 1305, + "key.bodyoffset" : 1303, "key.doc.declaration" : "public protocol OptionsType", "key.name" : "OptionsType", "key.typename" : "OptionsType.Protocol", @@ -325,12 +327,12 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "OptionsType<\/Name>s:P10Commandant11OptionsType<\/USR>public protocol OptionsType<\/Declaration>Represents a record of options for a command, which can be parsed from\na list of command-line arguments.<\/Para><\/Abstract>This is most helpful when used in conjunction with the ]]><\/rawHTML>Option]]><\/rawHTML> and ]]><\/rawHTML>Switch]]><\/rawHTML>\ntypes, and ]]><\/rawHTML><*>]]><\/rawHTML> and ]]><\/rawHTML><|]]><\/rawHTML> combinators.<\/Para>Example:<\/Para>]]><\/rawHTML>]]><\/rawHTML>struct LogOptions: OptionsType {]]><\/rawHTML>]]><\/rawHTML>let verbosity: Int\nlet outputFilename: String\nlet logName: String]]><\/rawHTML>]]><\/rawHTML>static func create(verbosity: Int)(outputFilename: String)(logName: String) -> LogOptions {]]><\/rawHTML>]]><\/rawHTML>return LogOptions(verbosity: verbosity, outputFilename: outputFilename, logName: logName)]]><\/rawHTML>]]><\/rawHTML>}]]><\/rawHTML>]]><\/rawHTML>static func evaluate(m: CommandMode) -> Result<LogOptions> {]]><\/rawHTML>]]><\/rawHTML>]]><\/rawHTML>]]><\/rawHTML>return create]]><\/rawHTML>]]><\/rawHTML><]]><\/rawHTML>> m <| Option(key: "verbose", defaultValue: 0, usage: "the verbosity level with which to read the logs")\n<]]><\/rawHTML>> m <| Option(key: "outputFilename", defaultValue: "", usage: "a file to print output to, instead of stdout")\n<]]><\/rawHTML>> m <| Switch(flag: "d", key: "delete", defaultValue: false, usage: "delete the logs when finished")\n<]]><\/rawHTML>> m <| Option(usage: "the log to read")]]><\/rawHTML>]]><\/rawHTML>]]><\/rawHTML>]]><\/rawHTML>}]]><\/rawHTML>]]><\/rawHTML>}<\/Verbatim><\/Discussion><\/Class>", + "key.doc.full_as_xml" : "OptionsType<\/Name>s:P10Commandant11OptionsType<\/USR>public protocol OptionsType<\/Declaration>Represents a record of options for a command, which can be parsed from a list of command-line arguments.<\/Para><\/Abstract>This is most helpful when used in conjunction with the Option<\/codeVoice> and Switch<\/codeVoice> types, and <*><\/codeVoice> and <|<\/codeVoice> combinators.<\/Para>Example:<\/Para><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered> LogOptions {]]><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered> Result {]]><\/zCodeLineNumbered><\/zCodeLineNumbered> m <| Option(key: \"verbose\", defaultValue: 0, usage: \"the verbosity level with which to read the logs\")]]><\/zCodeLineNumbered> m <| Option(key: \"outputFilename\", defaultValue: \"\", usage: \"a file to print output to, instead of stdout\")]]><\/zCodeLineNumbered> m <| Switch(flag: \"d\", key: \"delete\", defaultValue: false, usage: \"delete the logs when finished\")]]><\/zCodeLineNumbered> m <| Option(usage: \"the log to read\")]]><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/CodeListing><\/Discussion><\/Class>", "key.doc.name" : "OptionsType", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.function.method.static", - "key.offset" : 1453, + "key.offset" : 1451, "key.parsed_declaration" : "static func evaluate(m: CommandMode) -> Result>", "key.doc.comment" : "Evaluates this set of options in the given mode.\n\nReturns the parsed options or a `UsageError`.", "key.namelength" : 24, @@ -338,31 +340,31 @@ "key.length" : 24, "key.doc.column" : 14, "key.parsed_scope.end" : 43, - "key.usr" : "s:ZFP10Commandant11OptionsType8evaluateUS0__U__FMQPS0_FOS_11CommandModeGO8LlamaKit6ResultS1_GOS_15CommandantErrorQS1_11ClientError__", + "key.usr" : "s:ZFP10Commandant11OptionsType8evaluateuRq_S0__FMq_FOS_11CommandModeGO6Result6Resultq_GOS_15CommandantErrorqq_S0_11ClientError__", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 1453, - "key.annotated_decl" : "static func evaluate(m: CommandMode<\/Type>) -> Result<\/Type><Self, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 1451, + "key.annotated_decl" : "static func evaluate(m: CommandMode<\/Type>) -> Result<\/Type><Self, CommandantError<\/Type><Self.ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 43, "key.filepath" : "Commandant\/Option.swift", - "key.doc.declaration" : "static func evaluate(m: CommandMode) -> Result>", + "key.doc.declaration" : "static func evaluate(m: CommandMode) -> Result.Result>", "key.name" : "evaluate(_:)", - "key.typename" : "<`Self` : OptionsType> Self.Type -> (CommandMode) -> Result>", + "key.typename" : "<`Self` : OptionsType> Self.Type -> (CommandMode) -> Result>", "key.doc.type" : "Function", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "evaluate(_:)<\/Name>s:ZFP10Commandant11OptionsType8evaluateUS0__U__FMQPS0_FOS_11CommandModeGO8LlamaKit6ResultS1_GOS_15CommandantErrorQS1_11ClientError__<\/USR>static func evaluate(m: CommandMode) -> Result<Self, CommandantError<ClientError>><\/Declaration>Evaluates this set of options in the given mode.<\/Para><\/Abstract>Returns the parsed options or a ]]><\/rawHTML>UsageError]]><\/rawHTML>.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "evaluate(_:)<\/Name>s:ZFP10Commandant11OptionsType8evaluateuRq_S0__FMq_FOS_11CommandModeGO6Result6Resultq_GOS_15CommandantErrorqq_S0_11ClientError__<\/USR>static func evaluate(m: CommandMode) -> Result.Result<Self, Commandant.CommandantError<Self.ClientError>><\/Declaration>Evaluates this set of options in the given mode.<\/Para><\/Abstract>Returns the parsed options or a UsageError<\/codeVoice>.<\/Para><\/Discussion><\/Function>", "key.doc.name" : "evaluate(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:ZFP10Commandant11OptionsType8evaluateUS0__U__FMQPS0_FOS_11CommandModeGO8LlamaKit6ResultS1_GOS_15CommandantErrorQS1_11ClientError__", + "key.doc.usr" : "s:ZFP10Commandant11OptionsType8evaluateuRq_S0__FMq_FOS_11CommandModeGO6Result6Resultq_GOS_15CommandantErrorqq_S0_11ClientError__", "key.doc.discussion" : [ { - "Para" : "Returns the parsed options or a UsageError<\/code>." + "Para" : "Returns the parsed options or a `UsageError`." } ] } @@ -370,19 +372,19 @@ "key.doc.usr" : "s:P10Commandant11OptionsType", "key.doc.discussion" : [ { - "Para" : "This is most helpful when used in conjunction with the Option<\/code> and Switch<\/code>\ntypes, and <*><\/code> and <|<\/code> combinators." + "Para" : "This is most helpful when used in conjunction with the `Option` and `Switch` types, and `<*>` and `<|` combinators." }, { "Para" : "Example:" }, { - "Verbatim" : "
        struct LogOptions: OptionsType {<\/dt>
        let verbosity: Int\nlet outputFilename: String\nlet logName: String
        static func create(verbosity: Int)(outputFilename: String)(logName: String) -> LogOptions {<\/dt>
        return LogOptions(verbosity: verbosity, outputFilename: outputFilename, logName: logName)<\/dd><\/dl>}
        static func evaluate(m: CommandMode) -> Result {<\/dt>
        return create<\/dt>
        <> m <| Option(key: \"verbose\", defaultValue: 0, usage: \"the verbosity level with which to read the logs\")\n<<\/em>> m <| Option(key: \"outputFilename\", defaultValue: \"\", usage: \"a file to print output to, instead of stdout\")\n<> m <| Switch(flag: \"d\", key: \"delete\", defaultValue: false, usage: \"delete the logs when finished\")\n<<\/em>> m <| Option(usage: \"the log to read\")<\/dd><\/dl><\/dd><\/dl>}<\/dd><\/dl>}" + "CodeListing" : "" } ] }, { "key.kind" : "source.lang.swift.decl.struct", - "key.offset" : 1607, + "key.offset" : 1605, "key.parsed_declaration" : "public struct Option", "key.doc.comment" : "Describes an option that can be provided on the command line.", "key.namelength" : 6, @@ -393,12 +395,12 @@ "key.parsed_scope.end" : 83, "key.usr" : "s:V10Commandant6Option", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 1607, + "key.nameoffset" : 1605, "key.annotated_decl" : "public struct Option<T><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 47, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 1618, + "key.bodyoffset" : 1616, "key.doc.declaration" : "public struct Option", "key.name" : "Option", "key.typename" : "Option.Type", @@ -413,7 +415,7 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1952, + "key.offset" : 1950, "key.parsed_declaration" : "public let key: String?", "key.doc.comment" : "The key that controls this option. For example, a key of `verbose` would\nbe used for a `--verbose` option.\n\nIf this is nil, this option will not have a corresponding flag, and must\nbe specified as a plain value at the end of the argument list.\n\nThis must be non-nil for a boolean option.", "key.namelength" : 3, @@ -423,7 +425,7 @@ "key.parsed_scope.end" : 55, "key.usr" : "s:vV10Commandant6Option3keyGSqSS_", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 1952, + "key.nameoffset" : 1950, "key.annotated_decl" : "public let key: String<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 55, @@ -437,15 +439,12 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "key<\/Name>s:vV10Commandant6Option3keyGSqSS_<\/USR>public let key: String?<\/Declaration>The key that controls this option. For example, a key of ]]><\/rawHTML>verbose]]><\/rawHTML> would\nbe used for a ]]><\/rawHTML>--verbose]]><\/rawHTML> option.<\/Para><\/Abstract>If this is nil, this option will not have a corresponding flag, and must\nbe specified as a plain value at the end of the argument list.<\/Para>This must be non-nil for a boolean option.<\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "key<\/Name>s:vV10Commandant6Option3keyGSqSS_<\/USR>public let key: String?<\/Declaration>The key that controls this option. For example, a key of verbose<\/codeVoice> would be used for a --verbose<\/codeVoice> option.<\/Para><\/Abstract>If this is nil, this option will not have a corresponding flag, and must be specified as a plain value at the end of the argument list.<\/Para>This must be non-nil for a boolean option.<\/Para><\/Discussion><\/Other>", "key.doc.name" : "key", - "key.substructure" : [ - - ], "key.doc.usr" : "s:vV10Commandant6Option3keyGSqSS_", "key.doc.discussion" : [ { - "Para" : "If this is nil, this option will not have a corresponding flag, and must\nbe specified as a plain value at the end of the argument list." + "Para" : "If this is nil, this option will not have a corresponding flag, and must be specified as a plain value at the end of the argument list." }, { "Para" : "This must be non-nil for a boolean option." @@ -454,7 +453,7 @@ }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 2182, + "key.offset" : 2180, "key.parsed_declaration" : "public let defaultValue: T?", "key.doc.comment" : "The default value for this option. This is the value that will be used\nif the option is never explicitly specified on the command line.\n\nIf this is nil, this option is always required.", "key.namelength" : 12, @@ -462,9 +461,9 @@ "key.length" : 12, "key.doc.column" : 13, "key.parsed_scope.end" : 61, - "key.usr" : "s:vV10Commandant6Option12defaultValueGSqQ__", + "key.usr" : "s:vV10Commandant6Option12defaultValueGSqq__", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 2182, + "key.nameoffset" : 2180, "key.annotated_decl" : "public let defaultValue: T?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 61, @@ -478,12 +477,9 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "defaultValue<\/Name>s:vV10Commandant6Option12defaultValueGSqQ__<\/USR>public let defaultValue: T?<\/Declaration>The default value for this option. This is the value that will be used\nif the option is never explicitly specified on the command line.<\/Para><\/Abstract>If this is nil, this option is always required.<\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "defaultValue<\/Name>s:vV10Commandant6Option12defaultValueGSqq__<\/USR>public let defaultValue: T?<\/Declaration>The default value for this option. This is the value that will be used if the option is never explicitly specified on the command line.<\/Para><\/Abstract>If this is nil, this option is always required.<\/Para><\/Discussion><\/Other>", "key.doc.name" : "defaultValue", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vV10Commandant6Option12defaultValueGSqQ__", + "key.doc.usr" : "s:vV10Commandant6Option12defaultValueGSqq__", "key.doc.discussion" : [ { "Para" : "If this is nil, this option is always required." @@ -492,7 +488,7 @@ }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 2517, + "key.offset" : 2515, "key.parsed_declaration" : "public let usage: String", "key.doc.comment" : "A human-readable string describing the purpose of this option. This will\nbe shown in help messages.\n\nFor boolean operations, this should describe the effect of _not_ using\nthe default value (i.e., what will happen if you disable\/enable the flag\ndifferently from the default).", "key.namelength" : 5, @@ -502,7 +498,7 @@ "key.parsed_scope.end" : 69, "key.usr" : "s:vV10Commandant6Option5usageSS", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 2517, + "key.nameoffset" : 2515, "key.annotated_decl" : "public let usage: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 69, @@ -516,31 +512,28 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "usage<\/Name>s:vV10Commandant6Option5usageSS<\/USR>public let usage: String<\/Declaration>A human-readable string describing the purpose of this option. This will\nbe shown in help messages.<\/Para><\/Abstract>For boolean operations, this should describe the effect of _not_ using\nthe default value (i.e., what will happen if you disable\/enable the flag\ndifferently from the default).<\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "usage<\/Name>s:vV10Commandant6Option5usageSS<\/USR>public let usage: String<\/Declaration>A human-readable string describing the purpose of this option. This will be shown in help messages.<\/Para><\/Abstract>For boolean operations, this should describe the effect of not<\/emphasis> using the default value (i.e., what will happen if you disable\/enable the flag differently from the default).<\/Para><\/Discussion><\/Other>", "key.doc.name" : "usage", - "key.substructure" : [ - - ], "key.doc.usr" : "s:vV10Commandant6Option5usageSS", "key.doc.discussion" : [ { - "Para" : "For boolean operations, this should describe the effect of _not_ using\nthe default value (i.e., what will happen if you disable\/enable the flag\ndifferently from the default)." + "Para" : "For boolean operations, this should describe the effect of using the default value (i.e., what will happen if you disable\/enable the flag differently from the default)." } ] }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2540, + "key.offset" : 2538, "key.parsed_declaration" : "public init(key: String? = nil, defaultValue: T? = nil, usage: String)", "key.namelength" : 63, - "key.bodyoffset" : 2605, + "key.bodyoffset" : 2603, "key.bodylength" : 75, "key.length" : 63, "key.name" : "init(key:defaultValue:usage:)", "key.typename" : " Option.Type -> (key: String?, defaultValue: T?, usage: String) -> Option", "key.parsed_scope.end" : 75, - "key.usr" : "s:FV10Commandant6OptioncU__FMGS0_Q__FT3keyGSqSS_12defaultValueGSqQ__5usageSS_GS0_Q__", - "key.nameoffset" : 2540, + "key.usr" : "s:FV10Commandant6OptioncurFMGS0_q__FT3keyGSqSS_12defaultValueGSqq__5usageSS_GS0_q__", + "key.nameoffset" : 2538, "key.annotated_decl" : "public init(key: String<\/Type>? = default, defaultValue: T? = default, usage: String<\/Type>)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.substructure" : [ @@ -551,7 +544,7 @@ }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2852, + "key.offset" : 2850, "key.parsed_declaration" : "private func invalidUsageError(value: String) -> CommandantError", "key.doc.comment" : "Constructs an `InvalidArgument` error that describes how the option was\nused incorrectly. `value` should be the invalid value given by the user.", "key.namelength" : 45, @@ -560,15 +553,15 @@ "key.length" : 45, "key.doc.column" : 15, "key.parsed_scope.end" : 82, - "key.usr" : "s:FV10Commandant6OptionP33_4F8DF2BC794A725A9EB7CCE887709D3217invalidUsageErrorU__FGS0_Q__U__FSSGOS_15CommandantErrorQ__", + "key.usr" : "s:FV10Commandant6OptionP33_4F8DF2BC794A725A9EB7CCE887709D3217invalidUsageErroru__rFGS0_q__FSSGOS_15CommandantErrorqd___", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 2852, + "key.nameoffset" : 2850, "key.annotated_decl" : "private func invalidUsageError<ClientError>(value: String<\/Type>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", "key.parsed_scope.start" : 79, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 2931, - "key.doc.declaration" : "private func invalidUsageError(value: String) -> CommandantError", + "key.bodyoffset" : 2929, + "key.doc.declaration" : "private func invalidUsageError(value: String) -> Commandant.CommandantError", "key.name" : "invalidUsageError(_:)", "key.typename" : " Option -> (String) -> CommandantError", "key.doc.type" : "Function", @@ -577,22 +570,22 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "invalidUsageError(_:)<\/Name>s:FV10Commandant6OptionP33_4F8DF2BC794A725A9EB7CCE887709D3217invalidUsageErrorU__FGS0_Q__U__FSSGOS_15CommandantErrorQ__<\/USR>private func invalidUsageError<ClientError>(value: String) -> CommandantError<ClientError><\/Declaration>Constructs an ]]><\/rawHTML>InvalidArgument]]><\/rawHTML> error that describes how the option was\nused incorrectly. ]]><\/rawHTML>value]]><\/rawHTML> should be the invalid value given by the user.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "invalidUsageError(_:)<\/Name>s:FV10Commandant6OptionP33_4F8DF2BC794A725A9EB7CCE887709D3217invalidUsageErroru__rFGS0_q__FSSGOS_15CommandantErrorqd___<\/USR>private func invalidUsageError<ClientError>(value: String) -> Commandant.CommandantError<ClientError><\/Declaration>Constructs an InvalidArgument<\/codeVoice> error that describes how the option was used incorrectly. value<\/codeVoice> should be the invalid value given by the user.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "invalidUsageError(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FV10Commandant6OptionP33_4F8DF2BC794A725A9EB7CCE887709D3217invalidUsageErrorU__FGS0_Q__U__FSSGOS_15CommandantErrorQ__" + "key.doc.usr" : "s:FV10Commandant6OptionP33_4F8DF2BC794A725A9EB7CCE887709D3217invalidUsageErroru__rFGS0_q__FSSGOS_15CommandantErrorqd___" } ], "key.doc.usr" : "s:V10Commandant6Option" }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 1607, + "key.offset" : 1605, "key.doc.comment" : "Describes an option that can be provided on the command line.", "key.namelength" : 6, - "key.bodyoffset" : 3074, + "key.bodyoffset" : 3086, "key.bodylength" : 111, "key.length" : 6, "key.doc.line" : 47, @@ -604,21 +597,21 @@ "key.doc.type" : "Class", "key.doc.file" : "Commandant\/Option.swift", "key.doc.full_as_xml" : "Option<\/Name>s:V10Commandant6Option<\/USR>public struct Option<T><\/Declaration>Describes an option that can be provided on the command line.<\/Para><\/Abstract><\/Class>", - "key.nameoffset" : 3055, + "key.nameoffset" : 3053, "key.doc.name" : "Option", "key.inheritedtypes" : [ { - "key.name" : "Printable" + "key.name" : "CustomStringConvertible" } ], "key.annotated_decl" : "public struct Option<T><\/Declaration>", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 3087, + "key.offset" : 3099, "key.parsed_declaration" : "public var description: String", "key.namelength" : 11, - "key.bodyoffset" : 3108, + "key.bodyoffset" : 3120, "key.bodylength" : 75, "key.length" : 11, "key.typename" : "String", @@ -627,25 +620,29 @@ "key.usr" : "s:vV10Commandant6Option11descriptionSS", "key.overrides" : [ { - "key.usr" : "s:vPSs9Printable11descriptionSS" + "key.usr" : "s:vPSs23CustomStringConvertible11descriptionSS" } ], - "key.nameoffset" : 3087, + "key.nameoffset" : 3099, "key.annotated_decl" : "public var description: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 86, "key.filepath" : "Commandant\/Option.swift" } ], "key.doc.usr" : "s:V10Commandant6Option", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 3061, + "key.length" : 23 + } + ], "key.filepath" : "Commandant\/Option.swift" }, { "key.kind" : "source.lang.swift.decl.protocol", - "key.offset" : 3279, + "key.offset" : 3291, "key.parsed_declaration" : "public protocol ArgumentType", "key.doc.comment" : "Represents a value that can be converted from a command-line argument.", "key.namelength" : 12, @@ -656,13 +653,13 @@ "key.parsed_scope.end" : 102, "key.usr" : "s:P10Commandant12ArgumentType", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 3279, + "key.nameoffset" : 3291, "key.annotated_decl" : "public protocol ArgumentType<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.runtime_name" : "_TtP8__main__12ArgumentType_", "key.parsed_scope.start" : 96, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 3293, + "key.bodyoffset" : 3305, "key.doc.declaration" : "public protocol ArgumentType", "key.name" : "ArgumentType", "key.typename" : "ArgumentType.Protocol", @@ -677,7 +674,7 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.static", - "key.offset" : 3348, + "key.offset" : 3360, "key.parsed_declaration" : "static var name: String { get }", "key.doc.comment" : "A human-readable name for this type.", "key.namelength" : 4, @@ -688,12 +685,12 @@ "key.parsed_scope.end" : 98, "key.usr" : "s:ZvP10Commandant12ArgumentType4nameSS", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 3348, + "key.nameoffset" : 3360, "key.annotated_decl" : "static var name: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 98, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 3362, + "key.bodyoffset" : 3374, "key.doc.declaration" : "static var name: String { get }", "key.typename" : "String", "key.name" : "name", @@ -705,14 +702,11 @@ ], "key.doc.full_as_xml" : "name<\/Name>s:ZvP10Commandant12ArgumentType4nameSS<\/USR>static var name: String { get }<\/Declaration>A human-readable name for this type.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "name", - "key.substructure" : [ - - ], "key.doc.usr" : "s:ZvP10Commandant12ArgumentType4nameSS" }, { "key.kind" : "source.lang.swift.decl.function.method.static", - "key.offset" : 3452, + "key.offset" : 3464, "key.parsed_declaration" : "static func fromString(string: String) -> Self?", "key.doc.comment" : "Attempts to parse a value from the given command-line argument.", "key.namelength" : 26, @@ -720,9 +714,9 @@ "key.length" : 26, "key.doc.column" : 14, "key.parsed_scope.end" : 101, - "key.usr" : "s:ZFP10Commandant12ArgumentType10fromStringUS0___FMQPS0_FSSGSqS1__", + "key.usr" : "s:ZFP10Commandant12ArgumentType10fromStringuRq_S0__FMq_FSSGSqq__", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 3452, + "key.nameoffset" : 3464, "key.annotated_decl" : "static func fromString(string: String<\/Type>) -> Self?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 101, @@ -736,71 +730,68 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "fromString(_:)<\/Name>s:ZFP10Commandant12ArgumentType10fromStringUS0___FMQPS0_FSSGSqS1__<\/USR>static func fromString(string: String) -> Self?<\/Declaration>Attempts to parse a value from the given command-line argument.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "fromString(_:)<\/Name>s:ZFP10Commandant12ArgumentType10fromStringuRq_S0__FMq_FSSGSqq__<\/USR>static func fromString(string: String) -> Self?<\/Declaration>Attempts to parse a value from the given command-line argument.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "fromString(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:ZFP10Commandant12ArgumentType10fromStringUS0___FMQPS0_FSSGSqS1__" + "key.doc.usr" : "s:ZFP10Commandant12ArgumentType10fromStringuRq_S0__FMq_FSSGSqq__" } ], "key.doc.usr" : "s:P10Commandant12ArgumentType" }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 3491, + "key.offset" : 3503, "key.doc.comment" : "Attempts to parse a value from the given command-line argument.", "key.namelength" : 3, - "key.bodyoffset" : 3520, - "key.bodylength" : 122, - "key.length" : 152, - "key.doc.declaration" : "struct Int : SignedIntegerType", + "key.bodyoffset" : 3532, + "key.bodylength" : 119, + "key.length" : 149, + "key.doc.declaration" : "struct Int : _SignedIntegerType, Comparable, Equatable, _IntegerType, IntegerArithmeticType, _IntegerArithmeticType, SignedIntegerType, IntegerType", "key.name" : "Int", "key.typename" : "Int.Type", "key.usr" : "s:Si", "key.doc.type" : "Class", - "key.doc.full_as_xml" : "Int<\/Name>s:Si<\/USR>struct Int : SignedIntegerType<\/Declaration>A 64-bit signed integer value\ntype.<\/Para><\/Abstract><\/Class>", - "key.nameoffset" : 3501, + "key.doc.full_as_xml" : "Int<\/Name>s:Si<\/USR>struct Int : _SignedIntegerType, Comparable, Equatable, _IntegerType, IntegerArithmeticType, _IntegerArithmeticType, SignedIntegerType, IntegerType<\/Declaration>A 64-bit signed integer value type.<\/Para><\/Abstract><\/Class>", + "key.nameoffset" : 3513, "key.doc.name" : "Int", "key.inheritedtypes" : [ { "key.name" : "ArgumentType" } ], - "key.annotated_decl" : "struct Int : SignedIntegerType<\/Type><\/Declaration>", + "key.annotated_decl" : "struct Int : _SignedIntegerType<\/Type>, Comparable<\/Type>, Equatable<\/Type>, _BuiltinIntegerLiteralConvertible<\/Type>, _IntegerType<\/Type>, IntegerArithmeticType<\/Type>, _IntegerArithmeticType<\/Type>, SignedIntegerType<\/Type>, IntegerType<\/Type><\/Declaration>", "key.is_system" : true, "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.static", - "key.offset" : 3540, + "key.offset" : 3552, "key.parsed_declaration" : "public static let name = \"integer\"", "key.namelength" : 4, "key.length" : 4, "key.typename" : "String", "key.name" : "name", "key.parsed_scope.end" : 105, - "key.usr" : "s:ZvE10CommandantSi4nameSS", "key.overrides" : [ { "key.usr" : "s:ZvP10Commandant12ArgumentType4nameSS" } ], - "key.nameoffset" : 3540, + "key.usr" : "s:ZvE10CommandantSi4nameSS", + "key.nameoffset" : 3552, "key.annotated_decl" : "public static let name: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 105, "key.filepath" : "Commandant\/Option.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.static", - "key.offset" : 3578, + "key.offset" : 3590, "key.parsed_declaration" : "public static func fromString(string: String) -> Int?", "key.namelength" : 26, - "key.bodyoffset" : 3614, - "key.bodylength" : 26, + "key.bodyoffset" : 3626, + "key.bodylength" : 23, "key.length" : 26, "key.name" : "fromString(_:)", "key.typename" : "Int.Type -> (String) -> Int?", @@ -808,10 +799,10 @@ "key.usr" : "s:ZFE10CommandantSi10fromStringFMSiFSSGSqSi_", "key.overrides" : [ { - "key.usr" : "s:ZFP10Commandant12ArgumentType10fromStringUS0___FMQPS0_FSSGSqS1__" + "key.usr" : "s:ZFP10Commandant12ArgumentType10fromStringuRq_S0__FMq_FSSGSqq__" } ], - "key.nameoffset" : 3578, + "key.nameoffset" : 3590, "key.annotated_decl" : "public static func fromString(string: String<\/Type>) -> Int<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.substructure" : [ @@ -822,15 +813,22 @@ } ], "key.doc.usr" : "s:Si", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 3518, + "key.length" : 12 + } + ], "key.modulename" : "Swift" }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 3645, + "key.offset" : 3654, "key.doc.comment" : "Attempts to parse a value from the given command-line argument.", "key.modulename" : "Swift", "key.namelength" : 6, - "key.bodyoffset" : 3677, + "key.bodyoffset" : 3686, "key.bodylength" : 116, "key.length" : 149, "key.doc.declaration" : "struct String", @@ -838,8 +836,8 @@ "key.typename" : "String.Type", "key.usr" : "s:SS", "key.doc.type" : "Class", - "key.doc.full_as_xml" : "String<\/Name>s:SS<\/USR>struct String<\/Declaration>An arbitrary Unicode string value.<\/Para><\/Abstract>Unicode-Correct\n===============<\/Para>Swift strings are designed to be Unicode-correct. In particular,\nthe APIs make it easy to write code that works correctly, and does\nnot surprise end-users, regardless of where you venture in the\nUnicode character space. For example,<\/Para>]]><\/rawHTML>]]><\/rawHTML>The ]]><\/rawHTML>==]]><\/rawHTML> operator checks for Unicode canonical equivalence\n<http:\/\/www.unicode.org\/glossary\/#deterministic_comparison>,\nso two different representations of the same string will always\ncompare equal.]]><\/rawHTML>]]><\/rawHTML>String elements are ]]><\/rawHTML>Characters]]><\/rawHTML> (extended grapheme clusters\n<http:\/\/www.unicode.org\/glossary\/#extended_grapheme_cluster>),\na unit of text that is meaningful to most humans.]]><\/rawHTML>]]><\/rawHTML><\/Para>Locale-Insensitive\n==================<\/Para>The fundamental operations on Swift strings are not sensitive to\nlocale settings. That's because, for example, the validity of a\n`Dictionary<String, T>` in a running program depends on a given\nstring comparison having a single, stable result. Therefore,\nSwift always uses the default, un-tailored\n<http:\/\/www.unicode.org\/glossary\/#tailorable> Unicode algorithms\nfor basic string operations.<\/Para>Importing ]]><\/rawHTML>Foundation]]><\/rawHTML> endows swift strings with the full power of\nthe ]]><\/rawHTML>NSString]]><\/rawHTML> API, which allows you to choose more complex\nlocale-sensitive operations explicitly.<\/Para>Value Semantics\n===============<\/Para>Each string variable, ]]><\/rawHTML>let]]><\/rawHTML> binding, or stored property has an\nindependent value, so mutations to the string are not observable\nthrough its copies::<\/Para>var a = "foo"\nvar b = a\nb[b.endIndex.predecessor()] = "x"\nprintln("a=\\(a), b=\\(b)") \/\/ a=foo, b=fox<\/Verbatim>Strings use Copy-on-Write so that their data is only copied\nlazily, upon mutation, when more than one string instance is using\nthe same buffer. Therefore, the first in any sequence of mutating\noperations may cost ]]><\/rawHTML>O(N)]]><\/rawHTML> time and space, where ]]><\/rawHTML>N]]><\/rawHTML> is the length\nof the string's (unspecified) underlying representation,.<\/Para>Growth and Capacity\n===================<\/Para>When a string's contiguous storage fills up, new storage must be\nallocated and characters must be moved to the new storage.\n`String` uses an exponential growth strategy that makes ]]><\/rawHTML>append]]><\/rawHTML> a\nconstant time operation ]]><\/rawHTML>when amortized over many invocations]]><\/rawHTML>.<\/Para>Objective-C Bridge\n==================<\/Para>]]><\/rawHTML>String]]><\/rawHTML> is bridged to Objective-C as ]]><\/rawHTML>NSString]]><\/rawHTML>, and a ]]><\/rawHTML>String]]><\/rawHTML>\nthat originated in Objective-C may store its characters in an\n`NSString`. Since any arbitrary subclass of ]]><\/rawHTML>NSSString]]><\/rawHTML> can\nbecome a ]]><\/rawHTML>String]]><\/rawHTML>, there are no guarantees about representation or\nefficiency in this case. Since ]]><\/rawHTML>NSString]]><\/rawHTML> is immutable, it is\njust as though the storage was shared by some copy: the first in\nany sequence of mutating operations causes elements to be copied\ninto unique, contiguous storage which may cost ]]><\/rawHTML>O(N)]]><\/rawHTML> time and\nspace, where ]]><\/rawHTML>N]]><\/rawHTML> is the length of the string representation (or\nmore, if the underlying ]]><\/rawHTML>NSString]]><\/rawHTML> is has unusual performance\ncharacteristics).<\/Para><\/Discussion><\/Class>", - "key.nameoffset" : 3655, + "key.doc.full_as_xml" : "String<\/Name>s:SS<\/USR>struct String<\/Declaration>An arbitrary Unicode string value.<\/Para><\/Abstract>]]><\/rawHTML>Unicode-Correct]]><\/rawHTML>Swift strings are designed to be Unicode-correct. In particular, the APIs make it easy to write code that works correctly, and does not surprise end-users, regardless of where you venture in the Unicode character space. For example, the ==<\/codeVoice> operator checks for Unicode canonical equivalence<\/Link>, so two different representations of the same string will always compare equal.<\/Para>]]><\/rawHTML>Locale-Insensitive]]><\/rawHTML>The fundamental operations on Swift strings are not sensitive to locale settings. That's because, for example, the validity of a Dictionary<String, T><\/codeVoice> in a running program depends on a given string comparison having a single, stable result. Therefore, Swift always uses the default, un-tailored<\/Link> Unicode algorithms for basic string operations.<\/Para>Importing Foundation<\/codeVoice> endows swift strings with the full power of the NSString<\/codeVoice> API, which allows you to choose more complex locale-sensitive operations explicitly.<\/Para>]]><\/rawHTML>Value Semantics]]><\/rawHTML>Each string variable, let<\/codeVoice> binding, or stored property has an independent value, so mutations to the string are not observable through its copies:<\/Para><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/zCodeLineNumbered><\/CodeListing>Strings use Copy-on-Write so that their data is only copied lazily, upon mutation, when more than one string instance is using the same buffer. Therefore, the first in any sequence of mutating operations may cost O(N)<\/codeVoice> time and space, where N<\/codeVoice> is the length of the string's (unspecified) underlying representation.<\/Para>]]><\/rawHTML>Views]]><\/rawHTML>String<\/codeVoice> is not itself a collection of anything. Instead, it has properties that present the string's contents as meaningful collections:<\/Para>characters<\/codeVoice>: a collection of Character<\/codeVoice> (extended grapheme cluster<\/Link>) elements, a unit of text that is meaningful to most humans.<\/Para><\/Item>unicodeScalars<\/codeVoice>: a collection of UnicodeScalar<\/codeVoice> (Unicode scalar values<\/Link>) the 21-bit codes that are the basic unit of Unicode. These values are equivalent to UTF-32 code units.<\/Para><\/Item>utf16<\/codeVoice>: a collection of UTF16.CodeUnit<\/codeVoice>, the 16-bit elements of the string's UTF-16 encoding.<\/Para><\/Item>utf8<\/codeVoice>: a collection of UTF8.CodeUnit<\/codeVoice>, the 8-bit elements of the string's UTF-8 encoding.<\/Para><\/Item><\/List-Bullet>]]><\/rawHTML>Growth and Capacity]]><\/rawHTML>When a string's contiguous storage fills up, new storage must be allocated and characters must be moved to the new storage. String<\/codeVoice> uses an exponential growth strategy that makes append<\/codeVoice> a constant time operation when amortized over many invocations<\/emphasis>.<\/Para>]]><\/rawHTML>Objective-C Bridge]]><\/rawHTML>String<\/codeVoice> is bridged to Objective-C as NSString<\/codeVoice>, and a String<\/codeVoice> that originated in Objective-C may store its characters in an NSString<\/codeVoice>. Since any arbitrary subclass of NSSString<\/codeVoice> can become a String<\/codeVoice>, there are no guarantees about representation or efficiency in this case. Since NSString<\/codeVoice> is immutable, it is just as though the storage was shared by some copy: the first in any sequence of mutating operations causes elements to be copied into unique, contiguous storage which may cost O(N)<\/codeVoice> time and space, where N<\/codeVoice> is the length of the string representation (or more, if the underlying NSString<\/codeVoice> is has unusual performance characteristics).<\/Para><\/Discussion><\/Class>", + "key.nameoffset" : 3664, "key.doc.name" : "String", "key.inheritedtypes" : [ { @@ -851,34 +849,31 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.static", - "key.offset" : 3697, + "key.offset" : 3706, "key.parsed_declaration" : "public static let name = \"string\"", "key.namelength" : 4, "key.length" : 4, "key.typename" : "String", "key.name" : "name", "key.parsed_scope.end" : 113, - "key.usr" : "s:ZvE10CommandantSS4nameSS", "key.overrides" : [ { "key.usr" : "s:ZvP10Commandant12ArgumentType4nameSS" } ], - "key.nameoffset" : 3697, + "key.usr" : "s:ZvE10CommandantSS4nameSS", + "key.nameoffset" : 3706, "key.annotated_decl" : "public static let name: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 113, "key.filepath" : "Commandant\/Option.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.static", - "key.offset" : 3734, + "key.offset" : 3743, "key.parsed_declaration" : "public static func fromString(string: String) -> String?", "key.namelength" : 26, - "key.bodyoffset" : 3773, + "key.bodyoffset" : 3782, "key.bodylength" : 18, "key.length" : 26, "key.name" : "fromString(_:)", @@ -887,10 +882,10 @@ "key.usr" : "s:ZFE10CommandantSS10fromStringFMSSFSSGSqSS_", "key.overrides" : [ { - "key.usr" : "s:ZFP10Commandant12ArgumentType10fromStringUS0___FMQPS0_FSSGSqS1__" + "key.usr" : "s:ZFP10Commandant12ArgumentType10fromStringuRq_S0__FMq_FSSGSqq__" } ], - "key.nameoffset" : 3734, + "key.nameoffset" : 3743, "key.annotated_decl" : "public static func fromString(string: String<\/Type>) -> String<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.substructure" : [ @@ -901,54 +896,49 @@ } ], "key.doc.usr" : "s:SS", - "key.doc.discussion" : [ - { - "Para" : "Unicode-Correct\n===============" - }, - { - "Para" : "Swift strings are designed to be Unicode-correct. In particular,\nthe APIs make it easy to write code that works correctly, and does\nnot surprise end-users, regardless of where you venture in the\nUnicode character space. For example," - }, - { - "Para" : "
        • The ==<\/code> operator checks for Unicode canonical equivalence\n,\nso two different representations of the same string will always\ncompare equal.<\/li>
        • String elements are Characters<\/code> (extended grapheme clusters\n),\na unit of text that is meaningful to most humans.<\/li><\/ul>" - }, + "key.elements" : [ { - "Para" : "Locale-Insensitive\n==================" - }, + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 3672, + "key.length" : 12 + } + ], + "key.doc.discussion" : [ { - "Para" : "The fundamental operations on Swift strings are not sensitive to\nlocale settings. That's because, for example, the validity of a\n`Dictionary` in a running program depends on a given\nstring comparison having a single, stable result. Therefore,\nSwift always uses the default, un-tailored\n Unicode algorithms\nfor basic string operations." + "Para" : "Swift strings are designed to be Unicode-correct. In particular, the APIs make it easy to write code that works correctly, and does not surprise end-users, regardless of where you venture in the Unicode character space. For example, the `==` operator checks for , so two different representations of the same string will always compare equal." }, { - "Para" : "Importing Foundation<\/code> endows swift strings with the full power of\nthe NSString<\/code> API, which allows you to choose more complex\nlocale-sensitive operations explicitly." + "Para" : "The fundamental operations on Swift strings are not sensitive to locale settings. That's because, for example, the validity of a `Dictionary` in a running program depends on a given string comparison having a single, stable result. Therefore, Swift always uses the default, un- Unicode algorithms for basic string operations." }, { - "Para" : "Value Semantics\n===============" + "Para" : "Importing `Foundation` endows swift strings with the full power of the `NSString` API, which allows you to choose more complex locale-sensitive operations explicitly." }, { - "Para" : "Each string variable, let<\/code> binding, or stored property has an\nindependent value, so mutations to the string are not observable\nthrough its copies::" + "Para" : "Each string variable, `let` binding, or stored property has an independent value, so mutations to the string are not observable through its copies:" }, { - "Verbatim" : "var a = \"foo\"\nvar b = a\nb[b.endIndex.predecessor()] = \"x\"\nprintln(\"a=\\(a), b=\\(b)\") \/\/ a=foo, b=fox" + "CodeListing" : "" }, { - "Para" : "Strings use Copy-on-Write so that their data is only copied\nlazily, upon mutation, when more than one string instance is using\nthe same buffer. Therefore, the first in any sequence of mutating\noperations may cost O(N)<\/code> time and space, where N<\/code> is the length\nof the string's (unspecified) underlying representation,." + "Para" : "Strings use Copy-on-Write so that their data is only copied lazily, upon mutation, when more than one string instance is using the same buffer. Therefore, the first in any sequence of mutating operations may cost `O(N)` time and space, where `N` is the length of the string's (unspecified) underlying representation." }, { - "Para" : "Growth and Capacity\n===================" + "Para" : "`String` is not itself a collection of anything. Instead, it has properties that present the string's contents as meaningful collections:" }, { - "Para" : "When a string's contiguous storage fills up, new storage must be\nallocated and characters must be moved to the new storage.\n`String` uses an exponential growth strategy that makes append<\/code> a\nconstant time operation when amortized over many invocations<\/em>." + "List-Bullet" : "" }, { - "Para" : "Objective-C Bridge\n==================" + "Para" : "When a string's contiguous storage fills up, new storage must be allocated and characters must be moved to the new storage. `String` uses an exponential growth strategy that makes `append` a constant time operation ." }, { - "Para" : "String<\/code> is bridged to Objective-C as NSString<\/code>, and a String<\/code>\nthat originated in Objective-C may store its characters in an\n`NSString`. Since any arbitrary subclass of NSSString<\/code> can\nbecome a String<\/code>, there are no guarantees about representation or\nefficiency in this case. Since NSString<\/code> is immutable, it is\njust as though the storage was shared by some copy: the first in\nany sequence of mutating operations causes elements to be copied\ninto unique, contiguous storage which may cost O(N)<\/code> time and\nspace, where N<\/code> is the length of the string representation (or\nmore, if the underlying NSString<\/code> is has unusual performance\ncharacteristics)." + "Para" : "`String` is bridged to Objective-C as `NSString`, and a `String` that originated in Objective-C may store its characters in an `NSString`. Since any arbitrary subclass of `NSSString` can become a `String`, there are no guarantees about representation or efficiency in this case. Since `NSString` is immutable, it is just as though the storage was shared by some copy: the first in any sequence of mutating operations causes elements to be copied into unique, contiguous storage which may cost `O(N)` time and space, where `N` is the length of the string representation (or more, if the underlying `NSString` is has unusual performance characteristics)." } ] }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 5286, + "key.offset" : 5295, "key.parsed_declaration" : "public func <*> (f: T -> U, value: Result>) -> Result>", "key.doc.comment" : "Applies `f` to the value in the given result.\n\nIn the context of command-line option parsing, this is used to chain\ntogether the parsing of multiple arguments. See OptionsType for an example.", "key.namelength" : 82, @@ -957,14 +947,15 @@ "key.length" : 82, "key.doc.column" : 13, "key.parsed_scope.end" : 161, - "key.usr" : "s:ZF10Commandantoi3lmgU____FTFQ_Q0_GO8LlamaKit6ResultQ_GOS_15CommandantErrorQ1____GS1_Q0_GS2_Q1___", + "key.usr" : "s:ZF10Commandantoi3lmgu1_rFTFq_q0_GO6Result6Resultq_GOS_15CommandantErrorq1____GS1_q0_GS2_q1___", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 5286, - "key.annotated_decl" : "public func <*><T, U, ClientError>(f: T -> U, value: Result<\/Type><T, CommandantError<\/Type><ClientError>>) -> Result<\/Type><U, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 5295, + "key.annotated_decl" : "public func <*><T, U, ClientError>(f: T -> U, value: Result<\/Type><T, CommandantError<\/Type><ClientError>>) -> Result<\/Type><U, CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 159, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 5413, + "key.bodyoffset" : 5422, + "key.doc.declaration" : "public func <*>(f: T -> U, value: Result>) -> Result.Result>", "key.name" : "<*>(_:_:)", "key.typename" : " (T -> U, Result>) -> Result>", "key.doc.type" : "Function", @@ -975,33 +966,41 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "<*><T, U, ClientError>(_: Result<(T -> U), CommandantError<ClientError>>, _: Result<T, CommandantError<ClientError>>) -> Result<U, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<*><T, U, ClientError>(_: Result<(T -> U), CommandantError<ClientError>>, _: Result<T, CommandantError<ClientError>>) -> Result<U, CommandantError<ClientError>><\/RelatedName>" } ], - "key.doc.full_as_xml" : "<*>(_:_:)<\/Name>s:ZF10Commandantoi3lmgU____FTFQ_Q0_GO8LlamaKit6ResultQ_GOS_15CommandantErrorQ1____GS1_Q0_GS2_Q1___<\/USR>public func <*><T, U, ClientError>(f: T -> U, value: Result<T, CommandantError<ClientError>>) -> Result<U, CommandantError<ClientError>><\/Declaration>Applies ]]><\/rawHTML>f]]><\/rawHTML> to the value in the given result.<\/Para><\/Abstract>In the context of command-line option parsing, this is used to chain\ntogether the parsing of multiple arguments. See OptionsType for an example.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "<*>(_:_:)<\/Name>s:ZF10Commandantoi3lmgu1_rFTFq_q0_GO6Result6Resultq_GOS_15CommandantErrorq1____GS1_q0_GS2_q1___<\/USR>public func <*><T, U, ClientError>(f: T -> U, value: Result<T, CommandantError<ClientError>>) -> Result.Result<U, Commandant.CommandantError<ClientError>><\/Declaration>Applies f<\/codeVoice> to the value in the given result.<\/Para><\/Abstract>In the context of command-line option parsing, this is used to chain together the parsing of multiple arguments. See OptionsType for an example.<\/Para><\/Discussion><\/Function>", + "key.doc.name" : "<*>(_:_:)", "key.substructure" : [ + ], + "key.doc.usr" : "s:ZF10Commandantoi3lmgu1_rFTFq_q0_GO6Result6Resultq_GOS_15CommandantErrorq1____GS1_q0_GS2_q1___", + "key.doc.discussion" : [ + { + "Para" : "In the context of command-line option parsing, this is used to chain together the parsing of multiple arguments. See OptionsType for an example." + } ] }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 5673, + "key.offset" : 5682, "key.parsed_declaration" : "public func <*> (f: Result<(T -> U), CommandantError>, value: Result>) -> Result>", "key.doc.comment" : "Applies the function in `f` to the value in the given result.\n\nIn the context of command-line option parsing, this is used to chain\ntogether the parsing of multiple arguments. See OptionsType for an example.", "key.namelength" : 122, "key.doc.line" : 167, - "key.bodylength" : 378, + "key.bodylength" : 351, "key.length" : 122, "key.doc.column" : 13, "key.parsed_scope.end" : 182, - "key.usr" : "s:ZF10Commandantoi3lmgU____FTGO8LlamaKit6ResultFQ_Q0_GOS_15CommandantErrorQ1___GS1_Q_GS2_Q1____GS1_Q0_GS2_Q1___", + "key.usr" : "s:ZF10Commandantoi3lmgu1_rFTGO6Result6ResultFq_q0_GOS_15CommandantErrorq1___GS1_q_GS2_q1____GS1_q0_GS2_q1___", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 5673, - "key.annotated_decl" : "public func <*><T, U, ClientError>(f: Result<\/Type><(T -> U), CommandantError<\/Type><ClientError>>, value: Result<\/Type><T, CommandantError<\/Type><ClientError>>) -> Result<\/Type><U, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 5682, + "key.annotated_decl" : "public func <*><T, U, ClientError>(f: Result<\/Type><(T -> U), CommandantError<\/Type><ClientError>>, value: Result<\/Type><T, CommandantError<\/Type><ClientError>>) -> Result<\/Type><U, CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 167, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 5840, + "key.bodyoffset" : 5849, + "key.doc.declaration" : "public func <*>(f: Result<(T -> U), CommandantError>, value: Result>) -> Result.Result>", "key.name" : "<*>(_:_:)", "key.typename" : " (Result<(T -> U), CommandantError>, Result>) -> Result>", "key.doc.type" : "Function", @@ -1012,33 +1011,41 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "<*><T, U, ClientError>(_: T -> U, _: Result<T, CommandantError<ClientError>>) -> Result<U, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<*><T, U, ClientError>(_: T -> U, _: Result<T, CommandantError<ClientError>>) -> Result<U, CommandantError<ClientError>><\/RelatedName>" } ], - "key.doc.full_as_xml" : "<*>(_:_:)<\/Name>s:ZF10Commandantoi3lmgU____FTGO8LlamaKit6ResultFQ_Q0_GOS_15CommandantErrorQ1___GS1_Q_GS2_Q1____GS1_Q0_GS2_Q1___<\/USR>public func <*><T, U, ClientError>(f: Result<(T -> U), CommandantError<ClientError>>, value: Result<T, CommandantError<ClientError>>) -> Result<U, CommandantError<ClientError>><\/Declaration>Applies the function in ]]><\/rawHTML>f]]><\/rawHTML> to the value in the given result.<\/Para><\/Abstract>In the context of command-line option parsing, this is used to chain\ntogether the parsing of multiple arguments. See OptionsType for an example.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "<*>(_:_:)<\/Name>s:ZF10Commandantoi3lmgu1_rFTGO6Result6ResultFq_q0_GOS_15CommandantErrorq1___GS1_q_GS2_q1____GS1_q0_GS2_q1___<\/USR>public func <*><T, U, ClientError>(f: Result<(T -> U), CommandantError<ClientError>>, value: Result<T, CommandantError<ClientError>>) -> Result.Result<U, Commandant.CommandantError<ClientError>><\/Declaration>Applies the function in f<\/codeVoice> to the value in the given result.<\/Para><\/Abstract>In the context of command-line option parsing, this is used to chain together the parsing of multiple arguments. See OptionsType for an example.<\/Para><\/Discussion><\/Function>", + "key.doc.name" : "<*>(_:_:)", "key.substructure" : [ + ], + "key.doc.usr" : "s:ZF10Commandantoi3lmgu1_rFTGO6Result6ResultFq_q0_GOS_15CommandantErrorq1___GS1_q_GS2_q1____GS1_q0_GS2_q1___", + "key.doc.discussion" : [ + { + "Para" : "In the context of command-line option parsing, this is used to chain together the parsing of multiple arguments. See OptionsType for an example." + } ] }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 6415, + "key.offset" : 6397, "key.parsed_declaration" : "public func <| (mode: CommandMode, option: Option) -> Result>", "key.doc.comment" : "Evaluates the given option in the given mode.\n\nIf parsing command line arguments, and no value was specified on the command\nline, the option's `defaultValue` is used.", "key.namelength" : 71, "key.doc.line" : 188, - "key.bodylength" : 952, + "key.bodylength" : 946, "key.length" : 71, "key.doc.column" : 13, "key.parsed_scope.end" : 225, - "key.usr" : "s:ZF10Commandantoi2loUS_12ArgumentType___FTOS_11CommandModeGVS_6OptionQ___GO8LlamaKit6ResultQ_GOS_15CommandantErrorQ0___", + "key.usr" : "s:ZF10Commandantoi2lou0_Rq_S_12ArgumentType_FTOS_11CommandModeGVS_6Optionq___GO6Result6Resultq_GOS_15CommandantErrorq0___", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 6415, - "key.annotated_decl" : "public func <|<T : ArgumentType<\/Type>, ClientError>(mode: CommandMode<\/Type>, option: Option<\/Type><T>) -> Result<\/Type><T, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 6397, + "key.annotated_decl" : "public func <|<T : ArgumentType<\/Type>, ClientError>(mode: CommandMode<\/Type>, option: Option<\/Type><T>) -> Result<\/Type><T, CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 188, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 6531, + "key.bodyoffset" : 6513, + "key.doc.declaration" : "public func <|(mode: CommandMode, option: Option) -> Result.Result>", "key.name" : "<|(_:_:)", "key.typename" : " (CommandMode, Option) -> Result>", "key.doc.type" : "Function", @@ -1049,36 +1056,44 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Option<Bool>) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Option<Bool>) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" }, { - "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Switch) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Switch) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" } ], - "key.doc.full_as_xml" : "<|(_:_:)<\/Name>s:ZF10Commandantoi2loUS_12ArgumentType___FTOS_11CommandModeGVS_6OptionQ___GO8LlamaKit6ResultQ_GOS_15CommandantErrorQ0___<\/USR>public func <|<T : ArgumentType, ClientError>(mode: CommandMode, option: Option<T>) -> Result<T, CommandantError<ClientError>><\/Declaration>Evaluates the given option in the given mode.<\/Para><\/Abstract>If parsing command line arguments, and no value was specified on the command\nline, the option's ]]><\/rawHTML>defaultValue]]><\/rawHTML> is used.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "<|(_:_:)<\/Name>s:ZF10Commandantoi2lou0_Rq_S_12ArgumentType_FTOS_11CommandModeGVS_6Optionq___GO6Result6Resultq_GOS_15CommandantErrorq0___<\/USR>public func <|<T : ArgumentType, ClientError>(mode: CommandMode, option: Option<T>) -> Result.Result<T, Commandant.CommandantError<ClientError>><\/Declaration>Evaluates the given option in the given mode.<\/Para><\/Abstract>If parsing command line arguments, and no value was specified on the command line, the option's defaultValue<\/codeVoice> is used.<\/Para><\/Discussion><\/Function>", + "key.doc.name" : "<|(_:_:)", "key.substructure" : [ + ], + "key.doc.usr" : "s:ZF10Commandantoi2lou0_Rq_S_12ArgumentType_FTOS_11CommandModeGVS_6Optionq___GO6Result6Resultq_GOS_15CommandantErrorq0___", + "key.doc.discussion" : [ + { + "Para" : "If parsing command line arguments, and no value was specified on the command line, the option's `defaultValue` is used." + } ] }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 7688, + "key.offset" : 7664, "key.parsed_declaration" : "public func <| (mode: CommandMode, option: Option) -> Result>", "key.doc.comment" : "Evaluates the given boolean option in the given mode.\n\nIf parsing command line arguments, and no value was specified on the command\nline, the option's `defaultValue` is used.", "key.namelength" : 57, "key.doc.line" : 231, - "key.bodylength" : 394, + "key.bodylength" : 398, "key.length" : 57, "key.doc.column" : 13, "key.parsed_scope.end" : 247, - "key.usr" : "s:ZF10Commandantoi2loU__FTOS_11CommandModeGVS_6OptionSb__GO8LlamaKit6ResultSbGOS_15CommandantErrorQ___", + "key.usr" : "s:ZF10Commandantoi2lourFTOS_11CommandModeGVS_6OptionSb__GO6Result6ResultSbGOS_15CommandantErrorq___", "key.doc.file" : "Commandant\/Option.swift", - "key.nameoffset" : 7688, - "key.annotated_decl" : "public func <|<ClientError>(mode: CommandMode<\/Type>, option: Option<\/Type><Bool<\/Type>>) -> Result<\/Type><Bool<\/Type>, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 7664, + "key.annotated_decl" : "public func <|<ClientError>(mode: CommandMode<\/Type>, option: Option<\/Type><Bool<\/Type>>) -> Result<\/Type><Bool<\/Type>, CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 231, "key.filepath" : "Commandant\/Option.swift", - "key.bodyoffset" : 7793, + "key.bodyoffset" : 7769, + "key.doc.declaration" : "public func <|(mode: CommandMode, option: Option) -> Result.Result>", "key.name" : "<|(_:_:)", "key.typename" : " (CommandMode, Option) -> Result>", "key.doc.type" : "Function", @@ -1089,45 +1104,59 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "<|<T : ArgumentType, ClientError>(_: CommandMode, _: Option<T>) -> Result<T, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<|<T : ArgumentType, ClientError>(_: CommandMode, _: Option<T>) -> Result<T, CommandantError<ClientError>><\/RelatedName>" }, { - "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Switch) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Switch) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" } ], - "key.doc.full_as_xml" : "<|(_:_:)<\/Name>s:ZF10Commandantoi2loU__FTOS_11CommandModeGVS_6OptionSb__GO8LlamaKit6ResultSbGOS_15CommandantErrorQ___<\/USR>public func <|<ClientError>(mode: CommandMode, option: Option<Bool>) -> Result<Bool, CommandantError<ClientError>><\/Declaration>Evaluates the given boolean option in the given mode.<\/Para><\/Abstract>If parsing command line arguments, and no value was specified on the command\nline, the option's ]]><\/rawHTML>defaultValue]]><\/rawHTML> is used.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "<|(_:_:)<\/Name>s:ZF10Commandantoi2lourFTOS_11CommandModeGVS_6OptionSb__GO6Result6ResultSbGOS_15CommandantErrorq___<\/USR>public func <|<ClientError>(mode: CommandMode, option: Option<Bool>) -> Result.Result<Bool, Commandant.CommandantError<ClientError>><\/Declaration>Evaluates the given boolean option in the given mode.<\/Para><\/Abstract>If parsing command line arguments, and no value was specified on the command line, the option's defaultValue<\/codeVoice> is used.<\/Para><\/Discussion><\/Function>", + "key.doc.name" : "<|(_:_:)", "key.substructure" : [ + ], + "key.doc.usr" : "s:ZF10Commandantoi2lourFTOS_11CommandModeGVS_6OptionSb__GO6Result6ResultSbGOS_15CommandantErrorq___", + "key.doc.discussion" : [ + { + "Para" : "If parsing command line arguments, and no value was specified on the command line, the option's `defaultValue` is used." + } ] } ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 8189 + "key.length" : 8169 } }, { "Commandant\/Errors.swift" : { "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 351, - "key.parsed_declaration" : "public enum CommandantError", + "key.offset" : 349, + "key.parsed_declaration" : "public enum CommandantError: ErrorType", "key.doc.comment" : "Possible errors that can originate from Commandant.\n\n`ClientError` should be the type of error (if any) that can occur when\nrunning commands.", "key.namelength" : 15, "key.doc.line" : 16, - "key.bodylength" : 162, + "key.bodylength" : 157, "key.length" : 15, "key.doc.column" : 13, "key.parsed_scope.end" : 22, "key.usr" : "s:O10Commandant15CommandantError", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 351, - "key.annotated_decl" : "public enum CommandantError<ClientError><\/Declaration>", + "key.nameoffset" : 349, + "key.annotated_decl" : "public enum CommandantError<ClientError> : ErrorType<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 379, + "key.length" : 9 + } + ], "key.parsed_scope.start" : 16, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 381, - "key.doc.declaration" : "public enum CommandantError", + "key.bodyoffset" : 390, + "key.doc.declaration" : "public enum CommandantError : ErrorType", "key.name" : "CommandantError", "key.typename" : "CommandantError.Type", "key.doc.type" : "Other", @@ -1136,92 +1165,129 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "CommandantError<\/Name>s:O10Commandant15CommandantError<\/USR>public enum CommandantError<ClientError><\/Declaration>Possible errors that can originate from Commandant.<\/Para><\/Abstract>]]><\/rawHTML>ClientError]]><\/rawHTML> should be the type of error (if any) that can occur when\nrunning commands.<\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "CommandantError<\/Name>s:O10Commandant15CommandantError<\/USR>public enum CommandantError<ClientError> : ErrorType<\/Declaration>Possible errors that can originate from Commandant.<\/Para><\/Abstract>ClientError<\/codeVoice> should be the type of error (if any) that can occur when running commands.<\/Para><\/Discussion><\/Other>", "key.doc.name" : "CommandantError", + "key.inheritedtypes" : [ + { + "key.name" : "ErrorType" + } + ], "key.substructure" : [ { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 512, - "key.parsed_declaration" : "case CommandError(Box)", - "key.doc.comment" : "An error occurred while running a command.", - "key.doc.line" : 21, - "key.length" : 12, - "key.typename" : " CommandantError.Type -> (Box) -> CommandantError", - "key.name" : "CommandError", - "key.doc.column" : 7, - "key.parsed_scope.end" : 21, - "key.usr" : "s:FO10Commandant15CommandantError12CommandErrorU__FMGS0_Q__FGC8LlamaKit3BoxQ__GS0_Q__", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/Errors.swift", - "key.doc.full_as_xml" : "CommandError<\/Name>s:FO10Commandant15CommandantError12CommandErrorU__FMGS0_Q__FGC8LlamaKit3BoxQ__GS0_Q__<\/USR><\/Declaration>An error occurred while running a command.<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "CommandError", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10Commandant15CommandantError12CommandErrorU__FMGS0_Q__FGC8LlamaKit3BoxQ__GS0_Q__", - "key.parsed_scope.start" : 21, - "key.filepath" : "Commandant\/Errors.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 434, + "key.parsed_declaration" : "case UsageError(description: String)", + "key.doc.comment" : "An option was used incorrectly.", + "key.namelength" : 10, + "key.doc.line" : 18, + "key.length" : 10, + "key.name" : "UsageError", + "key.typename" : " CommandantError.Type -> (description: String) -> CommandantError", + "key.doc.column" : 7, + "key.parsed_scope.end" : 18, + "key.usr" : "s:FO10Commandant15CommandantError10UsageErrorurFMGS0_q__FT11descriptionSS_GS0_q__", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/Errors.swift", + "key.doc.full_as_xml" : "UsageError<\/Name>s:FO10Commandant15CommandantError10UsageErrorurFMGS0_q__FT11descriptionSS_GS0_q__<\/USR><\/Declaration>An option was used incorrectly.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 434, + "key.doc.name" : "UsageError", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:FO10Commandant15CommandantError10UsageErrorurFMGS0_q__FT11descriptionSS_GS0_q__", + "key.parsed_scope.start" : 18, + "key.filepath" : "Commandant\/Errors.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 429, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 36 }, { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 425, - "key.parsed_declaration" : "case UsageError(description: String)", - "key.doc.comment" : "An option was used incorrectly.", - "key.doc.line" : 18, - "key.length" : 10, - "key.typename" : " CommandantError.Type -> (description: String) -> CommandantError", - "key.name" : "UsageError", - "key.doc.column" : 7, - "key.parsed_scope.end" : 18, - "key.usr" : "s:FO10Commandant15CommandantError10UsageErrorU__FMGS0_Q__FT11descriptionSS_GS0_Q__", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/Errors.swift", - "key.doc.full_as_xml" : "UsageError<\/Name>s:FO10Commandant15CommandantError10UsageErrorU__FMGS0_Q__FT11descriptionSS_GS0_Q__<\/USR><\/Declaration>An option was used incorrectly.<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "UsageError", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10Commandant15CommandantError10UsageErrorU__FMGS0_Q__FT11descriptionSS_GS0_Q__", - "key.parsed_scope.start" : 18, - "key.filepath" : "Commandant\/Errors.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 521, + "key.parsed_declaration" : "case CommandError(ClientError)", + "key.doc.comment" : "An error occurred while running a command.", + "key.namelength" : 12, + "key.doc.line" : 21, + "key.length" : 12, + "key.name" : "CommandError", + "key.typename" : " CommandantError.Type -> (ClientError) -> CommandantError", + "key.doc.column" : 7, + "key.parsed_scope.end" : 21, + "key.usr" : "s:FO10Commandant15CommandantError12CommandErrorurFMGS0_q__Fq_GS0_q__", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/Errors.swift", + "key.doc.full_as_xml" : "CommandError<\/Name>s:FO10Commandant15CommandantError12CommandErrorurFMGS0_q__Fq_GS0_q__<\/USR><\/Declaration>An error occurred while running a command.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 521, + "key.doc.name" : "CommandError", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:FO10Commandant15CommandantError12CommandErrorurFMGS0_q__Fq_GS0_q__", + "key.parsed_scope.start" : 21, + "key.filepath" : "Commandant\/Errors.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 516, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 30 } ], "key.doc.usr" : "s:O10Commandant15CommandantError", "key.doc.discussion" : [ { - "Para" : "ClientError<\/code> should be the type of error (if any) that can occur when\nrunning commands." + "Para" : "`ClientError` should be the type of error (if any) that can occur when running commands." } ] }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 351, + "key.offset" : 349, "key.doc.comment" : "Possible errors that can originate from Commandant.\n\n`ClientError` should be the type of error (if any) that can occur when\nrunning commands.", "key.namelength" : 15, - "key.bodyoffset" : 584, - "key.bodylength" : 177, - "key.length" : 15, "key.doc.line" : 16, - "key.name" : "CommandantError", - "key.typename" : "CommandantError.Type", - "key.doc.declaration" : "public enum CommandantError", + "key.bodylength" : 175, + "key.length" : 15, "key.doc.column" : 13, "key.usr" : "s:O10Commandant15CommandantError", - "key.doc.type" : "Other", "key.doc.file" : "Commandant\/Errors.swift", - "key.doc.full_as_xml" : "CommandantError<\/Name>s:O10Commandant15CommandantError<\/USR>public enum CommandantError<ClientError><\/Declaration>Possible errors that can originate from Commandant.<\/Para><\/Abstract>]]><\/rawHTML>ClientError]]><\/rawHTML> should be the type of error (if any) that can occur when\nrunning commands.<\/Para><\/Discussion><\/Other>", - "key.nameoffset" : 556, + "key.nameoffset" : 560, + "key.annotated_decl" : "public enum CommandantError<ClientError> : ErrorType<\/Type><\/Declaration>", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 577, + "key.length" : 23 + } + ], + "key.filepath" : "Commandant\/Errors.swift", + "key.bodyoffset" : 602, + "key.doc.declaration" : "public enum CommandantError : ErrorType", + "key.name" : "CommandantError", + "key.typename" : "CommandantError.Type", + "key.doc.type" : "Other", + "key.doc.full_as_xml" : "CommandantError<\/Name>s:O10Commandant15CommandantError<\/USR>public enum CommandantError<ClientError> : ErrorType<\/Declaration>Possible errors that can originate from Commandant.<\/Para><\/Abstract>ClientError<\/codeVoice> should be the type of error (if any) that can occur when running commands.<\/Para><\/Discussion><\/Other>", "key.doc.name" : "CommandantError", "key.inheritedtypes" : [ { - "key.name" : "Printable" + "key.name" : "CustomStringConvertible" } ], - "key.annotated_decl" : "public enum CommandantError<ClientError><\/Declaration>", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 597, + "key.offset" : 615, "key.parsed_declaration" : "public var description: String", "key.namelength" : 11, - "key.bodyoffset" : 618, - "key.bodylength" : 141, + "key.bodyoffset" : 636, + "key.bodylength" : 139, "key.length" : 11, "key.typename" : "String", "key.name" : "description", @@ -1229,30 +1295,26 @@ "key.usr" : "s:vO10Commandant15CommandantError11descriptionSS", "key.overrides" : [ { - "key.usr" : "s:vPSs9Printable11descriptionSS" + "key.usr" : "s:vPSs23CustomStringConvertible11descriptionSS" } ], - "key.nameoffset" : 597, + "key.nameoffset" : 615, "key.annotated_decl" : "public var description: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 25, "key.filepath" : "Commandant\/Errors.swift" } ], "key.doc.usr" : "s:O10Commandant15CommandantError", - "key.filepath" : "Commandant\/Errors.swift", "key.doc.discussion" : [ { - "Para" : "ClientError<\/code> should be the type of error (if any) that can occur when\nrunning commands." + "Para" : "`ClientError` should be the type of error (if any) that can occur when running commands." } ] }, { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 837, + "key.offset" : 853, "key.parsed_declaration" : "internal enum NoError {}", "key.doc.comment" : "Used to represent that a ClientError will never occur.", "key.namelength" : 7, @@ -1263,12 +1325,12 @@ "key.parsed_scope.end" : 37, "key.usr" : "s:O10Commandant7NoError", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 837, + "key.nameoffset" : 853, "key.annotated_decl" : "internal enum NoError<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 37, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 846, + "key.bodyoffset" : 862, "key.doc.declaration" : "internal enum NoError", "key.name" : "NoError", "key.typename" : "NoError.Type", @@ -1280,14 +1342,11 @@ ], "key.doc.full_as_xml" : "NoError<\/Name>s:O10Commandant7NoError<\/USR>internal enum NoError<\/Declaration>Used to represent that a ClientError will never occur.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "NoError", - "key.substructure" : [ - - ], "key.doc.usr" : "s:O10Commandant7NoError" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 976, + "key.offset" : 992, "key.parsed_declaration" : "internal func missingArgumentError(argumentName: String) -> CommandantError", "key.doc.comment" : "Constructs an `InvalidArgument` error that indicates a missing value for\nthe argument by the given name.", "key.namelength" : 55, @@ -1296,15 +1355,15 @@ "key.length" : 55, "key.doc.column" : 15, "key.parsed_scope.end" : 44, - "key.usr" : "s:F10Commandant20missingArgumentErrorU__FSSGOS_15CommandantErrorQ__", + "key.usr" : "s:F10Commandant20missingArgumentErrorurFSSGOS_15CommandantErrorq__", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 976, + "key.nameoffset" : 992, "key.annotated_decl" : "internal func missingArgumentError<ClientError>(argumentName: String<\/Type>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 41, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 1065, - "key.doc.declaration" : "internal func missingArgumentError(argumentName: String) -> CommandantError", + "key.bodyoffset" : 1081, + "key.doc.declaration" : "internal func missingArgumentError(argumentName: String) -> Commandant.CommandantError", "key.name" : "missingArgumentError(_:)", "key.typename" : " (String) -> CommandantError", "key.doc.type" : "Function", @@ -1313,35 +1372,35 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "missingArgumentError(_:)<\/Name>s:F10Commandant20missingArgumentErrorU__FSSGOS_15CommandantErrorQ__<\/USR>internal func missingArgumentError<ClientError>(argumentName: String) -> CommandantError<ClientError><\/Declaration>Constructs an ]]><\/rawHTML>InvalidArgument]]><\/rawHTML> error that indicates a missing value for\nthe argument by the given name.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "missingArgumentError(_:)<\/Name>s:F10Commandant20missingArgumentErrorurFSSGOS_15CommandantErrorq__<\/USR>internal func missingArgumentError<ClientError>(argumentName: String) -> Commandant.CommandantError<ClientError><\/Declaration>Constructs an InvalidArgument<\/codeVoice> error that indicates a missing value for the argument by the given name.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "missingArgumentError(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:F10Commandant20missingArgumentErrorU__FSSGOS_15CommandantErrorQ__" + "key.doc.usr" : "s:F10Commandant20missingArgumentErrorurFSSGOS_15CommandantErrorq__" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 1302, + "key.offset" : 1318, "key.parsed_declaration" : "internal func informativeUsageError(keyValueExample: String, usage: String) -> CommandantError", "key.doc.comment" : "Constructs an error by combining the example of key (and value, if applicable)\nwith the usage description.", "key.namelength" : 74, "key.doc.line" : 48, - "key.bodylength" : 220, + "key.bodylength" : 219, "key.length" : 74, "key.doc.column" : 15, "key.parsed_scope.end" : 54, - "key.usr" : "s:F10Commandant21informativeUsageErrorU__FTSSSS_GOS_15CommandantErrorQ__", + "key.usr" : "s:F10Commandant21informativeUsageErrorurFTSS5usageSS_GOS_15CommandantErrorq__", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 1302, + "key.nameoffset" : 1318, "key.annotated_decl" : "internal func informativeUsageError<ClientError>(keyValueExample: String<\/Type>, usage: String<\/Type>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 48, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 1410, - "key.doc.declaration" : "internal func informativeUsageError(keyValueExample: String, usage: String) -> CommandantError", - "key.name" : "informativeUsageError(_:_:)", - "key.typename" : " (String, String) -> CommandantError", + "key.bodyoffset" : 1426, + "key.doc.declaration" : "internal func informativeUsageError(keyValueExample: String, usage: String) -> Commandant.CommandantError", + "key.name" : "informativeUsageError(_:usage:)", + "key.typename" : " (String, usage: String) -> CommandantError", "key.doc.type" : "Function", "key.attributes" : [ { @@ -1350,44 +1409,44 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "informativeUsageError<T, ClientError>(_: String, _: Option<T>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError(_:option:)<\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<T : ArgumentType, ClientError>(_: Option<T>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError<T : ArgumentType, ClientError>(_: Option<T>) -> CommandantError<ClientError><\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<ClientError>(_: Option<Bool>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError<ClientError>(_: Option<Bool>) -> CommandantError<ClientError><\/RelatedName>" } ], - "key.doc.full_as_xml" : "informativeUsageError(_:_:)<\/Name>s:F10Commandant21informativeUsageErrorU__FTSSSS_GOS_15CommandantErrorQ__<\/USR>internal func informativeUsageError<ClientError>(keyValueExample: String, usage: String) -> CommandantError<ClientError><\/Declaration>Constructs an error by combining the example of key (and value, if applicable)\nwith the usage description.<\/Para><\/Abstract><\/Function>", - "key.doc.name" : "informativeUsageError(_:_:)", + "key.doc.full_as_xml" : "informativeUsageError(_:usage:)<\/Name>s:F10Commandant21informativeUsageErrorurFTSS5usageSS_GOS_15CommandantErrorq__<\/USR>internal func informativeUsageError<ClientError>(keyValueExample: String, usage: String) -> Commandant.CommandantError<ClientError><\/Declaration>Constructs an error by combining the example of key (and value, if applicable) with the usage description.<\/Para><\/Abstract><\/Function>", + "key.doc.name" : "informativeUsageError(_:usage:)", "key.substructure" : [ ], - "key.doc.usr" : "s:F10Commandant21informativeUsageErrorU__FTSSSS_GOS_15CommandantErrorQ__" + "key.doc.usr" : "s:F10Commandant21informativeUsageErrorurFTSS5usageSS_GOS_15CommandantErrorq__" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 1777, + "key.offset" : 1792, "key.parsed_declaration" : "internal func informativeUsageError(keyValueExample: String, option: Option) -> CommandantError", "key.doc.comment" : "Constructs an error that describes how to use the option, with the given\nexample of key (and value, if applicable) usage.", "key.namelength" : 81, "key.doc.line" : 58, - "key.bodylength" : 178, + "key.bodylength" : 192, "key.length" : 81, "key.doc.column" : 15, "key.parsed_scope.end" : 64, - "key.usr" : "s:F10Commandant21informativeUsageErrorU___FTSSGVS_6OptionQ___GOS_15CommandantErrorQ0__", + "key.usr" : "s:F10Commandant21informativeUsageErroru0_rFTSS6optionGVS_6Optionq___GOS_15CommandantErrorq0__", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 1777, + "key.nameoffset" : 1792, "key.annotated_decl" : "internal func informativeUsageError<T, ClientError>(keyValueExample: String<\/Type>, option: Option<\/Type><T>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 58, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 1892, - "key.doc.declaration" : "internal func informativeUsageError(keyValueExample: String, option: Option) -> CommandantError", - "key.name" : "informativeUsageError(_:_:)", - "key.typename" : " (String, Option) -> CommandantError", + "key.bodyoffset" : 1907, + "key.doc.declaration" : "internal func informativeUsageError(keyValueExample: String, option: Option) -> Commandant.CommandantError", + "key.name" : "informativeUsageError(_:option:)", + "key.typename" : " (String, option: Option) -> CommandantError", "key.doc.type" : "Function", "key.attributes" : [ { @@ -1396,42 +1455,42 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "informativeUsageError<ClientError>(_: String, _: String) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError(_:usage:)<\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<T : ArgumentType, ClientError>(_: Option<T>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError<T : ArgumentType, ClientError>(_: Option<T>) -> CommandantError<ClientError><\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<ClientError>(_: Option<Bool>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError<ClientError>(_: Option<Bool>) -> CommandantError<ClientError><\/RelatedName>" } ], - "key.doc.full_as_xml" : "informativeUsageError(_:_:)<\/Name>s:F10Commandant21informativeUsageErrorU___FTSSGVS_6OptionQ___GOS_15CommandantErrorQ0__<\/USR>internal func informativeUsageError<T, ClientError>(keyValueExample: String, option: Option<T>) -> CommandantError<ClientError><\/Declaration>Constructs an error that describes how to use the option, with the given\nexample of key (and value, if applicable) usage.<\/Para><\/Abstract><\/Function>", - "key.doc.name" : "informativeUsageError(_:_:)", + "key.doc.full_as_xml" : "informativeUsageError(_:option:)<\/Name>s:F10Commandant21informativeUsageErroru0_rFTSS6optionGVS_6Optionq___GOS_15CommandantErrorq0__<\/USR>internal func informativeUsageError<T, ClientError>(keyValueExample: String, option: Option<T>) -> Commandant.CommandantError<ClientError><\/Declaration>Constructs an error that describes how to use the option, with the given example of key (and value, if applicable) usage.<\/Para><\/Abstract><\/Function>", + "key.doc.name" : "informativeUsageError(_:option:)", "key.substructure" : [ ], - "key.doc.usr" : "s:F10Commandant21informativeUsageErrorU___FTSSGVS_6OptionQ___GOS_15CommandantErrorQ0__" + "key.doc.usr" : "s:F10Commandant21informativeUsageErroru0_rFTSS6optionGVS_6Optionq___GOS_15CommandantErrorq0__" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 2149, + "key.offset" : 2178, "key.parsed_declaration" : "internal func informativeUsageError(option: Option) -> CommandantError", "key.doc.comment" : "Constructs an error that describes how to use the option.", "key.namelength" : 70, "key.doc.line" : 67, - "key.bodylength" : 324, + "key.bodylength" : 332, "key.length" : 70, "key.doc.column" : 15, "key.parsed_scope.end" : 86, - "key.usr" : "s:F10Commandant21informativeUsageErrorUS_12ArgumentType___FGVS_6OptionQ__GOS_15CommandantErrorQ0__", + "key.usr" : "s:F10Commandant21informativeUsageErroru0_Rq_S_12ArgumentType_FGVS_6Optionq__GOS_15CommandantErrorq0__", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 2149, + "key.nameoffset" : 2178, "key.annotated_decl" : "internal func informativeUsageError<T : ArgumentType<\/Type>, ClientError>(option: Option<\/Type><T>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 67, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 2253, - "key.doc.declaration" : "internal func informativeUsageError(option: Option) -> CommandantError", + "key.bodyoffset" : 2282, + "key.doc.declaration" : "internal func informativeUsageError(option: Option) -> Commandant.CommandantError", "key.name" : "informativeUsageError(_:)", "key.typename" : " (Option) -> CommandantError", "key.doc.type" : "Function", @@ -1442,42 +1501,42 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "informativeUsageError<ClientError>(_: String, _: String) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError(_:usage:)<\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<T, ClientError>(_: String, _: Option<T>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError(_:option:)<\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<ClientError>(_: Option<Bool>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError<ClientError>(_: Option<Bool>) -> CommandantError<ClientError><\/RelatedName>" } ], - "key.doc.full_as_xml" : "informativeUsageError(_:)<\/Name>s:F10Commandant21informativeUsageErrorUS_12ArgumentType___FGVS_6OptionQ__GOS_15CommandantErrorQ0__<\/USR>internal func informativeUsageError<T : ArgumentType, ClientError>(option: Option<T>) -> CommandantError<ClientError><\/Declaration>Constructs an error that describes how to use the option.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "informativeUsageError(_:)<\/Name>s:F10Commandant21informativeUsageErroru0_Rq_S_12ArgumentType_FGVS_6Optionq__GOS_15CommandantErrorq0__<\/USR>internal func informativeUsageError<T : ArgumentType, ClientError>(option: Option<T>) -> Commandant.CommandantError<ClientError><\/Declaration>Constructs an error that describes how to use the option.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "informativeUsageError(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:F10Commandant21informativeUsageErrorUS_12ArgumentType___FGVS_6OptionQ__GOS_15CommandantErrorQ0__" + "key.doc.usr" : "s:F10Commandant21informativeUsageErroru0_Rq_S_12ArgumentType_FGVS_6Optionq__GOS_15CommandantErrorq0__" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 2670, + "key.offset" : 2707, "key.parsed_declaration" : "internal func informativeUsageError(option: Option) -> CommandantError", "key.doc.comment" : "Constructs an error that describes how to use the given boolean option.", "key.namelength" : 56, "key.doc.line" : 89, - "key.bodylength" : 257, + "key.bodylength" : 273, "key.length" : 56, "key.doc.column" : 15, "key.parsed_scope.end" : 99, - "key.usr" : "s:F10Commandant21informativeUsageErrorU__FGVS_6OptionSb_GOS_15CommandantErrorQ__", + "key.usr" : "s:F10Commandant21informativeUsageErrorurFGVS_6OptionSb_GOS_15CommandantErrorq__", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 2670, + "key.nameoffset" : 2707, "key.annotated_decl" : "internal func informativeUsageError<ClientError>(option: Option<\/Type><Bool<\/Type>>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 89, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 2760, - "key.doc.declaration" : "internal func informativeUsageError(option: Option) -> CommandantError", + "key.bodyoffset" : 2797, + "key.doc.declaration" : "internal func informativeUsageError(option: Option) -> Commandant.CommandantError", "key.name" : "informativeUsageError(_:)", "key.typename" : " (Option) -> CommandantError", "key.doc.type" : "Function", @@ -1488,25 +1547,25 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "informativeUsageError<ClientError>(_: String, _: String) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError(_:usage:)<\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<T, ClientError>(_: String, _: Option<T>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError(_:option:)<\/RelatedName>" }, { - "key.annotated_decl" : "informativeUsageError<T : ArgumentType, ClientError>(_: Option<T>) -> CommandantError<ClientError><\/RelatedName>" + "key.annotated_decl" : "informativeUsageError<T : ArgumentType, ClientError>(_: Option<T>) -> CommandantError<ClientError><\/RelatedName>" } ], - "key.doc.full_as_xml" : "informativeUsageError(_:)<\/Name>s:F10Commandant21informativeUsageErrorU__FGVS_6OptionSb_GOS_15CommandantErrorQ__<\/USR>internal func informativeUsageError<ClientError>(option: Option<Bool>) -> CommandantError<ClientError><\/Declaration>Constructs an error that describes how to use the given boolean option.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "informativeUsageError(_:)<\/Name>s:F10Commandant21informativeUsageErrorurFGVS_6OptionSb_GOS_15CommandantErrorq__<\/USR>internal func informativeUsageError<ClientError>(option: Option<Bool>) -> Commandant.CommandantError<ClientError><\/Declaration>Constructs an error that describes how to use the given boolean option.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "informativeUsageError(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:F10Commandant21informativeUsageErrorU__FGVS_6OptionSb_GOS_15CommandantErrorQ__" + "key.doc.usr" : "s:F10Commandant21informativeUsageErrorurFGVS_6OptionSb_GOS_15CommandantErrorq__" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 3173, + "key.offset" : 3226, "key.parsed_declaration" : "internal func combineUsageErrors(lhs: CommandantError, rhs: CommandantError) -> CommandantError", "key.doc.comment" : "Combines the text of the two errors, if they're both `UsageError`s.\nOtherwise, uses whichever one is not (biased toward the left).", "key.namelength" : 101, @@ -1515,41 +1574,41 @@ "key.length" : 101, "key.doc.column" : 15, "key.parsed_scope.end" : 115, - "key.usr" : "s:F10Commandant18combineUsageErrorsU__FTGOS_15CommandantErrorQ__GS0_Q___GS0_Q__", + "key.usr" : "s:F10Commandant18combineUsageErrorsurFTGOS_15CommandantErrorq__3rhsGS0_q___GS0_q__", "key.doc.file" : "Commandant\/Errors.swift", - "key.nameoffset" : 3173, + "key.nameoffset" : 3226, "key.annotated_decl" : "internal func combineUsageErrors<ClientError>(lhs: CommandantError<\/Type><ClientError>, rhs: CommandantError<\/Type><ClientError>) -> CommandantError<\/Type><ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 103, "key.filepath" : "Commandant\/Errors.swift", - "key.bodyoffset" : 3308, - "key.doc.declaration" : "internal func combineUsageErrors(lhs: CommandantError, rhs: CommandantError) -> CommandantError", - "key.name" : "combineUsageErrors(_:_:)", - "key.typename" : " (CommandantError, CommandantError) -> CommandantError", + "key.bodyoffset" : 3361, + "key.doc.declaration" : "internal func combineUsageErrors(lhs: CommandantError, rhs: CommandantError) -> Commandant.CommandantError", + "key.name" : "combineUsageErrors(_:rhs:)", + "key.typename" : " (CommandantError, rhs: CommandantError) -> CommandantError", "key.doc.type" : "Function", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "combineUsageErrors(_:_:)<\/Name>s:F10Commandant18combineUsageErrorsU__FTGOS_15CommandantErrorQ__GS0_Q___GS0_Q__<\/USR>internal func combineUsageErrors<ClientError>(lhs: CommandantError<ClientError>, rhs: CommandantError<ClientError>) -> CommandantError<ClientError><\/Declaration>Combines the text of the two errors, if they're both `UsageError`s.\nOtherwise, uses whichever one is not (biased toward the left).<\/Para><\/Abstract><\/Function>", - "key.doc.name" : "combineUsageErrors(_:_:)", + "key.doc.full_as_xml" : "combineUsageErrors(_:rhs:)<\/Name>s:F10Commandant18combineUsageErrorsurFTGOS_15CommandantErrorq__3rhsGS0_q___GS0_q__<\/USR>internal func combineUsageErrors<ClientError>(lhs: CommandantError<ClientError>, rhs: CommandantError<ClientError>) -> Commandant.CommandantError<ClientError><\/Declaration>Combines the text of the two errors, if they're both UsageError<\/codeVoice>s. Otherwise, uses whichever one is not (biased toward the left).<\/Para><\/Abstract><\/Function>", + "key.doc.name" : "combineUsageErrors(_:rhs:)", "key.substructure" : [ ], - "key.doc.usr" : "s:F10Commandant18combineUsageErrorsU__FTGOS_15CommandantErrorQ__GS0_Q___GS0_Q__" + "key.doc.usr" : "s:F10Commandant18combineUsageErrorsurFTGOS_15CommandantErrorq__3rhsGS0_q___GS0_q__" } ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 3576 + "key.length" : 3629 } }, { "Commandant\/Switch.swift" : { "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.struct", - "key.offset" : 406, + "key.offset" : 404, "key.parsed_declaration" : "public struct Switch", "key.doc.comment" : "Describes a parameterless command line flag that defaults to false and can only\nbe switched on. Canonical examples include `--force` and `--recurse`.\n\nFor a boolean toggle that can be enabled and disabled use `Option`.", "key.namelength" : 6, @@ -1560,12 +1619,12 @@ "key.parsed_scope.end" : 36, "key.usr" : "s:V10Commandant6Switch", "key.doc.file" : "Commandant\/Switch.swift", - "key.nameoffset" : 406, + "key.nameoffset" : 404, "key.annotated_decl" : "public struct Switch<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 15, "key.filepath" : "Commandant\/Switch.swift", - "key.bodyoffset" : 414, + "key.bodyoffset" : 412, "key.doc.declaration" : "public struct Switch", "key.name" : "Switch", "key.typename" : "Switch.Type", @@ -1575,45 +1634,42 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "Switch<\/Name>s:V10Commandant6Switch<\/USR>public struct Switch<\/Declaration>Describes a parameterless command line flag that defaults to false and can only\nbe switched on. Canonical examples include ]]><\/rawHTML>--force]]><\/rawHTML> and ]]><\/rawHTML>--recurse]]><\/rawHTML>.<\/Para><\/Abstract>For a boolean toggle that can be enabled and disabled use ]]><\/rawHTML>Option<Bool>]]><\/rawHTML>.<\/Para><\/Discussion><\/Class>", + "key.doc.full_as_xml" : "Switch<\/Name>s:V10Commandant6Switch<\/USR>public struct Switch<\/Declaration>Describes a parameterless command line flag that defaults to false and can only be switched on. Canonical examples include --force<\/codeVoice> and --recurse<\/codeVoice>.<\/Para><\/Abstract>For a boolean toggle that can be enabled and disabled use Option<Bool><\/codeVoice>.<\/Para><\/Discussion><\/Class>", "key.doc.name" : "Switch", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 543, + "key.offset" : 541, "key.parsed_declaration" : "public let key: String", "key.doc.comment" : "The key that enables this switch. For example, a key of `verbose` would be\nused for a `--verbose` option.", "key.namelength" : 3, "key.doc.line" : 18, "key.length" : 3, - "key.doc.column" : 13, - "key.parsed_scope.end" : 18, - "key.usr" : "s:vV10Commandant6Switch3keySS", - "key.doc.file" : "Commandant\/Switch.swift", - "key.nameoffset" : 543, - "key.annotated_decl" : "public let key: String<\/Type><\/Declaration>", - "key.accessibility" : "source.lang.swift.accessibility.public", - "key.parsed_scope.start" : 18, - "key.filepath" : "Commandant\/Switch.swift", "key.doc.declaration" : "public let key: String", "key.typename" : "String", "key.name" : "key", + "key.doc.column" : 13, + "key.parsed_scope.end" : 18, + "key.usr" : "s:vV10Commandant6Switch3keySS", "key.doc.type" : "Other", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "key<\/Name>s:vV10Commandant6Switch3keySS<\/USR>public let key: String<\/Declaration>The key that enables this switch. For example, a key of ]]><\/rawHTML>verbose]]><\/rawHTML> would be\nused for a ]]><\/rawHTML>--verbose]]><\/rawHTML> option.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "key<\/Name>s:vV10Commandant6Switch3keySS<\/USR>public let key: String<\/Declaration>The key that enables this switch. For example, a key of verbose<\/codeVoice> would be used for a --verbose<\/codeVoice> option.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 541, + "key.doc.file" : "Commandant\/Switch.swift", + "key.annotated_decl" : "public let key: String<\/Type><\/Declaration>", "key.doc.name" : "key", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vV10Commandant6Switch3keySS" + "key.accessibility" : "source.lang.swift.accessibility.public", + "key.doc.usr" : "s:vV10Commandant6Switch3keySS", + "key.parsed_scope.start" : 18, + "key.filepath" : "Commandant\/Switch.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 856, + "key.offset" : 854, "key.parsed_declaration" : "public let flag: Character?", "key.doc.comment" : "Optional single letter flag that enables this switch. For example, `-v` would\nbe used as a shorthand for `--verbose`.\n\nMultiple flags can be grouped together as a single argument and will split\nwhen parsing (e.g. `rm -rf` treats 'r' and 'f' as inidividual flags).", "key.namelength" : 4, @@ -1623,7 +1679,7 @@ "key.parsed_scope.end" : 25, "key.usr" : "s:vV10Commandant6Switch4flagGSqVSs9Character_", "key.doc.file" : "Commandant\/Switch.swift", - "key.nameoffset" : 856, + "key.nameoffset" : 854, "key.annotated_decl" : "public let flag: Character<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 25, @@ -1637,64 +1693,58 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "flag<\/Name>s:vV10Commandant6Switch4flagGSqVSs9Character_<\/USR>public let flag: Character?<\/Declaration>Optional single letter flag that enables this switch. For example, ]]><\/rawHTML>-v]]><\/rawHTML> would\nbe used as a shorthand for ]]><\/rawHTML>--verbose]]><\/rawHTML>.<\/Para><\/Abstract>Multiple flags can be grouped together as a single argument and will split\nwhen parsing (e.g. ]]><\/rawHTML>rm -rf]]><\/rawHTML> treats 'r' and 'f' as inidividual flags).<\/Para><\/Discussion><\/Other>", + "key.doc.full_as_xml" : "flag<\/Name>s:vV10Commandant6Switch4flagGSqVSs9Character_<\/USR>public let flag: Character?<\/Declaration>Optional single letter flag that enables this switch. For example, -v<\/codeVoice> would be used as a shorthand for --verbose<\/codeVoice>.<\/Para><\/Abstract>Multiple flags can be grouped together as a single argument and will split when parsing (e.g. rm -rf<\/codeVoice> treats 'r' and 'f' as inidividual flags).<\/Para><\/Discussion><\/Other>", "key.doc.name" : "flag", - "key.substructure" : [ - - ], "key.doc.usr" : "s:vV10Commandant6Switch4flagGSqVSs9Character_", "key.doc.discussion" : [ { - "Para" : "Multiple flags can be grouped together as a single argument and will split\nwhen parsing (e.g. rm -rf<\/code> treats 'r' and 'f' as inidividual flags)." + "Para" : "Multiple flags can be grouped together as a single argument and will split when parsing (e.g. `rm -rf` treats 'r' and 'f' as inidividual flags)." } ] }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 996, + "key.offset" : 994, "key.parsed_declaration" : "public let usage: String", "key.doc.comment" : "A human-readable string describing the purpose of this option. This will\nbe shown in help messages.", "key.namelength" : 5, "key.doc.line" : 29, "key.length" : 5, - "key.doc.column" : 13, - "key.parsed_scope.end" : 29, - "key.usr" : "s:vV10Commandant6Switch5usageSS", - "key.doc.file" : "Commandant\/Switch.swift", - "key.nameoffset" : 996, - "key.annotated_decl" : "public let usage: String<\/Type><\/Declaration>", - "key.accessibility" : "source.lang.swift.accessibility.public", - "key.parsed_scope.start" : 29, - "key.filepath" : "Commandant\/Switch.swift", "key.doc.declaration" : "public let usage: String", "key.typename" : "String", "key.name" : "usage", + "key.doc.column" : 13, + "key.parsed_scope.end" : 29, + "key.usr" : "s:vV10Commandant6Switch5usageSS", "key.doc.type" : "Other", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "usage<\/Name>s:vV10Commandant6Switch5usageSS<\/USR>public let usage: String<\/Declaration>A human-readable string describing the purpose of this option. This will\nbe shown in help messages.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "usage<\/Name>s:vV10Commandant6Switch5usageSS<\/USR>public let usage: String<\/Declaration>A human-readable string describing the purpose of this option. This will be shown in help messages.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 994, + "key.doc.file" : "Commandant\/Switch.swift", + "key.annotated_decl" : "public let usage: String<\/Type><\/Declaration>", "key.doc.name" : "usage", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vV10Commandant6Switch5usageSS" + "key.accessibility" : "source.lang.swift.accessibility.public", + "key.doc.usr" : "s:vV10Commandant6Switch5usageSS", + "key.parsed_scope.start" : 29, + "key.filepath" : "Commandant\/Switch.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 1019, + "key.offset" : 1017, "key.parsed_declaration" : "public init(flag: Character? = nil, key: String, usage: String)", "key.namelength" : 56, - "key.bodyoffset" : 1077, + "key.bodyoffset" : 1075, "key.bodylength" : 59, "key.length" : 56, "key.name" : "init(flag:key:usage:)", "key.typename" : "Switch.Type -> (flag: Character?, key: String, usage: String) -> Switch", "key.parsed_scope.end" : 35, "key.usr" : "s:FV10Commandant6SwitchcFMS0_FT4flagGSqVSs9Character_3keySS5usageSS_S0_", - "key.nameoffset" : 1019, + "key.nameoffset" : 1017, "key.annotated_decl" : "public init(flag: Character<\/Type>? = default, key: String<\/Type>, usage: String<\/Type>)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.substructure" : [ @@ -1707,42 +1757,50 @@ "key.doc.usr" : "s:V10Commandant6Switch", "key.doc.discussion" : [ { - "Para" : "For a boolean toggle that can be enabled and disabled use Option<\/code>." + "Para" : "For a boolean toggle that can be enabled and disabled use `Option`." } ] }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 406, + "key.offset" : 404, "key.doc.comment" : "Describes a parameterless command line flag that defaults to false and can only\nbe switched on. Canonical examples include `--force` and `--recurse`.\n\nFor a boolean toggle that can be enabled and disabled use `Option`.", "key.namelength" : 6, - "key.bodyoffset" : 1170, + "key.doc.line" : 15, "key.bodylength" : 140, "key.length" : 6, - "key.doc.line" : 15, - "key.name" : "Switch", - "key.typename" : "Switch.Type", - "key.doc.declaration" : "public struct Switch", "key.doc.column" : 15, "key.usr" : "s:V10Commandant6Switch", - "key.doc.type" : "Class", "key.doc.file" : "Commandant\/Switch.swift", - "key.doc.full_as_xml" : "Switch<\/Name>s:V10Commandant6Switch<\/USR>public struct Switch<\/Declaration>Describes a parameterless command line flag that defaults to false and can only\nbe switched on. Canonical examples include ]]><\/rawHTML>--force]]><\/rawHTML> and ]]><\/rawHTML>--recurse]]><\/rawHTML>.<\/Para><\/Abstract>For a boolean toggle that can be enabled and disabled use ]]><\/rawHTML>Option<Bool>]]><\/rawHTML>.<\/Para><\/Discussion><\/Class>", - "key.nameoffset" : 1151, + "key.nameoffset" : 1149, + "key.annotated_decl" : "public struct Switch<\/Declaration>", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 1157, + "key.length" : 23 + } + ], + "key.filepath" : "Commandant\/Switch.swift", + "key.bodyoffset" : 1182, + "key.doc.declaration" : "public struct Switch", + "key.name" : "Switch", + "key.typename" : "Switch.Type", + "key.doc.type" : "Class", + "key.doc.full_as_xml" : "Switch<\/Name>s:V10Commandant6Switch<\/USR>public struct Switch<\/Declaration>Describes a parameterless command line flag that defaults to false and can only be switched on. Canonical examples include --force<\/codeVoice> and --recurse<\/codeVoice>.<\/Para><\/Abstract>For a boolean toggle that can be enabled and disabled use Option<Bool><\/codeVoice>.<\/Para><\/Discussion><\/Class>", "key.doc.name" : "Switch", "key.inheritedtypes" : [ { - "key.name" : "Printable" + "key.name" : "CustomStringConvertible" } ], - "key.annotated_decl" : "public struct Switch<\/Declaration>", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1183, + "key.offset" : 1195, "key.parsed_declaration" : "public var description: String", "key.namelength" : 11, - "key.bodyoffset" : 1204, + "key.bodyoffset" : 1216, "key.bodylength" : 104, "key.length" : 11, "key.typename" : "String", @@ -1751,46 +1809,43 @@ "key.usr" : "s:vV10Commandant6Switch11descriptionSS", "key.overrides" : [ { - "key.usr" : "s:vPSs9Printable11descriptionSS" + "key.usr" : "s:vPSs23CustomStringConvertible11descriptionSS" } ], - "key.nameoffset" : 1183, + "key.nameoffset" : 1195, "key.annotated_decl" : "public var description: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 39, "key.filepath" : "Commandant\/Switch.swift" } ], "key.doc.usr" : "s:V10Commandant6Switch", - "key.filepath" : "Commandant\/Switch.swift", "key.doc.discussion" : [ { - "Para" : "For a boolean toggle that can be enabled and disabled use Option<\/code>." + "Para" : "For a boolean toggle that can be enabled and disabled use `Option`." } ] }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 1515, + "key.offset" : 1527, "key.parsed_declaration" : "public func <| (mode: CommandMode, option: Switch) -> Result>", "key.doc.comment" : "Evaluates the given boolean switch in the given mode.\n\nIf parsing command line arguments, and no value was specified on the command\nline, the option's `defaultValue` is used.", "key.namelength" : 52, "key.doc.line" : 52, - "key.bodylength" : 298, + "key.bodylength" : 307, "key.length" : 52, "key.doc.column" : 13, "key.parsed_scope.end" : 64, - "key.usr" : "s:ZF10Commandantoi2loU__FTOS_11CommandModeVS_6Switch_GO8LlamaKit6ResultSbGOS_15CommandantErrorQ___", + "key.usr" : "s:ZF10Commandantoi2lourFTOS_11CommandModeVS_6Switch_GO6Result6ResultSbGOS_15CommandantErrorq___", "key.doc.file" : "Commandant\/Switch.swift", - "key.nameoffset" : 1515, - "key.annotated_decl" : "public func <|<ClientError>(mode: CommandMode<\/Type>, option: Switch<\/Type>) -> Result<\/Type><Bool<\/Type>, CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 1527, + "key.annotated_decl" : "public func <|<ClientError>(mode: CommandMode<\/Type>, option: Switch<\/Type>) -> Result<\/Type><Bool<\/Type>, CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 52, "key.filepath" : "Commandant\/Switch.swift", - "key.bodyoffset" : 1615, + "key.bodyoffset" : 1627, + "key.doc.declaration" : "public func <|(mode: CommandMode, option: Switch) -> Result.Result>", "key.name" : "<|(_:_:)", "key.typename" : " (CommandMode, Switch) -> Result>", "key.doc.type" : "Function", @@ -1801,28 +1856,35 @@ ], "key.related_decls" : [ { - "key.annotated_decl" : "<|<T : ArgumentType, ClientError>(_: CommandMode, _: Option<T>) -> Result<T, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<|<T : ArgumentType, ClientError>(_: CommandMode, _: Option<T>) -> Result<T, CommandantError<ClientError>><\/RelatedName>" }, { - "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Option<Bool>) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" + "key.annotated_decl" : "<|<ClientError>(_: CommandMode, _: Option<Bool>) -> Result<Bool, CommandantError<ClientError>><\/RelatedName>" } ], - "key.doc.full_as_xml" : "<|(_:_:)<\/Name>s:ZF10Commandantoi2loU__FTOS_11CommandModeVS_6Switch_GO8LlamaKit6ResultSbGOS_15CommandantErrorQ___<\/USR>public func <|<ClientError>(mode: CommandMode, option: Switch) -> Result<Bool, CommandantError<ClientError>><\/Declaration>Evaluates the given boolean switch in the given mode.<\/Para><\/Abstract>If parsing command line arguments, and no value was specified on the command\nline, the option's ]]><\/rawHTML>defaultValue]]><\/rawHTML> is used.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "<|(_:_:)<\/Name>s:ZF10Commandantoi2lourFTOS_11CommandModeVS_6Switch_GO6Result6ResultSbGOS_15CommandantErrorq___<\/USR>public func <|<ClientError>(mode: CommandMode, option: Switch) -> Result.Result<Bool, Commandant.CommandantError<ClientError>><\/Declaration>Evaluates the given boolean switch in the given mode.<\/Para><\/Abstract>If parsing command line arguments, and no value was specified on the command line, the option's defaultValue<\/codeVoice> is used.<\/Para><\/Discussion><\/Function>", + "key.doc.name" : "<|(_:_:)", "key.substructure" : [ + ], + "key.doc.usr" : "s:ZF10Commandantoi2lourFTOS_11CommandModeVS_6Switch_GO6Result6ResultSbGOS_15CommandantErrorq___", + "key.doc.discussion" : [ + { + "Para" : "If parsing command line arguments, and no value was specified on the command line, the option's `defaultValue` is used." + } ] } ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 1915 + "key.length" : 1936 } }, { "Commandant\/Command.swift" : { "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.protocol", - "key.offset" : 279, + "key.offset" : 277, "key.parsed_declaration" : "public protocol CommandType", "key.doc.comment" : "Represents a subcommand that can be executed with its own set of arguments.", "key.namelength" : 11, @@ -1833,13 +1895,13 @@ "key.parsed_scope.end" : 26, "key.usr" : "s:P10Commandant11CommandType", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 279, + "key.nameoffset" : 277, "key.annotated_decl" : "public protocol CommandType<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.runtime_name" : "_TtP8__main__11CommandType_", "key.parsed_scope.start" : 13, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 292, + "key.bodyoffset" : 290, "key.doc.declaration" : "public protocol CommandType", "key.name" : "CommandType", "key.typename" : "CommandType.Protocol", @@ -1854,7 +1916,7 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 408, + "key.offset" : 406, "key.parsed_declaration" : "var verb: String { get }", "key.doc.comment" : "The action that users should specify to use this subcommand (e.g.,\n`help`).", "key.namelength" : 4, @@ -1865,12 +1927,12 @@ "key.parsed_scope.end" : 18, "key.usr" : "s:vP10Commandant11CommandType4verbSS", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 408, + "key.nameoffset" : 406, "key.annotated_decl" : "var verb: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 18, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 422, + "key.bodyoffset" : 420, "key.doc.declaration" : "var verb: String { get }", "key.typename" : "String", "key.name" : "verb", @@ -1880,16 +1942,13 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "verb<\/Name>s:vP10Commandant11CommandType4verbSS<\/USR>var verb: String { get }<\/Declaration>The action that users should specify to use this subcommand (e.g.,\n`help`).<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "verb<\/Name>s:vP10Commandant11CommandType4verbSS<\/USR>var verb: String { get }<\/Declaration>The action that users should specify to use this subcommand (e.g., help<\/codeVoice>).<\/Para><\/Abstract><\/Other>", "key.doc.name" : "verb", - "key.substructure" : [ - - ], "key.doc.usr" : "s:vP10Commandant11CommandType4verbSS" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 520, + "key.offset" : 518, "key.parsed_declaration" : "var function: String { get }", "key.doc.comment" : "A human-readable, high-level description of what this command is used\nfor.", "key.namelength" : 8, @@ -1900,12 +1959,12 @@ "key.parsed_scope.end" : 22, "key.usr" : "s:vP10Commandant11CommandType8functionSS", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 520, + "key.nameoffset" : 518, "key.annotated_decl" : "var function: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 22, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 538, + "key.bodyoffset" : 536, "key.doc.declaration" : "var function: String { get }", "key.typename" : "String", "key.name" : "function", @@ -1915,16 +1974,13 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "function<\/Name>s:vP10Commandant11CommandType8functionSS<\/USR>var function: String { get }<\/Declaration>A human-readable, high-level description of what this command is used\nfor.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "function<\/Name>s:vP10Commandant11CommandType8functionSS<\/USR>var function: String { get }<\/Declaration>A human-readable, high-level description of what this command is used for.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "function", - "key.substructure" : [ - - ], "key.doc.usr" : "s:vP10Commandant11CommandType8functionSS" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 597, + "key.offset" : 595, "key.parsed_declaration" : "func run(mode: CommandMode) -> Result<(), CommandantError>", "key.doc.comment" : "Runs this subcommand in the given mode.", "key.namelength" : 22, @@ -1932,35 +1988,35 @@ "key.length" : 22, "key.doc.column" : 7, "key.parsed_scope.end" : 25, - "key.usr" : "s:FP10Commandant11CommandType3runUS0__U__FQPS0_FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQS1_11ClientError__", + "key.usr" : "s:FP10Commandant11CommandType3runuRq_S0__Fq_FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorqq_S0_11ClientError__", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 597, - "key.annotated_decl" : "func run(mode: CommandMode<\/Type>) -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 595, + "key.annotated_decl" : "func run(mode: CommandMode<\/Type>) -> Result<\/Type><(), CommandantError<\/Type><Self.ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 25, "key.filepath" : "Commandant\/Command.swift", - "key.doc.declaration" : "func run(mode: CommandMode) -> Result<(), CommandantError>", + "key.doc.declaration" : "func run(mode: CommandMode) -> Result.Result<(), Commandant.CommandantError>", "key.name" : "run(_:)", - "key.typename" : "<`Self` : CommandType> Self -> (CommandMode) -> Result<(), CommandantError>", + "key.typename" : "<`Self` : CommandType> Self -> (CommandMode) -> Result<(), CommandantError>", "key.doc.type" : "Function", "key.attributes" : [ { "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "run(_:)<\/Name>s:FP10Commandant11CommandType3runUS0__U__FQPS0_FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQS1_11ClientError__<\/USR>func run(mode: CommandMode) -> Result<(), CommandantError<ClientError>><\/Declaration>Runs this subcommand in the given mode.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "run(_:)<\/Name>s:FP10Commandant11CommandType3runuRq_S0__Fq_FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorqq_S0_11ClientError__<\/USR>func run(mode: CommandMode) -> Result.Result<(), Commandant.CommandantError<Self.ClientError>><\/Declaration>Runs this subcommand in the given mode.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "run(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FP10Commandant11CommandType3runUS0__U__FQPS0_FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQS1_11ClientError__" + "key.doc.usr" : "s:FP10Commandant11CommandType3runuRq_S0__Fq_FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorqq_S0_11ClientError__" } ], "key.doc.usr" : "s:P10Commandant11CommandType" }, { "key.kind" : "source.lang.swift.decl.struct", - "key.offset" : 712, + "key.offset" : 710, "key.parsed_declaration" : "public struct CommandOf: CommandType", "key.doc.comment" : "A type-erased CommandType.", "key.namelength" : 9, @@ -1971,12 +2027,19 @@ "key.parsed_scope.end" : 44, "key.usr" : "s:V10Commandant9CommandOf", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 712, + "key.nameoffset" : 710, "key.annotated_decl" : "public struct CommandOf<ClientError> : CommandType<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 734, + "key.length" : 11 + } + ], "key.parsed_scope.start" : 29, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 749, + "key.bodyoffset" : 747, "key.doc.declaration" : "public struct CommandOf : CommandType", "key.name" : "CommandOf", "key.typename" : "CommandOf.Type", @@ -1996,74 +2059,65 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 762, + "key.offset" : 760, "key.parsed_declaration" : "public let verb: String", "key.namelength" : 4, "key.length" : 4, "key.typename" : "String", "key.name" : "verb", "key.parsed_scope.end" : 30, - "key.usr" : "s:vV10Commandant9CommandOf4verbSS", "key.overrides" : [ { "key.usr" : "s:vP10Commandant11CommandType4verbSS" } ], - "key.nameoffset" : 762, + "key.usr" : "s:vV10Commandant9CommandOf4verbSS", + "key.nameoffset" : 760, "key.annotated_decl" : "public let verb: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 30, "key.filepath" : "Commandant\/Command.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 787, + "key.offset" : 785, "key.parsed_declaration" : "public let function: String", "key.namelength" : 8, "key.length" : 8, "key.typename" : "String", "key.name" : "function", "key.parsed_scope.end" : 31, - "key.usr" : "s:vV10Commandant9CommandOf8functionSS", "key.overrides" : [ { "key.usr" : "s:vP10Commandant11CommandType8functionSS" } ], - "key.nameoffset" : 787, + "key.usr" : "s:vV10Commandant9CommandOf8functionSS", + "key.nameoffset" : 785, "key.annotated_decl" : "public let function: String<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 31, "key.filepath" : "Commandant\/Command.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 817, + "key.offset" : 815, "key.parsed_declaration" : "private let runClosure: CommandMode -> Result<(), CommandantError>", "key.namelength" : 10, "key.length" : 10, "key.typename" : "CommandMode -> Result<(), CommandantError>", "key.name" : "runClosure", "key.parsed_scope.end" : 32, - "key.usr" : "s:vV10Commandant9CommandOfP33_1DD6990CD6DFDE28F713A55F8EE2B70E10runClosureFOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQ___", - "key.nameoffset" : 817, - "key.annotated_decl" : "private let runClosure: CommandMode<\/Type> -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", + "key.usr" : "s:vV10Commandant9CommandOfP33_1DD6990CD6DFDE28F713A55F8EE2B70E10runClosureFOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorq___", + "key.nameoffset" : 815, + "key.annotated_decl" : "private let runClosure: CommandMode<\/Type> -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 32, "key.filepath" : "Commandant\/Command.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 937, + "key.offset" : 935, "key.parsed_declaration" : "public init(_ command: C)", "key.doc.comment" : "Creates a command that wraps another.", "key.namelength" : 69, @@ -2072,14 +2126,14 @@ "key.length" : 69, "key.doc.column" : 9, "key.parsed_scope.end" : 39, - "key.usr" : "s:FV10Commandant9CommandOfcU__FMGS0_Q__US_11CommandType__FQ_GS0_Qd___", + "key.usr" : "s:FV10Commandant9CommandOfcu__Rqd__S_11CommandTypezq_qqd__S1_11ClientError_FMGS0_q__Fqd__GS0_q__", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 937, + "key.nameoffset" : 935, "key.annotated_decl" : "public init<C : CommandType<\/Type> where C.ClientError == ClientError>(_ command: C)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 35, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 1008, + "key.bodyoffset" : 1006, "key.doc.declaration" : "public init(_ command: C)", "key.name" : "init(_:)", "key.typename" : " CommandOf.Type -> (C) -> CommandOf", @@ -2089,32 +2143,32 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "init(_:)<\/Name>s:FV10Commandant9CommandOfcU__FMGS0_Q__US_11CommandType__FQ_GS0_Qd___<\/USR>public init<C : CommandType where C.ClientError == ClientError>(_ command: C)<\/Declaration>Creates a command that wraps another.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "init(_:)<\/Name>s:FV10Commandant9CommandOfcu__Rqd__S_11CommandTypezq_qqd__S1_11ClientError_FMGS0_q__Fqd__GS0_q__<\/USR>public init<C : CommandType where C.ClientError == ClientError>(_ command: C)<\/Declaration>Creates a command that wraps another.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "init(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FV10Commandant9CommandOfcU__FMGS0_Q__US_11CommandType__FQ_GS0_Qd___" + "key.doc.usr" : "s:FV10Commandant9CommandOfcu__Rqd__S_11CommandTypezq_qqd__S1_11ClientError_FMGS0_q__Fqd__GS0_q__" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 1123, + "key.offset" : 1121, "key.parsed_declaration" : "public func run(mode: CommandMode) -> Result<(), CommandantError>", "key.namelength" : 22, - "key.bodyoffset" : 1191, + "key.bodyoffset" : 1189, "key.bodylength" : 28, "key.length" : 22, "key.name" : "run(_:)", "key.typename" : " CommandOf -> (CommandMode) -> Result<(), CommandantError>", "key.parsed_scope.end" : 43, - "key.usr" : "s:FV10Commandant9CommandOf3runU__FGS0_Q__FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQ___", + "key.usr" : "s:FV10Commandant9CommandOf3runurFGS0_q__FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorq___", "key.overrides" : [ { - "key.usr" : "s:FP10Commandant11CommandType3runUS0__U__FQPS0_FOS_11CommandModeGO8LlamaKit6ResultT_GOS_15CommandantErrorQS1_11ClientError__" + "key.usr" : "s:FP10Commandant11CommandType3runuRq_S0__Fq_FOS_11CommandModeGO6Result6ResultT_GOS_15CommandantErrorqq_S0_11ClientError__" } ], - "key.nameoffset" : 1123, - "key.annotated_decl" : "public func run(mode: CommandMode<\/Type>) -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", + "key.nameoffset" : 1121, + "key.annotated_decl" : "public func run(mode: CommandMode<\/Type>) -> Result<\/Type><(), CommandantError<\/Type><ClientError>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.substructure" : [ @@ -2127,7 +2181,7 @@ }, { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 1292, + "key.offset" : 1290, "key.parsed_declaration" : "public enum CommandMode", "key.doc.comment" : "Describes the \"mode\" in which a command should run.", "key.namelength" : 11, @@ -2138,12 +2192,12 @@ "key.parsed_scope.end" : 54, "key.usr" : "s:O10Commandant11CommandMode", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 1292, + "key.nameoffset" : 1290, "key.annotated_decl" : "public enum CommandMode<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 47, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 1305, + "key.bodyoffset" : 1303, "key.doc.declaration" : "public enum CommandMode", "key.name" : "CommandMode", "key.typename" : "CommandMode.Type", @@ -2157,69 +2211,93 @@ "key.doc.name" : "CommandMode", "key.substructure" : [ { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 1515, - "key.parsed_declaration" : "case Usage", - "key.doc.comment" : "Each option should record its usage information in an error, for\npresentation to the user.", - "key.doc.line" : 53, - "key.length" : 5, - "key.typename" : "CommandMode.Type -> CommandMode", - "key.name" : "Usage", - "key.doc.column" : 7, - "key.parsed_scope.end" : 53, - "key.usr" : "s:FO10Commandant11CommandMode5UsageFMS0_S0_", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/Command.swift", - "key.doc.full_as_xml" : "Usage<\/Name>s:FO10Commandant11CommandMode5UsageFMS0_S0_<\/USR><\/Declaration>Each option should record its usage information in an error, for\npresentation to the user.<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "Usage", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10Commandant11CommandMode5UsageFMS0_S0_", - "key.parsed_scope.start" : 53, - "key.filepath" : "Commandant\/Command.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 1379, + "key.parsed_declaration" : "case Arguments(ArgumentParser)", + "key.doc.comment" : "Options should be parsed from the given command-line arguments.", + "key.namelength" : 9, + "key.doc.line" : 49, + "key.length" : 9, + "key.name" : "Arguments", + "key.typename" : "CommandMode.Type -> (ArgumentParser) -> CommandMode", + "key.doc.column" : 7, + "key.parsed_scope.end" : 49, + "key.usr" : "s:FO10Commandant11CommandMode9ArgumentsFMS0_FCS_14ArgumentParserS0_", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/Command.swift", + "key.doc.full_as_xml" : "Arguments<\/Name>s:FO10Commandant11CommandMode9ArgumentsFMS0_FCS_14ArgumentParserS0_<\/USR><\/Declaration>Options should be parsed from the given command-line arguments.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 1379, + "key.doc.name" : "Arguments", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:FO10Commandant11CommandMode9ArgumentsFMS0_FCS_14ArgumentParserS0_", + "key.parsed_scope.start" : 49, + "key.filepath" : "Commandant\/Command.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 1374, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 30 }, { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 1381, - "key.parsed_declaration" : "case Arguments(ArgumentParser)", - "key.doc.comment" : "Options should be parsed from the given command-line arguments.", - "key.doc.line" : 49, - "key.length" : 9, - "key.typename" : "CommandMode.Type -> (ArgumentParser) -> CommandMode", - "key.name" : "Arguments", - "key.doc.column" : 7, - "key.parsed_scope.end" : 49, - "key.usr" : "s:FO10Commandant11CommandMode9ArgumentsFMS0_FCS_14ArgumentParserS0_", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/Command.swift", - "key.doc.full_as_xml" : "Arguments<\/Name>s:FO10Commandant11CommandMode9ArgumentsFMS0_FCS_14ArgumentParserS0_<\/USR><\/Declaration>Options should be parsed from the given command-line arguments.<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "Arguments", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10Commandant11CommandMode9ArgumentsFMS0_FCS_14ArgumentParserS0_", - "key.parsed_scope.start" : 49, - "key.filepath" : "Commandant\/Command.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 1513, + "key.parsed_declaration" : "case Usage", + "key.doc.comment" : "Each option should record its usage information in an error, for\npresentation to the user.", + "key.namelength" : 5, + "key.doc.line" : 53, + "key.length" : 5, + "key.name" : "Usage", + "key.typename" : "CommandMode.Type -> CommandMode", + "key.doc.column" : 7, + "key.parsed_scope.end" : 53, + "key.usr" : "s:FO10Commandant11CommandMode5UsageFMS0_S0_", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/Command.swift", + "key.doc.full_as_xml" : "Usage<\/Name>s:FO10Commandant11CommandMode5UsageFMS0_S0_<\/USR><\/Declaration>Each option should record its usage information in an error, for presentation to the user.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 1513, + "key.doc.name" : "Usage", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.internal", + "key.doc.usr" : "s:FO10Commandant11CommandMode5UsageFMS0_S0_", + "key.parsed_scope.start" : 53, + "key.filepath" : "Commandant\/Command.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 1508, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 10 } ], "key.doc.usr" : "s:O10Commandant11CommandMode" }, { "key.kind" : "source.lang.swift.decl.class", - "key.offset" : 1596, + "key.offset" : 1594, "key.parsed_declaration" : "public final class CommandRegistry", "key.doc.comment" : "Maintains the list of commands available to run.", "key.namelength" : 15, "key.doc.line" : 57, - "key.bodylength" : 1085, + "key.bodylength" : 1082, "key.length" : 15, "key.doc.column" : 20, "key.parsed_scope.end" : 88, "key.usr" : "s:C10Commandant15CommandRegistry", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 1596, + "key.nameoffset" : 1594, "key.annotated_decl" : "public final class CommandRegistry<ClientError><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 57, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 1626, + "key.bodyoffset" : 1624, "key.doc.declaration" : "public final class CommandRegistry", "key.name" : "CommandRegistry", "key.typename" : "CommandRegistry.Type", @@ -2237,66 +2315,63 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1640, + "key.offset" : 1638, "key.parsed_declaration" : "private var commandsByVerb: [String: CommandOf] = [:]", "key.namelength" : 14, "key.length" : 14, "key.typename" : "[String : CommandOf]", "key.name" : "commandsByVerb", "key.parsed_scope.end" : 58, - "key.usr" : "s:vC10Commandant15CommandRegistryP33_1DD6990CD6DFDE28F713A55F8EE2B70E14commandsByVerbGVSs10DictionarySSGVS_9CommandOfQ___", - "key.nameoffset" : 1640, + "key.usr" : "s:vC10Commandant15CommandRegistryP33_1DD6990CD6DFDE28F713A55F8EE2B70E14commandsByVerbGVSs10DictionarySSGVS_9CommandOfq___", + "key.nameoffset" : 1638, "key.annotated_decl" : "private var commandsByVerb: [String<\/Type> : CommandOf<\/Type><ClientError>]<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", - "key.substructure" : [ - - ], "key.setter_accessibility" : "source.lang.swift.accessibility.private", "key.parsed_scope.start" : 58, "key.filepath" : "Commandant\/Command.swift" }, { "key.kind" : "source.lang.swift.decl.function.subscript", - "key.offset" : 2625, + "key.offset" : 2620, "key.parsed_declaration" : "public subscript(verb: String) -> CommandOf?", "key.doc.comment" : "Returns the command matching the given verb, or nil if no such command\nis registered.", - "key.doc.declaration" : "public subscript (verb: String) -> CommandOf? { get }", + "key.doc.declaration" : "public subscript (verb: String) -> Commandant.CommandOf? { get }", "key.doc.line" : 85, "key.length" : 9, "key.typename" : "(String) -> CommandOf?", "key.name" : "subscript(_:)", "key.doc.column" : 9, "key.parsed_scope.end" : 85, - "key.usr" : "s:sC10Commandant15CommandRegistry9subscriptFSSGSqGVS_9CommandOfQ___", + "key.usr" : "s:sC10Commandant15CommandRegistry9subscriptFSSGSqGVS_9CommandOfq___", "key.doc.type" : "Other", "key.doc.file" : "Commandant\/Command.swift", - "key.doc.full_as_xml" : "subscript(_:)<\/Name>s:sC10Commandant15CommandRegistry9subscriptFSSGSqGVS_9CommandOfQ___<\/USR>public subscript (verb: String) -> CommandOf<ClientError>? { get }<\/Declaration>Returns the command matching the given verb, or nil if no such command\nis registered.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "subscript(_:)<\/Name>s:sC10Commandant15CommandRegistry9subscriptFSSGSqGVS_9CommandOfq___<\/USR>public subscript (verb: String) -> Commandant.CommandOf<ClientError>? { get }<\/Declaration>Returns the command matching the given verb, or nil if no such command is registered.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "subscript(_:)", "key.annotated_decl" : "public subscript (verb: String<\/Type>) -> CommandOf<\/Type><ClientError>? { get }<\/Declaration>", - "key.doc.usr" : "s:sC10Commandant15CommandRegistry9subscriptFSSGSqGVS_9CommandOfQ___", + "key.doc.usr" : "s:sC10Commandant15CommandRegistry9subscriptFSSGSqGVS_9CommandOfq___", "key.parsed_scope.start" : 85, "key.filepath" : "Commandant\/Command.swift" }, { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1737, + "key.offset" : 1735, "key.parsed_declaration" : "public var commands: [CommandOf]", "key.doc.comment" : "All available commands.", "key.namelength" : 8, "key.doc.line" : 61, - "key.bodylength" : 70, + "key.bodylength" : 67, "key.length" : 8, "key.doc.column" : 13, "key.parsed_scope.end" : 63, - "key.usr" : "s:vC10Commandant15CommandRegistry8commandsGSaGVS_9CommandOfQ___", + "key.usr" : "s:vC10Commandant15CommandRegistry8commandsGSaGVS_9CommandOfq___", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 1737, + "key.nameoffset" : 1735, "key.annotated_decl" : "public var commands: [CommandOf<\/Type><ClientError>] { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 61, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 1773, - "key.doc.declaration" : "public var commands: [CommandOf] { get }", + "key.bodyoffset" : 1771, + "key.doc.declaration" : "public var commands: [Commandant.CommandOf] { get }", "key.typename" : "[CommandOf]", "key.name" : "commands", "key.doc.type" : "Other", @@ -2305,37 +2380,31 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "commands<\/Name>s:vC10Commandant15CommandRegistry8commandsGSaGVS_9CommandOfQ___<\/USR>public var commands: [CommandOf<ClientError>] { get }<\/Declaration>All available commands.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "commands<\/Name>s:vC10Commandant15CommandRegistry8commandsGSaGVS_9CommandOfq___<\/USR>public var commands: [Commandant.CommandOf<ClientError>] { get }<\/Declaration>All available commands.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "commands", - "key.substructure" : [ - - ], - "key.doc.usr" : "s:vC10Commandant15CommandRegistry8commandsGSaGVS_9CommandOfQ___" + "key.doc.usr" : "s:vC10Commandant15CommandRegistry8commandsGSaGVS_9CommandOfq___" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 1854, + "key.offset" : 1849, "key.parsed_declaration" : "public init() {}", "key.namelength" : 6, - "key.bodyoffset" : 1862, + "key.bodyoffset" : 1857, "key.bodylength" : 0, "key.length" : 6, "key.name" : "init()", "key.typename" : " CommandRegistry.Type -> () -> CommandRegistry", "key.parsed_scope.end" : 65, - "key.usr" : "s:FC10Commandant15CommandRegistrycU__FMGS0_Q__FT_GS0_Q__", - "key.nameoffset" : 1854, + "key.usr" : "s:FC10Commandant15CommandRegistrycurFMGS0_q__FT_GS0_q__", + "key.nameoffset" : 1849, "key.annotated_decl" : "public init()<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 65, "key.filepath" : "Commandant\/Command.swift" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2043, + "key.offset" : 2038, "key.parsed_declaration" : "public func register(command: C)", "key.doc.comment" : "Registers the given command, making it available to run.\n\nIf another command was already registered with the same `verb`, it will\nbe overwritten.", "key.namelength" : 71, @@ -2344,14 +2413,14 @@ "key.length" : 71, "key.doc.column" : 14, "key.parsed_scope.end" : 73, - "key.usr" : "s:FC10Commandant15CommandRegistry8registerU__FGS0_Q__US_11CommandType__FQ_T_", + "key.usr" : "s:FC10Commandant15CommandRegistry8registeru__Rqd__S_11CommandTypezq_qqd__S1_11ClientError_FGS0_q__Fqd__T_", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 2043, + "key.nameoffset" : 2038, "key.annotated_decl" : "public func register<C : CommandType<\/Type> where C.ClientError == ClientError>(command: C)<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 71, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 2116, + "key.bodyoffset" : 2111, "key.doc.declaration" : "public func register(command: C)", "key.name" : "register(_:)", "key.typename" : " CommandRegistry -> (C) -> ()", @@ -2361,21 +2430,21 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "register(_:)<\/Name>s:FC10Commandant15CommandRegistry8registerU__FGS0_Q__US_11CommandType__FQ_T_<\/USR>public func register<C : CommandType where C.ClientError == ClientError>(command: C)<\/Declaration>Registers the given command, making it available to run.<\/Para><\/Abstract>If another command was already registered with the same ]]><\/rawHTML>verb]]><\/rawHTML>, it will\nbe overwritten.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "register(_:)<\/Name>s:FC10Commandant15CommandRegistry8registeru__Rqd__S_11CommandTypezq_qqd__S1_11ClientError_FGS0_q__Fqd__T_<\/USR>public func register<C : CommandType where C.ClientError == ClientError>(command: C)<\/Declaration>Registers the given command, making it available to run.<\/Para><\/Abstract>If another command was already registered with the same verb<\/codeVoice>, it will be overwritten.<\/Para><\/Discussion><\/Function>", "key.doc.name" : "register(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FC10Commandant15CommandRegistry8registerU__FGS0_Q__US_11CommandType__FQ_T_", + "key.doc.usr" : "s:FC10Commandant15CommandRegistry8registeru__Rqd__S_11CommandTypezq_qqd__S1_11ClientError_FGS0_q__Fqd__T_", "key.doc.discussion" : [ { - "Para" : "If another command was already registered with the same verb<\/code>, it will\nbe overwritten." + "Para" : "If another command was already registered with the same `verb`, it will be overwritten." } ] }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2360, + "key.offset" : 2355, "key.parsed_declaration" : "public func runCommand(verb: String, arguments: [String]) -> Result<(), CommandantError>?", "key.doc.comment" : "Runs the command corresponding to the given verb, passing it the given\narguments.\n\nReturns the results of the execution, or nil if no such command exists.", "key.namelength" : 45, @@ -2384,15 +2453,15 @@ "key.length" : 45, "key.doc.column" : 14, "key.parsed_scope.end" : 81, - "key.usr" : "s:FC10Commandant15CommandRegistry10runCommandU__FGS0_Q__FTSS9argumentsGSaSS__GSqGO8LlamaKit6ResultT_GOS_15CommandantErrorQ____", + "key.usr" : "s:FC10Commandant15CommandRegistry10runCommandurFGS0_q__FTSS9argumentsGSaSS__GSqGO6Result6ResultT_GOS_15CommandantErrorq____", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 2360, - "key.annotated_decl" : "public func runCommand(verb: String<\/Type>, arguments: [String<\/Type>]) -> Result<\/Type><(), CommandantError<\/Type><ClientError>>?<\/Declaration>", + "key.nameoffset" : 2355, + "key.annotated_decl" : "public func runCommand(verb: String<\/Type>, arguments: [String<\/Type>]) -> Result<\/Type><(), CommandantError<\/Type><ClientError>>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 79, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 2452, - "key.doc.declaration" : "public func runCommand(verb: String, arguments: [String]) -> Result<(), CommandantError>?", + "key.bodyoffset" : 2447, + "key.doc.declaration" : "public func runCommand(verb: String, arguments: [String]) -> Result.Result<(), Commandant.CommandantError>?", "key.name" : "runCommand(_:arguments:)", "key.typename" : " CommandRegistry -> (String, arguments: [String]) -> Result<(), CommandantError>?", "key.doc.type" : "Function", @@ -2401,12 +2470,12 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "runCommand(_:arguments:)<\/Name>s:FC10Commandant15CommandRegistry10runCommandU__FGS0_Q__FTSS9argumentsGSaSS__GSqGO8LlamaKit6ResultT_GOS_15CommandantErrorQ____<\/USR>public func runCommand(verb: String, arguments: [String]) -> Result<(), CommandantError<ClientError>>?<\/Declaration>Runs the command corresponding to the given verb, passing it the given\narguments.<\/Para><\/Abstract>Returns the results of the execution, or nil if no such command exists.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "runCommand(_:arguments:)<\/Name>s:FC10Commandant15CommandRegistry10runCommandurFGS0_q__FTSS9argumentsGSaSS__GSqGO6Result6ResultT_GOS_15CommandantErrorq____<\/USR>public func runCommand(verb: String, arguments: [String]) -> Result.Result<(), Commandant.CommandantError<ClientError>>?<\/Declaration>Runs the command corresponding to the given verb, passing it the given arguments.<\/Para><\/Abstract>Returns the results of the execution, or nil if no such command exists.<\/Para><\/Discussion><\/Function>", "key.doc.name" : "runCommand(_:arguments:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FC10Commandant15CommandRegistry10runCommandU__FGS0_Q__FTSS9argumentsGSaSS__GSqGO8LlamaKit6ResultT_GOS_15CommandantErrorQ____", + "key.doc.usr" : "s:FC10Commandant15CommandRegistry10runCommandurFGS0_q__FTSS9argumentsGSaSS__GSqGO6Result6ResultT_GOS_15CommandantErrorq____", "key.doc.discussion" : [ { "Para" : "Returns the results of the execution, or nil if no such command exists." @@ -2418,11 +2487,11 @@ }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 1596, + "key.offset" : 1594, "key.doc.comment" : "Maintains the list of commands available to run.", "key.namelength" : 15, - "key.bodyoffset" : 2741, - "key.bodylength" : 1461, + "key.bodyoffset" : 2736, + "key.bodylength" : 1460, "key.length" : 15, "key.doc.line" : 57, "key.name" : "CommandRegistry", @@ -2433,32 +2502,32 @@ "key.doc.type" : "Class", "key.doc.file" : "Commandant\/Command.swift", "key.doc.full_as_xml" : "CommandRegistry<\/Name>s:C10Commandant15CommandRegistry<\/USR>public final class CommandRegistry<ClientError><\/Declaration>Maintains the list of commands available to run.<\/Para><\/Abstract><\/Class>", - "key.nameoffset" : 2724, + "key.nameoffset" : 2719, "key.doc.name" : "CommandRegistry", "key.annotated_decl" : "public final class CommandRegistry<ClientError><\/Declaration>", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 3377, - "key.parsed_declaration" : "@noreturn public func main(#defaultVerb: String, errorHandler: ClientError -> ())", + "key.offset" : 3372, + "key.parsed_declaration" : "@noreturn public func main(defaultVerb defaultVerb: String, errorHandler: ClientError -> ())", "key.doc.comment" : "Hands off execution to the CommandRegistry, by parsing Process.arguments\nand then running whichever command has been identified in the argument\nlist.\n\nIf the chosen command executes successfully, the process will exit with\na successful exit code.\n\nIf the chosen command fails, the provided error handler will be invoked,\nthen the process will exit with a failure exit code.\n\nIf a matching command could not be found or a usage error occurred,\na helpful error message will be written to `stderr`, then the process\nwill exit with a failure error code.", - "key.namelength" : 59, + "key.namelength" : 70, "key.doc.line" : 104, - "key.bodylength" : 762, - "key.length" : 59, + "key.bodylength" : 750, + "key.length" : 70, "key.doc.column" : 24, "key.parsed_scope.end" : 137, - "key.usr" : "s:FC10Commandant15CommandRegistry4mainU__FGS0_Q__FT11defaultVerbSS12errorHandlerFQ_T__T_", + "key.usr" : "s:FC10Commandant15CommandRegistry4mainurFGS0_q__FT11defaultVerbSS12errorHandlerFq_T__T_", "key.doc.file" : "Commandant\/Command.swift", - "key.nameoffset" : 3377, - "key.annotated_decl" : "@noreturn public func main(#defaultVerb: String<\/Type>, errorHandler: ClientError -> ())<\/Declaration>", + "key.nameoffset" : 3372, + "key.annotated_decl" : "@noreturn public func main(defaultVerb defaultVerb: String<\/Type>, errorHandler: ClientError -> ())<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 104, "key.filepath" : "Commandant\/Command.swift", - "key.bodyoffset" : 3438, - "key.doc.declaration" : "@noreturn public func main(#defaultVerb: String, errorHandler: ClientError -> ())", + "key.bodyoffset" : 3444, + "key.doc.declaration" : "@noreturn public func main(defaultVerb defaultVerb: String, errorHandler: ClientError -> ())", "key.name" : "main(defaultVerb:errorHandler:)", - "key.typename" : "@noreturn CommandRegistry -> @noreturn (defaultVerb: String, errorHandler: ClientError -> ()) -> ()", + "key.typename" : " CommandRegistry -> @noreturn (defaultVerb: String, errorHandler: ClientError -> ()) -> ()", "key.doc.type" : "Function", "key.attributes" : [ { @@ -2468,21 +2537,21 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "main(defaultVerb:errorHandler:)<\/Name>s:FC10Commandant15CommandRegistry4mainU__FGS0_Q__FT11defaultVerbSS12errorHandlerFQ_T__T_<\/USR>@noreturn public func main(#defaultVerb: String, errorHandler: ClientError -> ())<\/Declaration>Hands off execution to the CommandRegistry, by parsing Process.arguments\nand then running whichever command has been identified in the argument\nlist.<\/Para><\/Abstract>If the chosen command executes successfully, the process will exit with\na successful exit code.<\/Para>If the chosen command fails, the provided error handler will be invoked,\nthen the process will exit with a failure exit code.<\/Para>If a matching command could not be found or a usage error occurred,\na helpful error message will be written to ]]><\/rawHTML>stderr]]><\/rawHTML>, then the process\nwill exit with a failure error code.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "main(defaultVerb:errorHandler:)<\/Name>s:FC10Commandant15CommandRegistry4mainurFGS0_q__FT11defaultVerbSS12errorHandlerFq_T__T_<\/USR>@noreturn public func main(defaultVerb defaultVerb: String, errorHandler: ClientError -> ())<\/Declaration>Hands off execution to the CommandRegistry, by parsing Process.arguments and then running whichever command has been identified in the argument list.<\/Para><\/Abstract>If the chosen command executes successfully, the process will exit with a successful exit code.<\/Para>If the chosen command fails, the provided error handler will be invoked, then the process will exit with a failure exit code.<\/Para>If a matching command could not be found or a usage error occurred, a helpful error message will be written to stderr<\/codeVoice>, then the process will exit with a failure error code.<\/Para><\/Discussion><\/Function>", "key.doc.name" : "main(defaultVerb:errorHandler:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FC10Commandant15CommandRegistry4mainU__FGS0_Q__FT11defaultVerbSS12errorHandlerFQ_T__T_", + "key.doc.usr" : "s:FC10Commandant15CommandRegistry4mainurFGS0_q__FT11defaultVerbSS12errorHandlerFq_T__T_", "key.doc.discussion" : [ { - "Para" : "If the chosen command executes successfully, the process will exit with\na successful exit code." + "Para" : "If the chosen command executes successfully, the process will exit with a successful exit code." }, { - "Para" : "If the chosen command fails, the provided error handler will be invoked,\nthen the process will exit with a failure exit code." + "Para" : "If the chosen command fails, the provided error handler will be invoked, then the process will exit with a failure exit code." }, { - "Para" : "If a matching command could not be found or a usage error occurred,\na helpful error message will be written to stderr<\/code>, then the process\nwill exit with a failure error code." + "Para" : "If a matching command could not be found or a usage error occurred, a helpful error message will be written to `stderr`, then the process will exit with a failure error code." } ] } @@ -2493,14 +2562,14 @@ ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 4204 + "key.length" : 4198 } }, { "Commandant\/ArgumentParser.swift" : { "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.enum", - "key.offset" : 258, + "key.offset" : 256, "key.parsed_declaration" : "private enum RawArgument: Equatable", "key.doc.comment" : "Represents an argument passed on the command line.", "key.namelength" : 11, @@ -2511,12 +2580,19 @@ "key.parsed_scope.end" : 23, "key.usr" : "s:O10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 258, + "key.nameoffset" : 256, "key.annotated_decl" : "private enum RawArgument : Equatable<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 269, + "key.length" : 9 + } + ], "key.parsed_scope.start" : 13, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 282, + "key.bodyoffset" : 280, "key.doc.declaration" : "private enum RawArgument : Equatable", "key.name" : "RawArgument", "key.typename" : "RawArgument.Type", @@ -2535,133 +2611,194 @@ ], "key.substructure" : [ { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 362, - "key.parsed_declaration" : "case Key(String)", - "key.doc.comment" : "A key corresponding to an option (e.g., `verbose` for `--verbose`).", - "key.doc.line" : 15, - "key.length" : 3, - "key.typename" : "RawArgument.Type -> (String) -> RawArgument", - "key.name" : "Key", - "key.doc.column" : 7, - "key.parsed_scope.end" : 15, - "key.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument3KeyFMS0_FSSS0_", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.doc.full_as_xml" : "Key<\/Name>s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument3KeyFMS0_FSSS0_<\/USR><\/Declaration>A key corresponding to an option (e.g., ]]><\/rawHTML>verbose]]><\/rawHTML> for ]]><\/rawHTML>--verbose]]><\/rawHTML>).<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "Key", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument3KeyFMS0_FSSS0_", - "key.parsed_scope.start" : 15, - "key.filepath" : "Commandant\/ArgumentParser.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 360, + "key.parsed_declaration" : "case Key(String)", + "key.doc.comment" : "A key corresponding to an option (e.g., `verbose` for `--verbose`).", + "key.namelength" : 3, + "key.doc.line" : 15, + "key.length" : 3, + "key.name" : "Key", + "key.typename" : "RawArgument.Type -> (String) -> RawArgument", + "key.doc.column" : 7, + "key.parsed_scope.end" : 15, + "key.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument3KeyFMS0_FSSS0_", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/ArgumentParser.swift", + "key.doc.full_as_xml" : "Key<\/Name>s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument3KeyFMS0_FSSS0_<\/USR><\/Declaration>A key corresponding to an option (e.g., verbose<\/codeVoice> for --verbose<\/codeVoice>).<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 360, + "key.doc.name" : "Key", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.private", + "key.doc.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument3KeyFMS0_FSSS0_", + "key.parsed_scope.start" : 15, + "key.filepath" : "Commandant\/ArgumentParser.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 355, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 16 }, { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 550, - "key.parsed_declaration" : "case Flag(Set)", - "key.doc.comment" : "One or more flag arguments (e.g 'r' and 'f' for `-rf`)", - "key.doc.line" : 22, - "key.length" : 4, - "key.typename" : "RawArgument.Type -> (Set) -> RawArgument", - "key.name" : "Flag", - "key.doc.column" : 7, - "key.parsed_scope.end" : 22, - "key.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument4FlagFMS0_FGVSs3SetVSs9Character_S0_", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.doc.full_as_xml" : "Flag<\/Name>s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument4FlagFMS0_FGVSs3SetVSs9Character_S0_<\/USR><\/Declaration>One or more flag arguments (e.g 'r' and 'f' for ]]><\/rawHTML>-rf]]><\/rawHTML>)<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "Flag", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument4FlagFMS0_FGVSs3SetVSs9Character_S0_", - "key.parsed_scope.start" : 22, - "key.filepath" : "Commandant\/ArgumentParser.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 467, + "key.parsed_declaration" : "case Value(String)", + "key.doc.comment" : "A value, either associated with an option or passed as a positional\nargument.", + "key.namelength" : 5, + "key.doc.line" : 19, + "key.length" : 5, + "key.name" : "Value", + "key.typename" : "RawArgument.Type -> (String) -> RawArgument", + "key.doc.column" : 7, + "key.parsed_scope.end" : 19, + "key.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument5ValueFMS0_FSSS0_", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/ArgumentParser.swift", + "key.doc.full_as_xml" : "Value<\/Name>s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument5ValueFMS0_FSSS0_<\/USR><\/Declaration>A value, either associated with an option or passed as a positional argument.<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 467, + "key.doc.name" : "Value", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.private", + "key.doc.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument5ValueFMS0_FSSS0_", + "key.parsed_scope.start" : 19, + "key.filepath" : "Commandant\/ArgumentParser.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 462, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 18 }, { - "key.kind" : "source.lang.swift.decl.enumelement", - "key.offset" : 469, - "key.parsed_declaration" : "case Value(String)", - "key.doc.comment" : "A value, either associated with an option or passed as a positional\nargument.", - "key.doc.line" : 19, - "key.length" : 5, - "key.typename" : "RawArgument.Type -> (String) -> RawArgument", - "key.name" : "Value", - "key.doc.column" : 7, - "key.parsed_scope.end" : 19, - "key.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument5ValueFMS0_FSSS0_", - "key.doc.type" : "Other", - "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.doc.full_as_xml" : "Value<\/Name>s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument5ValueFMS0_FSSS0_<\/USR><\/Declaration>A value, either associated with an option or passed as a positional\nargument.<\/Para><\/Abstract><\/Other>", - "key.doc.name" : "Value", - "key.annotated_decl" : "<\/Declaration>", - "key.doc.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument5ValueFMS0_FSSS0_", - "key.parsed_scope.start" : 19, - "key.filepath" : "Commandant\/ArgumentParser.swift" + "key.substructure" : [ + { + "key.kind" : "source.lang.swift.decl.enumelement", + "key.offset" : 548, + "key.parsed_declaration" : "case Flag(Set)", + "key.doc.comment" : "One or more flag arguments (e.g 'r' and 'f' for `-rf`)", + "key.namelength" : 4, + "key.doc.line" : 22, + "key.length" : 4, + "key.name" : "Flag", + "key.typename" : "RawArgument.Type -> (Set) -> RawArgument", + "key.doc.column" : 7, + "key.parsed_scope.end" : 22, + "key.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument4FlagFMS0_FGVSs3SetVSs9Character_S0_", + "key.doc.type" : "Other", + "key.doc.file" : "Commandant\/ArgumentParser.swift", + "key.doc.full_as_xml" : "Flag<\/Name>s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument4FlagFMS0_FGVSs3SetVSs9Character_S0_<\/USR><\/Declaration>One or more flag arguments (e.g 'r' and 'f' for -rf<\/codeVoice>)<\/Para><\/Abstract><\/Other>", + "key.nameoffset" : 548, + "key.doc.name" : "Flag", + "key.annotated_decl" : "<\/Declaration>", + "key.accessibility" : "source.lang.swift.accessibility.private", + "key.doc.usr" : "s:FO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument4FlagFMS0_FGVSs3SetVSs9Character_S0_", + "key.parsed_scope.start" : 22, + "key.filepath" : "Commandant\/ArgumentParser.swift" + } + ], + "key.kind" : "source.lang.swift.decl.enumcase", + "key.offset" : 543, + "key.nameoffset" : 0, + "key.namelength" : 0, + "key.length" : 25 } ], "key.doc.usr" : "s:O10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument" }, { "key.kind" : "source.lang.swift.decl.function.free", - "key.offset" : 587, + "key.offset" : 585, "key.parsed_declaration" : "private func ==(lhs: RawArgument, rhs: RawArgument) -> Bool", "key.namelength" : 38, - "key.bodyoffset" : 635, + "key.bodyoffset" : 633, "key.bodylength" : 239, "key.length" : 38, "key.name" : "==(_:_:)", "key.typename" : "(RawArgument, RawArgument) -> Bool", "key.parsed_scope.end" : 39, "key.usr" : "s:ZF10CommandantP33_BA859BFBBE9DF3838A11641CB273713Eoi2eeFTOS_P33_BA859BFBBE9DF3838A11641CB273713E11RawArgumentS0__Sb", - "key.overrides" : [ - { - "key.usr" : "s:ZFPSs9Equatableoi2eeUS___FMQPS_FTS0_S0__Sb" - } - ], "key.related_decls" : [ { - "key.annotated_decl" : "==(_: MirrorDisposition, _: MirrorDisposition) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: _GenericObjCError, _: _GenericObjCError) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==<T : __BridgedNSError where T.RawValue : SignedIntegerType>(_: T, _: T) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==<T : __BridgedNSError where T.RawValue : UnsignedIntegerType>(_: T, _: T) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==(_: Selector, _: Selector) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==(_: NSObject, _: NSObject) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==(_: CGPoint, _: CGPoint) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: _GraphemeClusterBreakPropertyValue, _: _GraphemeClusterBreakPropertyValue) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: CGSize, _: CGSize) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Equatable>(_: ContiguousArray<T>, _: ContiguousArray<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: CGVector, _: CGVector) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Equatable>(_: ArraySlice<T>, _: ArraySlice<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: CGRect, _: CGRect) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Equatable>(_: Array<T>, _: Array<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: CGFloat, _: CGFloat) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Equatable>(_: _UnitTestArray<T>, _: _UnitTestArray<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: _MirrorDisposition, _: _MirrorDisposition) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==(_: Mirror.DisplayStyle, _: Mirror.DisplayStyle) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==<Element : Equatable>(_: ContiguousArray<Element>, _: ContiguousArray<Element>) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==<Element : Equatable>(_: ArraySlice<Element>, _: ArraySlice<Element>) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==<Element : Equatable>(_: Array<Element>, _: Array<Element>) -> Bool<\/RelatedName>" + }, + { + "key.annotated_decl" : "==<Element : Equatable>(_: _UnitTestArray<Element>, _: _UnitTestArray<Element>) -> Bool<\/RelatedName>" }, { "key.annotated_decl" : "==(_: Bool, _: Bool) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T>(_: AutoreleasingUnsafeMutablePointer<T>, _: AutoreleasingUnsafeMutablePointer<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Memory>(_: AutoreleasingUnsafeMutablePointer<Memory>, _: AutoreleasingUnsafeMutablePointer<Memory>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: COpaquePointer, _: COpaquePointer) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: Any.Type?, _: Any.Type?) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T>(_: CFunctionPointer<T>, _: CFunctionPointer<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: COpaquePointer, _: COpaquePointer) -> Bool<\/RelatedName>" }, { "key.annotated_decl" : "==(_: Character, _: Character) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : _RawOptionSetType>(_: T, _: T) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<T : RawRepresentable where T.RawValue : Equatable>(_: T, _: T) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<I>(_: _ConcatenateForwardIndex<I>, _: _ConcatenateForwardIndex<I>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<I>(_: _ConcatenateForwardIndex<I>, _: _ConcatenateForwardIndex<I>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<I>(_: _ConcatenateBidirectionalIndex<I>, _: _ConcatenateBidirectionalIndex<I>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<I>(_: _ConcatenateBidirectionalIndex<I>, _: _ConcatenateBidirectionalIndex<I>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<Base : CollectionType>(_: FilterCollectionViewIndex<Base>, _: FilterCollectionViewIndex<Base>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Base : CollectionType>(_: FilterCollectionIndex<Base>, _: FilterCollectionIndex<Base>) -> Bool<\/RelatedName>" }, { "key.annotated_decl" : "==(_: UInt8, _: UInt8) -> Bool<\/RelatedName>" @@ -2706,115 +2843,97 @@ "key.annotated_decl" : "==(_: FloatingPointClassification, _: FloatingPointClassification) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Hashable>(_: Set<T>, _: Set<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Element : Hashable>(_: Set<Element>, _: Set<Element>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<Key : Equatable, Value : Equatable>(_: [Key : Value], _: [Key : Value]) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Key : Equatable, Value : Equatable>(_: [Key : Value], _: [Key : Value]) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Hashable>(_: SetIndex<T>, _: SetIndex<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Element : Hashable>(_: SetIndex<Element>, _: SetIndex<Element>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<Key : Hashable, Value>(_: DictionaryIndex<Key, Value>, _: DictionaryIndex<Key, Value>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Key : Hashable, Value>(_: DictionaryIndex<Key, Value>, _: DictionaryIndex<Key, Value>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Comparable>(_: HalfOpenInterval<T>, _: HalfOpenInterval<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Bound : Comparable>(_: HalfOpenInterval<Bound>, _: HalfOpenInterval<Bound>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Comparable>(_: ClosedInterval<T>, _: ClosedInterval<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Bound : Comparable>(_: ClosedInterval<Bound>, _: ClosedInterval<Bound>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<Value, Element>(_: ManagedBufferPointer<Value, Element>, _: ManagedBufferPointer<Value, Element>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Value, Element>(_: ManagedBufferPointer<Value, Element>, _: ManagedBufferPointer<Value, Element>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : Equatable>(_: T?, _: T?) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<T : Equatable>(_: T?, _: T?) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T>(_: T?, _: _OptionalNilComparisonType) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<T>(_: T?, _: _OptionalNilComparisonType) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T>(_: _OptionalNilComparisonType, _: T?) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<T>(_: _OptionalNilComparisonType, _: T?) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T>(_: Range<T>, _: Range<T>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Element>(_: Range<Element>, _: Range<Element>) -> Bool<\/RelatedName>" }, { "key.annotated_decl" : "==(_: ObjectIdentifier, _: ObjectIdentifier) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<I>(_: ReverseBidirectionalIndex<I>, _: ReverseBidirectionalIndex<I>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<I>(_: ReverseIndex<I>, _: ReverseIndex<I>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<I>(_: ReverseRandomAccessIndex<I>, _: ReverseRandomAccessIndex<I>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<I>(_: ReverseRandomAccessIndex<I>, _: ReverseRandomAccessIndex<I>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T : _Strideable>(_: T, _: T) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<T : _Strideable>(_: T, _: T) -> Bool<\/RelatedName>" }, { "key.annotated_decl" : "==(_: String, _: String) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: String.Index, _: String.Index) -> Bool<\/RelatedName>" - }, - { - "key.annotated_decl" : "==(_: String.UTF16View.Index, _: String.UTF16View.Index) -> Bool<\/RelatedName>" - }, - { - "key.annotated_decl" : "==(_: String.UTF8View.Index, _: String.UTF8View.Index) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: Index, _: Index) -> Bool<\/RelatedName>" }, { "key.annotated_decl" : "==(_: String.UnicodeScalarView.Index, _: String.UnicodeScalarView.Index) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: UnicodeScalar, _: UnicodeScalar) -> Bool<\/RelatedName>" - }, - { - "key.annotated_decl" : "==<T>(_: UnsafeMutablePointer<T>, _: UnsafeMutablePointer<T>) -> Bool<\/RelatedName>" - }, - { - "key.annotated_decl" : "==<T>(_: UnsafePointer<T>, _: UnsafePointer<T>) -> Bool<\/RelatedName>" - }, - { - "key.annotated_decl" : "==(_: Bit, _: Bit) -> Bool<\/RelatedName>" - }, - { - "key.annotated_decl" : "==(_: Self, _: Self) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: String.UTF16View.Index, _: String.UTF16View.Index) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: NSObject, _: NSObject) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: String.UTF8View.Index, _: String.UTF8View.Index) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: NSComparisonResult, _: NSComparisonResult) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: UnicodeScalar, _: UnicodeScalar) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: NSKeyValueSetMutationKind, _: NSKeyValueSetMutationKind) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Memory>(_: UnsafeMutablePointer<Memory>, _: UnsafeMutablePointer<Memory>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: NSKeyValueChange, _: NSKeyValueChange) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<Memory>(_: UnsafePointer<Memory>, _: UnsafePointer<Memory>) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: Selector, _: Selector) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: _SwiftNSOperatingSystemVersion, _: _SwiftNSOperatingSystemVersion) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: CGPoint, _: CGPoint) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: Bit, _: Bit) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: CGSize, _: CGSize) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: AnyForwardIndex, _: AnyForwardIndex) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: CGVector, _: CGVector) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: AnyBidirectionalIndex, _: AnyBidirectionalIndex) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: CGRect, _: CGRect) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: AnyRandomAccessIndex, _: AnyRandomAccessIndex) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==(_: CGFloat, _: CGFloat) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==(_: Self, _: Self) -> Bool<\/RelatedName>" }, { - "key.annotated_decl" : "==<T, E where T : Equatable, E : Equatable>(_: Result<T, E>, _: Result<T, E>) -> Bool<\/RelatedName>" + "key.annotated_decl" : "==<T : Equatable, Error : Equatable>(_: Result<T, Error>, _: Result<T, Error>) -> Bool<\/RelatedName>" } ], - "key.nameoffset" : 587, + "key.nameoffset" : 585, "key.annotated_decl" : "private func ==(lhs: RawArgument<\/Type>, rhs: RawArgument<\/Type>) -> Bool<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", "key.substructure" : [ @@ -2825,10 +2944,10 @@ }, { "key.kind" : "source.lang.swift.decl.extension", - "key.offset" : 258, + "key.offset" : 256, "key.doc.comment" : "Represents an argument passed on the command line.", "key.namelength" : 11, - "key.bodyoffset" : 911, + "key.bodyoffset" : 923, "key.bodylength" : 210, "key.length" : 11, "key.doc.line" : 13, @@ -2840,21 +2959,21 @@ "key.doc.type" : "Other", "key.doc.file" : "Commandant\/ArgumentParser.swift", "key.doc.full_as_xml" : "RawArgument<\/Name>s:O10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument<\/USR>private enum RawArgument : Equatable<\/Declaration>Represents an argument passed on the command line.<\/Para><\/Abstract><\/Other>", - "key.nameoffset" : 887, + "key.nameoffset" : 885, "key.doc.name" : "RawArgument", "key.inheritedtypes" : [ { - "key.name" : "Printable" + "key.name" : "CustomStringConvertible" } ], "key.annotated_decl" : "private enum RawArgument : Equatable<\/Type><\/Declaration>", "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 925, + "key.offset" : 937, "key.parsed_declaration" : "private var description: String", "key.namelength" : 11, - "key.bodyoffset" : 946, + "key.bodyoffset" : 958, "key.bodylength" : 173, "key.length" : 11, "key.typename" : "String", @@ -2863,42 +2982,46 @@ "key.usr" : "s:vO10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument11descriptionSS", "key.overrides" : [ { - "key.usr" : "s:vPSs9Printable11descriptionSS" + "key.usr" : "s:vPSs23CustomStringConvertible11descriptionSS" } ], - "key.nameoffset" : 925, + "key.nameoffset" : 937, "key.annotated_decl" : "private var description: String<\/Type> { get }<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", - "key.substructure" : [ - - ], "key.parsed_scope.start" : 42, "key.filepath" : "Commandant\/ArgumentParser.swift" } ], "key.doc.usr" : "s:O10CommandantP33_BA859BFBBE9DF3838A11641CB273713E11RawArgument", + "key.elements" : [ + { + "key.kind" : "source.lang.swift.structure.elem.typeref", + "key.offset" : 898, + "key.length" : 23 + } + ], "key.filepath" : "Commandant\/ArgumentParser.swift" }, { "key.kind" : "source.lang.swift.decl.class", - "key.offset" : 1202, + "key.offset" : 1214, "key.parsed_declaration" : "public final class ArgumentParser", "key.doc.comment" : "Destructively parses a list of command-line arguments.", "key.namelength" : 14, "key.doc.line" : 57, - "key.bodylength" : 3578, + "key.bodylength" : 3615, "key.length" : 14, "key.doc.column" : 20, "key.parsed_scope.end" : 190, "key.usr" : "s:C10Commandant14ArgumentParser", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 1202, + "key.nameoffset" : 1214, "key.annotated_decl" : "public final class ArgumentParser<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.runtime_name" : "_TtC8__main__14ArgumentParser", "key.parsed_scope.start" : 57, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 1218, + "key.bodyoffset" : 1230, "key.doc.declaration" : "public final class ArgumentParser", "key.name" : "ArgumentParser", "key.typename" : "ArgumentParser.Type", @@ -2916,7 +3039,7 @@ "key.substructure" : [ { "key.kind" : "source.lang.swift.decl.var.instance", - "key.offset" : 1297, + "key.offset" : 1309, "key.parsed_declaration" : "private var rawArguments: [RawArgument] = []", "key.doc.comment" : "The remaining arguments to be extracted, in their raw form.", "key.namelength" : 12, @@ -2926,12 +3049,12 @@ "key.parsed_scope.end" : 59, "key.usr" : "s:vC10Commandant14ArgumentParserP33_BA859BFBBE9DF3838A11641CB273713E12rawArgumentsGSaOS_P33_BA859BFBBE9DF3838A11641CB273713E11RawArgument_", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 1297, + "key.nameoffset" : 1309, "key.annotated_decl" : "private var rawArguments: [RawArgument<\/Type>]<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.private", "key.parsed_scope.start" : 59, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.doc.declaration" : "private var rawArguments: [RawArgument]", + "key.doc.declaration" : "private var rawArguments: [Commandant.RawArgument]", "key.typename" : "[RawArgument]", "key.name" : "rawArguments", "key.doc.type" : "Other", @@ -2940,33 +3063,30 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "rawArguments<\/Name>s:vC10Commandant14ArgumentParserP33_BA859BFBBE9DF3838A11641CB273713E12rawArgumentsGSaOS_P33_BA859BFBBE9DF3838A11641CB273713E11RawArgument_<\/USR>private var rawArguments: [RawArgument]<\/Declaration>The remaining arguments to be extracted, in their raw form.<\/Para><\/Abstract><\/Other>", + "key.doc.full_as_xml" : "rawArguments<\/Name>s:vC10Commandant14ArgumentParserP33_BA859BFBBE9DF3838A11641CB273713E12rawArgumentsGSaOS_P33_BA859BFBBE9DF3838A11641CB273713E11RawArgument_<\/USR>private var rawArguments: [Commandant.RawArgument]<\/Declaration>The remaining arguments to be extracted, in their raw form.<\/Para><\/Abstract><\/Other>", "key.doc.name" : "rawArguments", - "key.substructure" : [ - - ], "key.setter_accessibility" : "source.lang.swift.accessibility.private", "key.doc.usr" : "s:vC10Commandant14ArgumentParserP33_BA859BFBBE9DF3838A11641CB273713E12rawArgumentsGSaOS_P33_BA859BFBBE9DF3838A11641CB273713E11RawArgument_" }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 1416, + "key.offset" : 1428, "key.parsed_declaration" : "public init(_ arguments: [String])", "key.doc.comment" : "Initializes the generator from a simple list of command-line arguments.", "key.namelength" : 27, "key.doc.line" : 62, - "key.bodylength" : 651, + "key.bodylength" : 685, "key.length" : 27, "key.doc.column" : 9, "key.parsed_scope.end" : 83, "key.usr" : "s:FC10Commandant14ArgumentParsercFMS0_FGSaSS_S0_", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 1416, + "key.nameoffset" : 1428, "key.annotated_decl" : "public init(_ arguments: [String<\/Type>])<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.public", "key.parsed_scope.start" : 62, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 1445, + "key.bodyoffset" : 1457, "key.doc.declaration" : "public init(_ arguments: [String])", "key.name" : "init(_:)", "key.typename" : "ArgumentParser.Type -> ([String]) -> ArgumentParser", @@ -2985,7 +3105,7 @@ }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2320, + "key.offset" : 2366, "key.parsed_declaration" : "internal func consumeBooleanKey(key: String) -> Bool?", "key.doc.comment" : "Returns whether the given key was enabled or disabled, or nil if it\nwas not given at all.\n\nIf the key is found, it is then removed from the list of arguments\nremaining to be parsed.", "key.namelength" : 30, @@ -2996,12 +3116,12 @@ "key.parsed_scope.end" : 106, "key.usr" : "s:FC10Commandant14ArgumentParser17consumeBooleanKeyFS0_FSSGSqSb_", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 2320, + "key.nameoffset" : 2366, "key.annotated_decl" : "internal func consumeBooleanKey(key: String<\/Type>) -> Bool<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 90, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 2361, + "key.bodyoffset" : 2407, "key.doc.declaration" : "internal func consumeBooleanKey(key: String) -> Bool?", "key.name" : "consumeBooleanKey(_:)", "key.typename" : "ArgumentParser -> (String) -> Bool?", @@ -3011,7 +3131,7 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "consumeBooleanKey(_:)<\/Name>s:FC10Commandant14ArgumentParser17consumeBooleanKeyFS0_FSSGSqSb_<\/USR>internal func consumeBooleanKey(key: String) -> Bool?<\/Declaration>Returns whether the given key was enabled or disabled, or nil if it\nwas not given at all.<\/Para><\/Abstract>If the key is found, it is then removed from the list of arguments\nremaining to be parsed.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "consumeBooleanKey(_:)<\/Name>s:FC10Commandant14ArgumentParser17consumeBooleanKeyFS0_FSSGSqSb_<\/USR>internal func consumeBooleanKey(key: String) -> Bool?<\/Declaration>Returns whether the given key was enabled or disabled, or nil if it was not given at all.<\/Para><\/Abstract>If the key is found, it is then removed from the list of arguments remaining to be parsed.<\/Para><\/Discussion><\/Function>", "key.doc.name" : "consumeBooleanKey(_:)", "key.substructure" : [ @@ -3019,30 +3139,30 @@ "key.doc.usr" : "s:FC10Commandant14ArgumentParser17consumeBooleanKeyFS0_FSSGSqSb_", "key.doc.discussion" : [ { - "Para" : "If the key is found, it is then removed from the list of arguments\nremaining to be parsed." + "Para" : "If the key is found, it is then removed from the list of arguments remaining to be parsed." } ] }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 2960, + "key.offset" : 3006, "key.parsed_declaration" : "internal func consumeValueForKey(key: String) -> Result>", "key.doc.comment" : "Returns the value associated with the given flag, or nil if the flag was\nnot specified. If the key is presented, but no value was given, an error\nis returned.\n\nIf a value is found, the key and the value are both removed from the\nlist of arguments remaining to be parsed.", "key.namelength" : 31, "key.doc.line" : 114, - "key.bodylength" : 550, + "key.bodylength" : 552, "key.length" : 31, "key.doc.column" : 16, "key.parsed_scope.end" : 141, - "key.usr" : "s:FC10Commandant14ArgumentParser18consumeValueForKeyFS0_FSSGO8LlamaKit6ResultGSqSS_GOS_15CommandantErrorOS_7NoError__", + "key.usr" : "s:FC10Commandant14ArgumentParser18consumeValueForKeyFS0_FSSGO6Result6ResultGSqSS_GOS_15CommandantErrorOS_7NoError__", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 2960, - "key.annotated_decl" : "internal func consumeValueForKey(key: String<\/Type>) -> Result<\/Type><String<\/Type>?, CommandantError<\/Type><NoError<\/Type>>><\/Declaration>", + "key.nameoffset" : 3006, + "key.annotated_decl" : "internal func consumeValueForKey(key: String<\/Type>) -> Result<\/Type><String<\/Type>?, CommandantError<\/Type><NoError<\/Type>>><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 114, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 3038, - "key.doc.declaration" : "internal func consumeValueForKey(key: String) -> Result>", + "key.bodyoffset" : 3084, + "key.doc.declaration" : "internal func consumeValueForKey(key: String) -> Result.Result>", "key.name" : "consumeValueForKey(_:)", "key.typename" : "ArgumentParser -> (String) -> Result>", "key.doc.type" : "Function", @@ -3051,21 +3171,21 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "consumeValueForKey(_:)<\/Name>s:FC10Commandant14ArgumentParser18consumeValueForKeyFS0_FSSGO8LlamaKit6ResultGSqSS_GOS_15CommandantErrorOS_7NoError__<\/USR>internal func consumeValueForKey(key: String) -> Result<String?, CommandantError<NoError>><\/Declaration>Returns the value associated with the given flag, or nil if the flag was\nnot specified. If the key is presented, but no value was given, an error\nis returned.<\/Para><\/Abstract>If a value is found, the key and the value are both removed from the\nlist of arguments remaining to be parsed.<\/Para><\/Discussion><\/Function>", + "key.doc.full_as_xml" : "consumeValueForKey(_:)<\/Name>s:FC10Commandant14ArgumentParser18consumeValueForKeyFS0_FSSGO6Result6ResultGSqSS_GOS_15CommandantErrorOS_7NoError__<\/USR>internal func consumeValueForKey(key: String) -> Result.Result<String?, Commandant.CommandantError<Commandant.NoError>><\/Declaration>Returns the value associated with the given flag, or nil if the flag was not specified. If the key is presented, but no value was given, an error is returned.<\/Para><\/Abstract>If a value is found, the key and the value are both removed from the list of arguments remaining to be parsed.<\/Para><\/Discussion><\/Function>", "key.doc.name" : "consumeValueForKey(_:)", "key.substructure" : [ ], - "key.doc.usr" : "s:FC10Commandant14ArgumentParser18consumeValueForKeyFS0_FSSGO8LlamaKit6ResultGSqSS_GOS_15CommandantErrorOS_7NoError__", + "key.doc.usr" : "s:FC10Commandant14ArgumentParser18consumeValueForKeyFS0_FSSGO6Result6ResultGSqSS_GOS_15CommandantErrorOS_7NoError__", "key.doc.discussion" : [ { - "Para" : "If a value is found, the key and the value are both removed from the\nlist of arguments remaining to be parsed." + "Para" : "If a value is found, the key and the value are both removed from the list of arguments remaining to be parsed." } ] }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 3734, + "key.offset" : 3782, "key.parsed_declaration" : "internal func consumePositionalArgument() -> String?", "key.doc.comment" : "Returns the next positional argument that hasn't yet been returned, or\nnil if there are no more positional arguments.", "key.namelength" : 27, @@ -3076,12 +3196,12 @@ "key.parsed_scope.end" : 158, "key.usr" : "s:FC10Commandant14ArgumentParser25consumePositionalArgumentFS0_FT_GSqSS_", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 3734, + "key.nameoffset" : 3782, "key.annotated_decl" : "internal func consumePositionalArgument() -> String<\/Type>?<\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 145, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 3774, + "key.bodyoffset" : 3822, "key.doc.declaration" : "internal func consumePositionalArgument() -> String?", "key.name" : "consumePositionalArgument()", "key.typename" : "ArgumentParser -> () -> String?", @@ -3091,7 +3211,7 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "consumePositionalArgument()<\/Name>s:FC10Commandant14ArgumentParser25consumePositionalArgumentFS0_FT_GSqSS_<\/USR>internal func consumePositionalArgument() -> String?<\/Declaration>Returns the next positional argument that hasn't yet been returned, or\nnil if there are no more positional arguments.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "consumePositionalArgument()<\/Name>s:FC10Commandant14ArgumentParser25consumePositionalArgumentFS0_FT_GSqSS_<\/USR>internal func consumePositionalArgument() -> String?<\/Declaration>Returns the next positional argument that hasn't yet been returned, or nil if there are no more positional arguments.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "consumePositionalArgument()", "key.substructure" : [ @@ -3100,7 +3220,7 @@ }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 4120, + "key.offset" : 4168, "key.parsed_declaration" : "internal func consumeKey(key: String) -> Bool", "key.doc.comment" : "Returns whether the given key was specified and removes it from the\nlist of arguments remaining.", "key.namelength" : 23, @@ -3111,12 +3231,12 @@ "key.parsed_scope.end" : 167, "key.usr" : "s:FC10Commandant14ArgumentParser10consumeKeyFS0_FSSSb", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 4120, + "key.nameoffset" : 4168, "key.annotated_decl" : "internal func consumeKey(key: String<\/Type>) -> Bool<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 162, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 4153, + "key.bodyoffset" : 4201, "key.doc.declaration" : "internal func consumeKey(key: String) -> Bool", "key.name" : "consumeKey(_:)", "key.typename" : "ArgumentParser -> (String) -> Bool", @@ -3126,7 +3246,7 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "consumeKey(_:)<\/Name>s:FC10Commandant14ArgumentParser10consumeKeyFS0_FSSSb<\/USR>internal func consumeKey(key: String) -> Bool<\/Declaration>Returns whether the given key was specified and removes it from the\nlist of arguments remaining.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "consumeKey(_:)<\/Name>s:FC10Commandant14ArgumentParser10consumeKeyFS0_FSSSb<\/USR>internal func consumeKey(key: String) -> Bool<\/Declaration>Returns whether the given key was specified and removes it from the list of arguments remaining.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "consumeKey(_:)", "key.substructure" : [ @@ -3135,23 +3255,23 @@ }, { "key.kind" : "source.lang.swift.decl.function.method.instance", - "key.offset" : 4422, + "key.offset" : 4470, "key.parsed_declaration" : "internal func consumeBooleanFlag(flag: Character) -> Bool", "key.doc.comment" : "Returns whether the given flag was specified and removes it from the\nlist of arguments remaining.", "key.namelength" : 35, "key.doc.line" : 171, - "key.bodylength" : 327, + "key.bodylength" : 328, "key.length" : 35, "key.doc.column" : 16, "key.parsed_scope.end" : 189, "key.usr" : "s:FC10Commandant14ArgumentParser18consumeBooleanFlagFS0_FVSs9CharacterSb", "key.doc.file" : "Commandant\/ArgumentParser.swift", - "key.nameoffset" : 4422, + "key.nameoffset" : 4470, "key.annotated_decl" : "internal func consumeBooleanFlag(flag: Character<\/Type>) -> Bool<\/Type><\/Declaration>", "key.accessibility" : "source.lang.swift.accessibility.internal", "key.parsed_scope.start" : 171, "key.filepath" : "Commandant\/ArgumentParser.swift", - "key.bodyoffset" : 4467, + "key.bodyoffset" : 4515, "key.doc.declaration" : "internal func consumeBooleanFlag(flag: Character) -> Bool", "key.name" : "consumeBooleanFlag(_:)", "key.typename" : "ArgumentParser -> (Character) -> Bool", @@ -3161,7 +3281,7 @@ "key.attribute" : "source.decl.attribute.__raw_doc_comment" } ], - "key.doc.full_as_xml" : "consumeBooleanFlag(_:)<\/Name>s:FC10Commandant14ArgumentParser18consumeBooleanFlagFS0_FVSs9CharacterSb<\/USR>internal func consumeBooleanFlag(flag: Character) -> Bool<\/Declaration>Returns whether the given flag was specified and removes it from the\nlist of arguments remaining.<\/Para><\/Abstract><\/Function>", + "key.doc.full_as_xml" : "consumeBooleanFlag(_:)<\/Name>s:FC10Commandant14ArgumentParser18consumeBooleanFlagFS0_FVSs9CharacterSb<\/USR>internal func consumeBooleanFlag(flag: Character) -> Bool<\/Declaration>Returns whether the given flag was specified and removes it from the list of arguments remaining.<\/Para><\/Abstract><\/Function>", "key.doc.name" : "consumeBooleanFlag(_:)", "key.substructure" : [ @@ -3174,6 +3294,6 @@ ], "key.offset" : 0, "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse", - "key.length" : 4798 + "key.length" : 4847 } }] diff --git a/Source/SourceKittenFrameworkTests/Info.plist b/Source/SourceKittenFrameworkTests/Info.plist index b6c3b887e..e90c12e6a 100644 --- a/Source/SourceKittenFrameworkTests/Info.plist +++ b/Source/SourceKittenFrameworkTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Source/SourceKittenFrameworkTests/ModuleTests.swift b/Source/SourceKittenFrameworkTests/ModuleTests.swift index e1c1bf299..b143b6a5d 100644 --- a/Source/SourceKittenFrameworkTests/ModuleTests.swift +++ b/Source/SourceKittenFrameworkTests/ModuleTests.swift @@ -12,47 +12,39 @@ import XCTest class ModuleTests: XCTestCase { func testModuleNilInPathWithNoXcodeProject() { - let pathWithNoXcodeProject = NSFileManager.defaultManager().currentDirectoryPath.stringByAppendingPathComponent("Source") + let pathWithNoXcodeProject = (__FILE__ as NSString).stringByDeletingLastPathComponent let model = Module(xcodeBuildArguments: [], name: nil, inPath: pathWithNoXcodeProject) XCTAssert(model == nil, "model initialization without any Xcode project should fail") } func testSourceKittenFrameworkDocsAreValidJSON() { - let sourceKittenModule = Module(xcodeBuildArguments: ["-workspace", "SourceKitten.xcworkspace", "-scheme", "SourceKittenFramework"])! + let projectRoot = (((__FILE__ as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent + let sourceKittenModule = Module(xcodeBuildArguments: ["-workspace", "SourceKitten.xcworkspace", "-scheme", "SourceKittenFramework"], name: nil, inPath: projectRoot)! let docsJSON = sourceKittenModule.docs.description XCTAssert(docsJSON.rangeOfString("error type") == nil) - var error: NSError? = nil - let jsonArray = NSJSONSerialization.JSONObjectWithData(docsJSON.dataUsingEncoding(NSUTF8StringEncoding)!, options: nil, error: &error) as! NSArray? - XCTAssertNil(error, "JSON should be propery parsed") - XCTAssertNotNil(jsonArray, "JSON should be propery parsed") + do { + let jsonArray = try NSJSONSerialization.JSONObjectWithData(docsJSON.dataUsingEncoding(NSUTF8StringEncoding)!, options: []) as? NSArray + XCTAssertNotNil(jsonArray, "JSON should be propery parsed") + } catch { + XCTFail("JSON should be propery parsed") + } } func testCommandantDocs() { - let commandantPath = NSFileManager.defaultManager().currentDirectoryPath + "/Carthage/Checkouts/Commandant/" + let projectRoot = (((__FILE__ as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent + let commandantPath = projectRoot + "/Carthage/Checkouts/Commandant/" let commandantModule = Module(xcodeBuildArguments: ["-workspace", "Commandant.xcworkspace", "-scheme", "Commandant"], name: nil, inPath: commandantPath)! let escapedCommandantPath = commandantPath.stringByReplacingOccurrencesOfString("/", withString: "\\/") let comparisonString = commandantModule.docs.description.stringByReplacingOccurrencesOfString(escapedCommandantPath, withString: "") let expected = File(path: fixturesDirectory + "Commandant.json")!.contents - let actualDocsObject = NSJSONSerialization.JSONObjectWithData(comparisonString.dataUsingEncoding(NSUTF8StringEncoding)!, options: nil, error: nil) as! NSArray - let expectedDocsObject = NSJSONSerialization.JSONObjectWithData(expected.dataUsingEncoding(NSUTF8StringEncoding)!, options: nil, error: nil) as! NSArray + let actualDocsObject = try! NSJSONSerialization.JSONObjectWithData(comparisonString.dataUsingEncoding(NSUTF8StringEncoding)!, options: []) as! NSArray + let expectedDocsObject = try! NSJSONSerialization.JSONObjectWithData(expected.dataUsingEncoding(NSUTF8StringEncoding)!, options: []) as! NSArray XCTAssertEqual(actualDocsObject, expectedDocsObject, "should generate expected docs for Swift module") } - - // This test previously failed, but succeeds as of Swift 1.2b1. Keeping as a regression test. -// func testSourceKittenReturnsSameResponse() { -// var lastResponse = "" -// for i in 0..<5 { -// autoreleasepool { -// println(i) -// let sourceKittenModule = Module(xcodeBuildArguments: ["-workspace", "SourceKitten.xcworkspace", "-scheme", "SourceKittenFramework"])! -// let docsJSON = sourceKittenModule.docs.description -// if i == 0 { -// lastResponse = docsJSON -// } else { -// XCTAssertEqual(docsJSON, lastResponse, "current response should match last response") -// lastResponse = docsJSON -// } -// } -// } -// } } diff --git a/Source/SourceKittenFrameworkTests/OffsetMapTests.swift b/Source/SourceKittenFrameworkTests/OffsetMapTests.swift index 69e91ace9..9159da373 100644 --- a/Source/SourceKittenFrameworkTests/OffsetMapTests.swift +++ b/Source/SourceKittenFrameworkTests/OffsetMapTests.swift @@ -12,12 +12,15 @@ import XCTest class OffsetMapTests: XCTestCase { func testOffsetMapContainsDeclarationOffsetWithDocCommentButNotAlreadyDocumented() { - // Enum cases aren't parsed by SourceKit, so OffsetMap should contain its offset. - let file = File(contents: "enum MyEnum {\n/// Doc Comment\ncase First\n}") + // Subscripts aren't parsed by SourceKit, so OffsetMap should contain its offset. + let file = File(contents: + "struct VoidStruct {\n/// Returns or sets Void.\nsubscript(key: String) -> () {\n" + + "get { return () }\nset {}\n}\n}" + ) let documentedTokenOffsets = file.contents.documentedTokenOffsets(SyntaxMap(file: file)) let response = file.processDictionary(Request.EditorOpen(file).send(), cursorInfoRequest: nil) let offsetMap = file.generateOffsetMap(documentedTokenOffsets, dictionary: response) - XCTAssertEqual(offsetMap, [35: 5], "should generate correct offset map of [(declaration offset): (parent offset)]") + XCTAssertEqual(offsetMap, [46: 7], "should generate correct offset map of [(declaration offset): (parent offset)]") } func testOffsetMapDoesntContainAlreadyDocumentedDeclarationOffset() { diff --git a/Source/SourceKittenFrameworkTests/SourceKitTests.swift b/Source/SourceKittenFrameworkTests/SourceKitTests.swift new file mode 100644 index 000000000..b8e729469 --- /dev/null +++ b/Source/SourceKittenFrameworkTests/SourceKitTests.swift @@ -0,0 +1,110 @@ +// +// SourceKitTests.swift +// SourceKitten +// +// Created by JP Simard on 7/15/15. +// Copyright © 2015 SourceKitten. All rights reserved. +// + +import SourceKittenFramework +import XCTest + +private func run(executable: String, arguments: [String]) -> String? { + let task = NSTask() + task.launchPath = executable + task.arguments = arguments + + let pipe = NSPipe() + task.standardOutput = pipe + + task.launch() + + let file = pipe.fileHandleForReading + let output = NSString(data: file.readDataToEndOfFile(), encoding: NSUTF8StringEncoding) + file.closeFile() + return output as String? +} + +private func sourcekitStringsStartingWith(pattern: String) -> Set { + let sourceKitServicePath = (((run("/usr/bin/xcrun", arguments: ["-f", "swiftc"])! as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByAppendingPathComponent("lib/sourcekitd.framework/XPCServices/SourceKitService.xpc/Contents/MacOS/SourceKitService") + let strings = run("/usr/bin/strings", arguments: [sourceKitServicePath]) + return Set(strings!.componentsSeparatedByString("\n").filter { string in + return string.rangeOfString(pattern)?.startIndex == string.startIndex + }) +} + +class SourceKitTests: XCTestCase { + + func testSyntaxKinds() { + let expected: [SyntaxKind] = [ + .Argument, + .AttributeBuiltin, + .AttributeID, + .BuildconfigID, + .BuildconfigKeyword, + .Comment, + .CommentMark, + .CommentURL, + .DocComment, + .DocCommentField, + .Identifier, + .Keyword, + .Number, + .Objectliteral, + .Parameter, + .Placeholder, + .String, + .StringInterpolationAnchor, + .Typeidentifier + ] + XCTAssertEqual( + sourcekitStringsStartingWith("source.lang.swift.syntaxtype."), + Set(expected.map { $0.rawValue }) + ) + } + + func testSwiftDeclarationKind() { + let expected: [SwiftDeclarationKind] = [ + .Class, + .Enum, + .Enumcase, + .Enumelement, + .Extension, + .ExtensionClass, + .ExtensionEnum, + .ExtensionProtocol, + .ExtensionStruct, + .FunctionAccessorAddress, + .FunctionAccessorDidset, + .FunctionAccessorGetter, + .FunctionAccessorMutableaddress, + .FunctionAccessorSetter, + .FunctionAccessorWillset, + .FunctionConstructor, + .FunctionDestructor, + .FunctionFree, + .FunctionMethodClass, + .FunctionMethodInstance, + .FunctionMethodStatic, + .FunctionOperator, + .FunctionSubscript, + .GenericTypeParam, + .Protocol, + .Struct, + .Typealias, + .VarClass, + .VarGlobal, + .VarInstance, + .VarLocal, + .VarParameter, + .VarStatic + ] + XCTAssertEqual( + sourcekitStringsStartingWith("source.lang.swift.decl."), + Set(expected.map { $0.rawValue }) + ) + } +} diff --git a/Source/SourceKittenFrameworkTests/StringTests.swift b/Source/SourceKittenFrameworkTests/StringTests.swift index 442ace156..f2fdfb7f5 100644 --- a/Source/SourceKittenFrameworkTests/StringTests.swift +++ b/Source/SourceKittenFrameworkTests/StringTests.swift @@ -13,56 +13,39 @@ import XCTest class StringTests: XCTestCase { func testStringByRemovingCommonLeadingWhitespaceFromLines() { - autoreleasepool { - let input = "a\n b\n c" - XCTAssertEqual(input.stringByRemovingCommonLeadingWhitespaceFromLines(), input) - } - - autoreleasepool { - let input = " a\n b\n c" - XCTAssertEqual(input.stringByRemovingCommonLeadingWhitespaceFromLines(), "a\n b\n c") - } + var input = "a\n b\n c" + XCTAssertEqual(input.stringByRemovingCommonLeadingWhitespaceFromLines(), input) + + input = " a\n b\n c" + XCTAssertEqual(input.stringByRemovingCommonLeadingWhitespaceFromLines(), "a\n b\n c") } func testStringByTrimmingTrailingCharactersInSet() { + XCTAssertEqual("".stringByTrimmingTrailingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()), "") XCTAssertEqual(" a ".stringByTrimmingTrailingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()), " a") } func testCommentBody() { - autoreleasepool { - let commentString = "/// Single line comment.\n\n" - XCTAssertEqual(commentString.commentBody()!, "Single line comment.") - } - - autoreleasepool { - let commentString = "/// Multiple\n/// single line comments.\n\n" - XCTAssertEqual(commentString.commentBody()!, "Multiple\nsingle line comments.") - } - - autoreleasepool { - let commentString = "/**\nMultiple\nline\ncomments.\n*/" - XCTAssertEqual(commentString.commentBody()!, "Multiple\nline\ncomments.") - } - - autoreleasepool { - let commentString = "/*\nNot a documentation comment.\n*/" - XCTAssertNil(commentString.commentBody()) - } - - autoreleasepool { - let commentString = "// Not a documentation comment." - XCTAssertNil(commentString.commentBody()) - } - - autoreleasepool { - let commentString = "😄\n /// Multiple\n /// single line comments.\n\n" - XCTAssertEqual(commentString.commentBody()!, "Multiple\n single line comments.") - } - - autoreleasepool { - let commentString = "😄\n /**\n Multiple\n line\n comments.\n */" - XCTAssertEqual(commentString.commentBody()!, "Multiple\n line\ncomments.") - } + var commentString = "/// Single line comment.\n\n" + XCTAssertEqual(commentString.commentBody()!, "Single line comment.") + + commentString = "/// Multiple\n/// single line comments.\n\n" + XCTAssertEqual(commentString.commentBody()!, "Multiple\nsingle line comments.") + + commentString = "/**\nMultiple\nline\ncomments.\n*/" + XCTAssertEqual(commentString.commentBody()!, "Multiple\nline\ncomments.") + + commentString = "/*\nNot a documentation comment.\n*/" + XCTAssertNil(commentString.commentBody()) + + commentString = "// Not a documentation comment." + XCTAssertNil(commentString.commentBody()) + + commentString = "😄\n /// Multiple\n /// single line comments.\n\n" + XCTAssertEqual(commentString.commentBody()!, "Multiple\n single line comments.") + + commentString = "😄\n /**\n Multiple\n line\n comments.\n */" + XCTAssertEqual(commentString.commentBody()!, "Multiple\n line\ncomments.") } func testIsSwiftFile() { @@ -98,9 +81,7 @@ class StringTests: XCTestCase { func testIsTokenDocumentable() { let source = "struct A { subscript(key: String) -> Void { return () } }" - let actual = SyntaxMap(file: File(contents: source)).tokens.filter { - source.isTokenDocumentable($0) - } + let actual = SyntaxMap(file: File(contents: source)).tokens.filter(source.isTokenDocumentable) let expected = [ SyntaxToken(type: SyntaxKind.Identifier.rawValue, offset: 7, length: 1), // `A` SyntaxToken(type: SyntaxKind.Keyword.rawValue, offset: 11, length: 9), // `subscript` @@ -110,13 +91,13 @@ class StringTests: XCTestCase { } func testParseDeclaration() { - let dict = [ + let dict: XPCDictionary = [ "key.kind": "source.lang.swift.decl.class", "key.offset": Int64(24), "key.bodyoffset": Int64(32), "key.annotated_decl": "", "key.typename": "ClassA.Type" - ] as XPCDictionary + ] // This string is a regression test for https://github.com/jpsim/SourceKitten/issues/35 . let file = File(contents: "/**\n ほげ\n*/\nclass ClassA {\n}\n") XCTAssertEqual("class ClassA", file.parseDeclaration(dict)!, "should extract declaration from source text") @@ -156,6 +137,7 @@ class StringTests: XCTestCase { } func testLineRangeWithByteRange() { + XCTAssert("".lineRangeWithByteRange(start: 0, length: 0) == nil) let string = "😄\n123" XCTAssert(string.lineRangeWithByteRange(start: 0, length: 0)! == (1, 1)) XCTAssert(string.lineRangeWithByteRange(start: 0, length: 4)! == (1, 1)) diff --git a/Source/SourceKittenFrameworkTests/StructureTests.swift b/Source/SourceKittenFrameworkTests/StructureTests.swift index e4f0f51e0..69621e7fc 100644 --- a/Source/SourceKittenFrameworkTests/StructureTests.swift +++ b/Source/SourceKittenFrameworkTests/StructureTests.swift @@ -13,18 +13,17 @@ import XCTest class StructureTests: XCTestCase { func testPrintEmptyStructure() { - let expected = [ - "key.substructure": [], + let expected: NSDictionary = [ "key.offset": 0, "key.length": 0, "key.diagnostic_stage": "source.diagnostic.stage.swift.parse" - ] as NSDictionary + ] let structure = Structure(file: File(contents: "")) XCTAssertEqual(toAnyObject(structure.dictionary), expected, "should generate expected structure") } func testGenerateSameStructureFileAndContents() { - let fileContents = NSString(contentsOfFile: __FILE__, encoding: NSUTF8StringEncoding, error: nil) as String! + let fileContents = try! NSString(contentsOfFile: __FILE__, encoding: NSUTF8StringEncoding) as String! XCTAssertEqual(Structure(file: File(path: __FILE__)!), Structure(file: File(contents: fileContents)), "should generate the same structure for a file as raw text") @@ -32,7 +31,7 @@ class StructureTests: XCTestCase { func testEnum() { let structure = Structure(file: File(contents: "enum MyEnum { case First }")) - let expectedStructure = [ + let expectedStructure: NSDictionary = [ "key.substructure": [ [ "key.kind": "source.lang.swift.decl.enum", @@ -44,12 +43,24 @@ class StructureTests: XCTestCase { "key.bodylength": 12, "key.length": 26, "key.substructure": [ - // TODO: Uncomment this once rdar://18845613 is fixed. - // [ - // "key.kind": "source.lang.swift.decl.enumelement", - // "key.accessibility": "source.lang.swift.accessibility.internal", - // "key.name": "First" - // ] + [ + "key.kind": "source.lang.swift.decl.enumcase", + "key.offset": 14, + "key.length": 10, + "key.nameoffset": 0, + "key.namelength": 0, + "key.substructure": [ + [ + "key.kind": "source.lang.swift.decl.enumelement", + "key.accessibility": "source.lang.swift.accessibility.internal", + "key.name": "First", + "key.offset": 19, + "key.length": 5, + "key.nameoffset": 19, + "key.namelength": 5 + ] + ] + ] ], "key.name": "MyEnum" ] @@ -63,7 +74,7 @@ class StructureTests: XCTestCase { func testStructurePrintValidJSON() { let structure = Structure(file: File(contents: "struct A { func b() {} }")) - let expectedStructure = [ + let expectedStructure: NSDictionary = [ "key.substructure": [ [ "key.kind": "source.lang.swift.decl.struct", @@ -84,9 +95,6 @@ class StructureTests: XCTestCase { "key.bodyoffset": 21, "key.bodylength": 0, "key.length": 11, - "key.substructure": [ - - ], "key.name": "b()" ] ], @@ -100,12 +108,14 @@ class StructureTests: XCTestCase { XCTAssertEqual(toAnyObject(structure.dictionary), expectedStructure, "should generate expected structure") let structureJSON = structure.description - var error: NSError? = nil - let jsonDictionary = NSJSONSerialization.JSONObjectWithData(structureJSON.dataUsingEncoding(NSUTF8StringEncoding)!, options: nil, error: &error) as! NSDictionary? - XCTAssertNil(error, "JSON should be propery parsed") - XCTAssertNotNil(jsonDictionary, "JSON should be propery parsed") - if let jsonDictionary = jsonDictionary { - XCTAssertEqual(jsonDictionary, expectedStructure, "JSON should match expected structure") + do { + let jsonDictionary = try NSJSONSerialization.JSONObjectWithData(structureJSON.dataUsingEncoding(NSUTF8StringEncoding)!, options: []) as? NSDictionary + XCTAssertNotNil(jsonDictionary, "JSON should be propery parsed") + if let jsonDictionary = jsonDictionary { + XCTAssertEqual(jsonDictionary, expectedStructure, "JSON should match expected structure") + } + } catch { + XCTFail("JSON should be propery parsed") } } } diff --git a/Source/SourceKittenFrameworkTests/SwiftDocsTests.swift b/Source/SourceKittenFrameworkTests/SwiftDocsTests.swift index 65e4c4c18..71926aa48 100644 --- a/Source/SourceKittenFrameworkTests/SwiftDocsTests.swift +++ b/Source/SourceKittenFrameworkTests/SwiftDocsTests.swift @@ -20,7 +20,7 @@ func compareDocsWithFixturesName(name: String) { let comparisonString = docs.description.stringByReplacingOccurrencesOfString(escapedFixturesDirectory, withString: "") func docsObject(docsString: String) -> NSDictionary { - return NSJSONSerialization.JSONObjectWithData(docsString.dataUsingEncoding(NSUTF8StringEncoding)!, options: nil, error: nil) as! NSDictionary + return try! NSJSONSerialization.JSONObjectWithData(docsString.dataUsingEncoding(NSUTF8StringEncoding)!, options: []) as! NSDictionary } XCTAssertEqual( diff --git a/Source/SourceKittenFrameworkTests/SyntaxTests.swift b/Source/SourceKittenFrameworkTests/SyntaxTests.swift index e883bc11b..e5b3bd2eb 100644 --- a/Source/SourceKittenFrameworkTests/SyntaxTests.swift +++ b/Source/SourceKittenFrameworkTests/SyntaxTests.swift @@ -11,7 +11,7 @@ import SourceKittenFramework import SwiftXPC import XCTest -func compareSyntax(file: File, expectedTokens: [(SyntaxKind, Int, Int)]) { +func compareSyntax(file: File, _ expectedTokens: [(SyntaxKind, Int, Int)]) { let expectedSyntaxMap = SyntaxMap(tokens: expectedTokens.map { tokenTuple in return SyntaxToken(type: tokenTuple.0.rawValue, offset: tokenTuple.1, length: tokenTuple.2) }) @@ -19,7 +19,7 @@ func compareSyntax(file: File, expectedTokens: [(SyntaxKind, Int, Int)]) { XCTAssertEqual(syntaxMap, expectedSyntaxMap, "should generate expected syntax map") let syntaxJSON = syntaxMap.description - let jsonArray = NSJSONSerialization.JSONObjectWithData(syntaxJSON.dataUsingEncoding(NSUTF8StringEncoding)!, options: nil, error: nil) as! NSArray? + let jsonArray = try! NSJSONSerialization.JSONObjectWithData(syntaxJSON.dataUsingEncoding(NSUTF8StringEncoding)!, options: []) as? NSArray XCTAssertNotNil(jsonArray, "JSON should be propery parsed") XCTAssertEqual(jsonArray!, expectedSyntaxMap.tokens.map { $0.dictionaryValue }, "JSON should match expected syntax") } @@ -30,7 +30,7 @@ class SyntaxTests: XCTestCase { } func testGenerateSameSyntaxMapFileAndContents() { - let fileContents = NSString(contentsOfFile: __FILE__, encoding: NSUTF8StringEncoding, error: nil) as String! + let fileContents = try! NSString(contentsOfFile: __FILE__, encoding: NSUTF8StringEncoding) as String! XCTAssertEqual(SyntaxMap(file: File(path: __FILE__)!), SyntaxMap(file: File(contents: fileContents)), "should generate the same syntax map for a file as raw text") diff --git a/Source/sourcekitten/Components.plist b/Source/sourcekitten/Components.plist index e7878994e..00d649ab4 100644 --- a/Source/sourcekitten/Components.plist +++ b/Source/sourcekitten/Components.plist @@ -13,33 +13,29 @@ BundleOverwriteAction RootRelativeBundlePath - Library/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework + /usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SwiftXPC.framework BundleOverwriteAction RootRelativeBundlePath - Library/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework + /usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/SWXMLHash.framework + + + BundleOverwriteAction + + RootRelativeBundlePath + /usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Commandant.framework + + + BundleOverwriteAction + + RootRelativeBundlePath + /usr/local/Frameworks/SourceKittenFramework.framework/Versions/A/Frameworks/Result.framework RootRelativeBundlePath - Library/Frameworks/SourceKittenFramework.framework - - - BundleIsVersionChecked - - BundleOverwriteAction - upgrade - RootRelativeBundlePath - Library/Frameworks/Commandant.framework - - - BundleIsVersionChecked - - BundleOverwriteAction - upgrade - RootRelativeBundlePath - Library/Frameworks/LlamaKit.framework + /usr/local/Frameworks/SourceKittenFramework.framework diff --git a/Source/sourcekitten/Doc.swift b/Source/sourcekitten/DocCommand.swift similarity index 61% rename from Source/sourcekitten/Doc.swift rename to Source/sourcekitten/DocCommand.swift index 0cfd4202c..47ec65422 100644 --- a/Source/sourcekitten/Doc.swift +++ b/Source/sourcekitten/DocCommand.swift @@ -8,11 +8,10 @@ import Commandant import Foundation -import LlamaKit +import Result import SourceKittenFramework struct DocCommand: CommandType { - typealias ClientError = SourceKittenError let verb = "doc" let function = "Print Swift docs as JSON or Objective-C docs as XML" @@ -20,55 +19,55 @@ struct DocCommand: CommandType { return DocOptions.evaluate(mode).flatMap { options in let args = Process.arguments if options.objc { - return DocCommand.runObjC(options, args: args) + return runObjC(options, args: args) } if options.singleFile { - return DocCommand.runSwiftSingleFile(args) + return runSwiftSingleFile(args) } - let moduleName: String? = count(options.moduleName) > 0 ? options.moduleName : nil - return DocCommand.runSwiftModule(moduleName, args: args) + let moduleName: String? = options.moduleName.isEmpty ? nil : options.moduleName + return runSwiftModule(moduleName, args: args) } } - static func runSwiftModule(moduleName: String?, args: [String]) -> Result<(), CommandantError> { + func runSwiftModule(moduleName: String?, args: [String]) -> Result<(), CommandantError> { let xcodeBuildArgumentsStart = (moduleName != nil) ? 4 : 2 let xcodeBuildArguments = Array(args[xcodeBuildArgumentsStart.. Result<(), CommandantError> { + func runSwiftSingleFile(args: [String]) -> Result<(), CommandantError> { if args.count < 5 { - return failure(toCommandantError(.InvalidArgument(description: "at least 5 arguments are required when using `--single-file`"))) + return .Failure(.CommandError(.InvalidArgument(description: "at least 5 arguments are required when using `--single-file`"))) } let sourcekitdArguments = Array(args[4.. Result<(), CommandantError> { + func runObjC(options: DocOptions, args: [String]) -> Result<(), CommandantError> { if args.count < 5 { - return failure(toCommandantError(.InvalidArgument(description: "at least 5 arguments are required when using `--objc`"))) + return .Failure(.CommandError(.InvalidArgument(description: "at least 5 arguments are required when using `--objc`"))) } let startIndex = options.singleFile ? 4 : 3 let (headerFiles, xcodebuildArguments) = parseHeaderFilesAndXcodebuildArguments(Array(args[startIndex.. DocOptions { - return self(singleFile: singleFile, moduleName: moduleName, objc: objc) + return self.init(singleFile: singleFile, moduleName: moduleName, objc: objc) } static func evaluate(m: CommandMode) -> Result> { diff --git a/Source/sourcekitten/Errors.swift b/Source/sourcekitten/Errors.swift index c5b1100a6..e808a9ee8 100644 --- a/Source/sourcekitten/Errors.swift +++ b/Source/sourcekitten/Errors.swift @@ -6,11 +6,10 @@ // Copyright (c) 2015 SourceKitten. All rights reserved. // -import LlamaKit import Commandant /// Possible errors within SourceKitten. -enum SourceKittenError: Printable { +enum SourceKittenError: CustomStringConvertible { /// One or more argument was invalid. case InvalidArgument(description: String) @@ -27,12 +26,8 @@ enum SourceKittenError: Printable { return description case let .ReadFailed(path): return "Failed to read file at '\(path)'" - case let .DocFailed: + case .DocFailed: return "Failed to generate documentation" } } } - -func toCommandantError(sourceKittenError: SourceKittenError) -> CommandantError { - return .CommandError(Box(sourceKittenError)) -} diff --git a/Source/sourcekitten/Info.plist b/Source/sourcekitten/Info.plist index c10692f9e..c90a63db1 100644 --- a/Source/sourcekitten/Info.plist +++ b/Source/sourcekitten/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.1 + 0.4.4 CFBundleSignature ???? CFBundleVersion diff --git a/Source/sourcekitten/Structure.swift b/Source/sourcekitten/StructureCommand.swift similarity index 71% rename from Source/sourcekitten/Structure.swift rename to Source/sourcekitten/StructureCommand.swift index 0cbf0d1b0..b86566be2 100644 --- a/Source/sourcekitten/Structure.swift +++ b/Source/sourcekitten/StructureCommand.swift @@ -8,28 +8,27 @@ import Commandant import Foundation -import LlamaKit +import Result import SourceKittenFramework struct StructureCommand: CommandType { - typealias ClientError = SourceKittenError let verb = "structure" let function = "Print Swift structure information as JSON" func run(mode: CommandMode) -> Result<(), CommandantError> { return StructureOptions.evaluate(mode).flatMap { options in - if count(options.file) > 0 { + if !options.file.isEmpty { if let file = File(path: options.file.absolutePathRepresentation()) { - println(Structure(file: file)) - return success() + print(Structure(file: file)) + return .Success() } - return failure(toCommandantError(.ReadFailed(path: options.file))) + return .Failure(.CommandError(.ReadFailed(path: options.file))) } - if count(options.text) > 0 { - println(Structure(file: File(contents: options.text))) - return success() + if !options.text.isEmpty { + print(Structure(file: File(contents: options.text))) + return .Success() } - return failure(toCommandantError( + return .Failure(.CommandError( .InvalidArgument(description: "either file or text must be set when calling structure") )) } @@ -41,7 +40,7 @@ struct StructureOptions: OptionsType { let text: String static func create(file: String)(text: String) -> StructureOptions { - return self(file: file, text: text) + return self.init(file: file, text: text) } static func evaluate(m: CommandMode) -> Result> { diff --git a/Source/sourcekitten/Syntax.swift b/Source/sourcekitten/SyntaxCommand.swift similarity index 64% rename from Source/sourcekitten/Syntax.swift rename to Source/sourcekitten/SyntaxCommand.swift index f043c09e8..d986f70b1 100644 --- a/Source/sourcekitten/Syntax.swift +++ b/Source/sourcekitten/SyntaxCommand.swift @@ -8,28 +8,24 @@ import Commandant import Foundation -import LlamaKit +import Result import SourceKittenFramework struct SyntaxCommand: CommandType { - typealias ClientError = SourceKittenError let verb = "syntax" let function = "Print Swift syntax information as JSON" func run(mode: CommandMode) -> Result<(), CommandantError> { return SyntaxOptions.evaluate(mode).flatMap { options in - if count(options.file) > 0 { + if !options.file.isEmpty { if let file = File(path: options.file.absolutePathRepresentation()) { - println(SyntaxMap(file: file)) - return success() + print(SyntaxMap(file: file)) + return .Success() } - return failure(toCommandantError(.ReadFailed(path: options.file))) + return .Failure(.CommandError(.ReadFailed(path: options.file))) } - if count(options.text) > 0 { - println(SyntaxMap(file: File(contents: options.text))) - return success() - } - return failure(toCommandantError(.InvalidArgument(description: "either file or text must be set when calling syntax"))) + print(SyntaxMap(file: File(contents: options.text))) + return .Success() } } } @@ -39,7 +35,7 @@ struct SyntaxOptions: OptionsType { let text: String static func create(file: String)(text: String) -> SyntaxOptions { - return self(file: file, text: text) + return self.init(file: file, text: text) } static func evaluate(m: CommandMode) -> Result> { diff --git a/Source/sourcekitten/Version.swift b/Source/sourcekitten/VersionCommand.swift similarity index 72% rename from Source/sourcekitten/Version.swift rename to Source/sourcekitten/VersionCommand.swift index 6c82856f2..8c7f8f46c 100644 --- a/Source/sourcekitten/Version.swift +++ b/Source/sourcekitten/VersionCommand.swift @@ -7,23 +7,22 @@ // import Commandant -import LlamaKit +import Result -private let version = "0.4.1" +private let version = "0.4.4" struct VersionCommand: CommandType { - typealias ClientError = SourceKittenError let verb = "version" let function = "Display the current version of SourceKitten" func run(mode: CommandMode) -> Result<(), CommandantError> { switch mode { - case let .Arguments: - println(version) + case .Arguments: + print(version) default: break } - return success() + return .Success() } } diff --git a/SourceKitten.xcworkspace/contents.xcworkspacedata b/SourceKitten.xcworkspace/contents.xcworkspacedata index 590c6643f..88e7d163b 100644 --- a/SourceKitten.xcworkspace/contents.xcworkspacedata +++ b/SourceKitten.xcworkspace/contents.xcworkspacedata @@ -11,9 +11,9 @@ location = "group:Carthage/Checkouts/Commandant/Commandant.xcodeproj"> + location = "group:Carthage/Checkouts/SWXMLHash/SWXMLHash.xcodeproj"> + location = "group:Carthage/Checkouts/Result/Result.xcodeproj"> diff --git a/SourceKitten.xcworkspace/xcshareddata/SourceKitten.xcscmblueprint b/SourceKitten.xcworkspace/xcshareddata/SourceKitten.xcscmblueprint new file mode 100644 index 000000000..639ce95bc --- /dev/null +++ b/SourceKitten.xcworkspace/xcshareddata/SourceKitten.xcscmblueprint @@ -0,0 +1,58 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "FD7DA18210A2C280E9107E37D7344F243FEE5F75", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "956D2B21DD155C49504BB67697A67F7C5351A353" : 0, + "E084C86B03F81D63323C9E7510697EA528A758C7" : 0, + "947B9A1B25FBE0E030E0018E6E29E38DC0FAD47B" : 0, + "EB2210CFD48672E403BED699D5D7F01B844069CF" : 0, + "FD7DA18210A2C280E9107E37D7344F243FEE5F75" : 0, + "D23C0CEAADB77074FDA4459000068A7940EB7AD0" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "D49287F8-563C-45DB-9C27-8C32380F653E", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "956D2B21DD155C49504BB67697A67F7C5351A353" : "SourceKitten\/Carthage\/Checkouts\/Result\/", + "E084C86B03F81D63323C9E7510697EA528A758C7" : "SourceKitten\/Carthage\/Checkouts\/Commandant\/Carthage\/Checkouts\/xcconfigs\/", + "947B9A1B25FBE0E030E0018E6E29E38DC0FAD47B" : "SourceKitten\/Carthage\/Checkouts\/SwiftXPC\/", + "EB2210CFD48672E403BED699D5D7F01B844069CF" : "SourceKitten\/Carthage\/Checkouts\/SWXMLHash\/", + "FD7DA18210A2C280E9107E37D7344F243FEE5F75" : "SourceKitten\/", + "D23C0CEAADB77074FDA4459000068A7940EB7AD0" : "SourceKitten\/Carthage\/Checkouts\/Commandant\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "SourceKitten", + "DVTSourceControlWorkspaceBlueprintVersion" : 203, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "SourceKitten.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jpsim\/SwiftXPC.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "947B9A1B25FBE0E030E0018E6E29E38DC0FAD47B" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/antitypical\/Result.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "956D2B21DD155C49504BB67697A67F7C5351A353" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jpsim\/Commandant.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D23C0CEAADB77074FDA4459000068A7940EB7AD0" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jspahrsummers\/xcconfigs.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E084C86B03F81D63323C9E7510697EA528A758C7" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/drmohundro\/SWXMLHash.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "EB2210CFD48672E403BED699D5D7F01B844069CF" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:jpsim\/SourceKitten", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "FD7DA18210A2C280E9107E37D7344F243FEE5F75" + } + ] +} \ No newline at end of file diff --git a/jazzy.sh b/jazzy.sh index ed1e264fd..a7883a836 100755 --- a/jazzy.sh +++ b/jazzy.sh @@ -4,8 +4,8 @@ jazzy -m SourceKitten \ -a "JP Simard" \ -u https://github.com/jpsim/SourceKitten \ -g https://github.com/jpsim/SourceKitten \ ---github-file-prefix https://github.com/jpsim/SourceKitten/blob/0.4.1 \ ---module-version 0.4.1 \ +--github-file-prefix https://github.com/jpsim/SourceKitten/blob/0.4.4 \ +--module-version 0.4.4 \ -r http://www.jpsim.com/SourceKitten/ \ -x -workspace,SourceKitten.xcworkspace,-scheme,SourceKittenFramework \ -c diff --git a/sourcekitten.xcodeproj/project.pbxproj b/sourcekitten.xcodeproj/project.pbxproj index fab0fd53f..941190b6c 100644 --- a/sourcekitten.xcodeproj/project.pbxproj +++ b/sourcekitten.xcodeproj/project.pbxproj @@ -13,14 +13,18 @@ D0DB09A419EA354200234B16 /* SyntaxTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0DB09A319EA354200234B16 /* SyntaxTests.swift */; }; D0E7B65319E9C6AD00EDBA4D /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0D1216D19E87B05005E4BAA /* SourceKittenFramework.framework */; }; D0E7B65619E9C76900EDBA4D /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0D1211B19E87861005E4BAA /* main.swift */; }; + E805A0481B55CBAF00EA654A /* SourceKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E805A0471B55CBAF00EA654A /* SourceKitTests.swift */; }; + E805A04A1B560FCA00EA654A /* FileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E805A0491B560FCA00EA654A /* FileTests.swift */; }; E80F23671A5CADD900FD2352 /* SwiftDocsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80F23661A5CADD900FD2352 /* SwiftDocsTests.swift */; }; E80F23691A5CB01A00FD2352 /* SyntaxKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80F23681A5CB01A00FD2352 /* SyntaxKind.swift */; }; E80F236B1A5CB04100FD2352 /* SyntaxToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80F236A1A5CB04100FD2352 /* SyntaxToken.swift */; }; E8241CA31A5E01840047687E /* ModuleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8241CA21A5E01840047687E /* ModuleTests.swift */; }; E8241CA51A5E01A10047687E /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8241CA41A5E01A10047687E /* Module.swift */; }; E834740F1A593B5B00532B9A /* Structure.swift in Sources */ = {isa = PBXBuildFile; fileRef = E834740E1A593B5B00532B9A /* Structure.swift */; }; + E834D61E1B2D054B002AA1FE /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E834D61D1B2D054B002AA1FE /* Result.framework */; }; + E834D61F1B2D0554002AA1FE /* Result.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = E834D61D1B2D054B002AA1FE /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; E83748C31A5BCD7900862B1B /* OffsetMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83748C21A5BCD7900862B1B /* OffsetMap.swift */; }; - E83A0B351A5D382B0041A60A /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83A0B341A5D382B0041A60A /* Version.swift */; }; + E83A0B351A5D382B0041A60A /* VersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83A0B341A5D382B0041A60A /* VersionCommand.swift */; }; E83C8E9A1A5CBADD003A8D35 /* SwiftXPC+JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83C8E991A5CBADD003A8D35 /* SwiftXPC+JSON.swift */; }; E847636A1A5A0651000EAE22 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = E84763691A5A0651000EAE22 /* File.swift */; }; E852418F1A5F4FB3007099FB /* Dictionary+Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E852418E1A5F4FB3007099FB /* Dictionary+Merge.swift */; }; @@ -30,11 +34,14 @@ E868473C1A587C6E0043DC65 /* sourcekitd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E868473B1A587C6E0043DC65 /* sourcekitd.framework */; }; E868473E1A587CCC0043DC65 /* sourcekitd.swift in Sources */ = {isa = PBXBuildFile; fileRef = E868473D1A587CCC0043DC65 /* sourcekitd.swift */; }; E872121A1AD2FFCD00A484F4 /* Array+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87212191AD2FFCD00A484F4 /* Array+SourceKitten.swift */; }; - E881A6951A5DFF3000491D0E /* LlamaKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E854CAA61A5DF71100211501 /* LlamaKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + E87429AA1B07A7920064F38B /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */; }; + E87429AC1B07A79D0064F38B /* Commandant.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; E89291A71A5B7FF800D91568 /* SwiftDocKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = E89291A61A5B7FF800D91568 /* SwiftDocKey.swift */; }; E89291A91A5B800300D91568 /* SwiftDeclarationKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = E89291A81A5B800300D91568 /* SwiftDeclarationKind.swift */; }; E8A18A3B1A58971D000362B7 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A18A3A1A58971D000362B7 /* Language.swift */; }; E8A18A3F1A592246000362B7 /* SwiftDocs.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A18A3E1A592246000362B7 /* SwiftDocs.swift */; }; + E8A9B8901B56CB5500CD17D4 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A9B88F1B56CB5500CD17D4 /* Xcode.swift */; }; + E8A9B8921B56D1B100CD17D4 /* SourceDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A9B8911B56D1B100CD17D4 /* SourceDeclaration.swift */; }; E8AB1A2E1A649F2100452012 /* libclang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E8AB1A2D1A649F2100452012 /* libclang.dylib */; }; E8AB1A301A64A21400452012 /* ClangTranslationUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8AB1A2F1A64A21400452012 /* ClangTranslationUnitTests.swift */; }; E8AE53C71A5B5FCA0092D24A /* String+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8AE53C61A5B5FCA0092D24A /* String+SourceKitten.swift */; }; @@ -44,7 +51,6 @@ E8C9EA081A5C99C400A6D4D1 /* StringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8C9EA071A5C99C400A6D4D1 /* StringTests.swift */; }; E8C9EA0A1A5C9A2900A6D4D1 /* OffsetMapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8C9EA091A5C9A2900A6D4D1 /* OffsetMapTests.swift */; }; E8CC8A2D1A587FD300D1FEC7 /* SyntaxMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8CC8A2C1A587FD300D1FEC7 /* SyntaxMap.swift */; }; - E8CE24B51A5DFEEB00DCB8A0 /* LlamaKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E854CAA61A5DF71100211501 /* LlamaKit.framework */; }; E8D474331A648ED10011A49C /* BuildSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = E8D4742C1A648ED10011A49C /* BuildSystem.h */; settings = {ATTRIBUTES = (Public, ); }; }; E8D474341A648ED10011A49C /* CXCompilationDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = E8D4742D1A648ED10011A49C /* CXCompilationDatabase.h */; settings = {ATTRIBUTES = (Public, ); }; }; E8D474351A648ED10011A49C /* CXErrorCode.h in Headers */ = {isa = PBXBuildFile; fileRef = E8D4742E1A648ED10011A49C /* CXErrorCode.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -54,12 +60,9 @@ E8D474391A648ED10011A49C /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = E8D474321A648ED10011A49C /* Platform.h */; settings = {ATTRIBUTES = (Public, ); }; }; E8D4743B1A648F290011A49C /* ClangTranslationUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8D4743A1A648F290011A49C /* ClangTranslationUnit.swift */; }; E8D86D851A688EF20063E8E9 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8D86D841A688EF20063E8E9 /* Errors.swift */; }; - E8DD06E61AE44540006D9C86 /* Structure.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80604B21A5D452C0016D959 /* Structure.swift */; }; - E8DD06E71AE447AB006D9C86 /* Syntax.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83A0B361A5D399A0041A60A /* Syntax.swift */; }; - E8DD06E81AE447E9006D9C86 /* Doc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80604B41A5D474B0016D959 /* Doc.swift */; }; - E8DEEB141A6313070001BBD1 /* SequenceType+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8DEEB131A6313070001BBD1 /* SequenceType+SourceKitten.swift */; }; - E8EBAA5E1A5D374B002F1B8E /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */; }; - E8EBAA5F1A5D374B002F1B8E /* Commandant.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + E8DD06E61AE44540006D9C86 /* StructureCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80604B21A5D452C0016D959 /* StructureCommand.swift */; }; + E8DD06E71AE447AB006D9C86 /* SyntaxCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = E83A0B361A5D399A0041A60A /* SyntaxCommand.swift */; }; + E8DD06E81AE447E9006D9C86 /* DocCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = E80604B41A5D474B0016D959 /* DocCommand.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -86,6 +89,8 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + E834D61F1B2D0554002AA1FE /* Result.framework in Copy Frameworks */, + E87429AC1B07A79D0064F38B /* Commandant.framework in Copy Frameworks */, E8C0DFCE1AD349E5007EE3D4 /* SWXMLHash.framework in Copy Frameworks */, E86847381A587B0A0043DC65 /* SwiftXPC.framework in Copy Frameworks */, ); @@ -98,8 +103,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - E881A6951A5DFF3000491D0E /* LlamaKit.framework in Embed Frameworks */, - E8EBAA5F1A5D374B002F1B8E /* Commandant.framework in Embed Frameworks */, D0AAAB5019FB0960007B24B3 /* SourceKittenFramework.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -136,18 +139,20 @@ D0D1217D19E87B05005E4BAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D0DB09A319EA354200234B16 /* SyntaxTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyntaxTests.swift; sourceTree = ""; usesTabs = 0; }; D0E7B63219E9C64500EDBA4D /* sourcekitten.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sourcekitten.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D0E7B65819E9CA0800EDBA4D /* sourcekitten */ = {isa = PBXFileReference; lastKnownFileType = text; path = sourcekitten; sourceTree = BUILT_PRODUCTS_DIR; }; - E80604B21A5D452C0016D959 /* Structure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Structure.swift; sourceTree = ""; }; - E80604B41A5D474B0016D959 /* Doc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Doc.swift; sourceTree = ""; }; + E805A0471B55CBAF00EA654A /* SourceKitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SourceKitTests.swift; sourceTree = ""; }; + E805A0491B560FCA00EA654A /* FileTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileTests.swift; sourceTree = ""; }; + E80604B21A5D452C0016D959 /* StructureCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StructureCommand.swift; sourceTree = ""; }; + E80604B41A5D474B0016D959 /* DocCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DocCommand.swift; sourceTree = ""; }; E80F23661A5CADD900FD2352 /* SwiftDocsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftDocsTests.swift; sourceTree = ""; }; E80F23681A5CB01A00FD2352 /* SyntaxKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyntaxKind.swift; sourceTree = ""; }; E80F236A1A5CB04100FD2352 /* SyntaxToken.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyntaxToken.swift; sourceTree = ""; }; E8241CA21A5E01840047687E /* ModuleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ModuleTests.swift; sourceTree = ""; }; E8241CA41A5E01A10047687E /* Module.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; E834740E1A593B5B00532B9A /* Structure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Structure.swift; sourceTree = ""; usesTabs = 0; }; + E834D61D1B2D054B002AA1FE /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E83748C21A5BCD7900862B1B /* OffsetMap.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OffsetMap.swift; sourceTree = ""; }; - E83A0B341A5D382B0041A60A /* Version.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Version.swift; sourceTree = ""; }; - E83A0B361A5D399A0041A60A /* Syntax.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Syntax.swift; sourceTree = ""; }; + E83A0B341A5D382B0041A60A /* VersionCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VersionCommand.swift; sourceTree = ""; }; + E83A0B361A5D399A0041A60A /* SyntaxCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyntaxCommand.swift; sourceTree = ""; }; E83C8E991A5CBADD003A8D35 /* SwiftXPC+JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SwiftXPC+JSON.swift"; sourceTree = ""; }; E84763691A5A0651000EAE22 /* File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; usesTabs = 0; }; E852418E1A5F4FB3007099FB /* Dictionary+Merge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Dictionary+Merge.swift"; sourceTree = ""; }; @@ -161,6 +166,8 @@ E89291A81A5B800300D91568 /* SwiftDeclarationKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftDeclarationKind.swift; sourceTree = ""; }; E8A18A3A1A58971D000362B7 /* Language.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = ""; usesTabs = 0; }; E8A18A3E1A592246000362B7 /* SwiftDocs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftDocs.swift; sourceTree = ""; usesTabs = 0; }; + E8A9B88F1B56CB5500CD17D4 /* Xcode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Xcode.swift; sourceTree = ""; }; + E8A9B8911B56D1B100CD17D4 /* SourceDeclaration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SourceDeclaration.swift; sourceTree = ""; }; E8AB1A2D1A649F2100452012 /* libclang.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libclang.dylib; path = Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib; sourceTree = DEVELOPER_DIR; }; E8AB1A2F1A64A21400452012 /* ClangTranslationUnitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClangTranslationUnitTests.swift; sourceTree = ""; }; E8AE53C61A5B5FCA0092D24A /* String+SourceKitten.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+SourceKitten.swift"; sourceTree = ""; }; @@ -178,7 +185,6 @@ E8D474321A648ED10011A49C /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = ""; }; E8D4743A1A648F290011A49C /* ClangTranslationUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClangTranslationUnit.swift; sourceTree = ""; }; E8D86D841A688EF20063E8E9 /* Errors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; - E8DEEB131A6313070001BBD1 /* SequenceType+SourceKitten.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SequenceType+SourceKitten.swift"; sourceTree = ""; }; E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Commandant.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -187,6 +193,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + E834D61E1B2D054B002AA1FE /* Result.framework in Frameworks */, + E87429AA1B07A7920064F38B /* Commandant.framework in Frameworks */, E8AB1A2E1A649F2100452012 /* libclang.dylib in Frameworks */, E868473C1A587C6E0043DC65 /* sourcekitd.framework in Frameworks */, E86847371A587AF40043DC65 /* SwiftXPC.framework in Frameworks */, @@ -206,9 +214,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E8EBAA5E1A5D374B002F1B8E /* Commandant.framework in Frameworks */, D0E7B65319E9C6AD00EDBA4D /* SourceKittenFramework.framework in Frameworks */, - E8CE24B51A5DFEEB00DCB8A0 /* LlamaKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -218,8 +224,6 @@ 5499CA981A2394BD00783309 /* Supporting Files */ = { isa = PBXGroup; children = ( - E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */, - E854CAA61A5DF71100211501 /* LlamaKit.framework */, 5499CA961A2394B700783309 /* Components.plist */, 5499CA971A2394B700783309 /* Info.plist */, ); @@ -233,7 +237,6 @@ D0D1216E19E87B05005E4BAA /* SourceKittenFramework */, D0D1217B19E87B05005E4BAA /* SourceKittenFrameworkTests */, D0D1211919E87861005E4BAA /* Products */, - D0E7B65819E9CA0800EDBA4D /* sourcekitten */, ); sourceTree = ""; usesTabs = 0; @@ -252,10 +255,10 @@ isa = PBXGroup; children = ( D0D1211B19E87861005E4BAA /* main.swift */, - E80604B41A5D474B0016D959 /* Doc.swift */, - E80604B21A5D452C0016D959 /* Structure.swift */, - E83A0B361A5D399A0041A60A /* Syntax.swift */, - E83A0B341A5D382B0041A60A /* Version.swift */, + E80604B41A5D474B0016D959 /* DocCommand.swift */, + E80604B21A5D452C0016D959 /* StructureCommand.swift */, + E83A0B361A5D399A0041A60A /* SyntaxCommand.swift */, + E83A0B341A5D382B0041A60A /* VersionCommand.swift */, E8D86D841A688EF20063E8E9 /* Errors.swift */, 5499CA981A2394BD00783309 /* Supporting Files */, ); @@ -342,7 +345,7 @@ E8241CA41A5E01A10047687E /* Module.swift */, E83748C21A5BCD7900862B1B /* OffsetMap.swift */, E86847391A587B4D0043DC65 /* Request.swift */, - E8DEEB131A6313070001BBD1 /* SequenceType+SourceKitten.swift */, + E8A9B8911B56D1B100CD17D4 /* SourceDeclaration.swift */, E868473D1A587CCC0043DC65 /* sourcekitd.swift */, E8AE53C61A5B5FCA0092D24A /* String+SourceKitten.swift */, E834740E1A593B5B00532B9A /* Structure.swift */, @@ -353,6 +356,7 @@ E80F23681A5CB01A00FD2352 /* SyntaxKind.swift */, E8CC8A2C1A587FD300D1FEC7 /* SyntaxMap.swift */, E80F236A1A5CB04100FD2352 /* SyntaxToken.swift */, + E8A9B88F1B56CB5500CD17D4 /* Xcode.swift */, D0D1216F19E87B05005E4BAA /* Supporting Files */, ); name = SourceKittenFramework; @@ -362,6 +366,9 @@ D0D1216F19E87B05005E4BAA /* Supporting Files */ = { isa = PBXGroup; children = ( + E834D61D1B2D054B002AA1FE /* Result.framework */, + E8EBAA5D1A5D374B002F1B8E /* Commandant.framework */, + E854CAA61A5DF71100211501 /* LlamaKit.framework */, E8AB1A2D1A649F2100452012 /* libclang.dylib */, E868473B1A587C6E0043DC65 /* sourcekitd.framework */, E86847361A587AF40043DC65 /* SwiftXPC.framework */, @@ -375,8 +382,10 @@ isa = PBXGroup; children = ( E8AB1A2F1A64A21400452012 /* ClangTranslationUnitTests.swift */, + E805A0491B560FCA00EA654A /* FileTests.swift */, E8241CA21A5E01840047687E /* ModuleTests.swift */, E8C9EA091A5C9A2900A6D4D1 /* OffsetMapTests.swift */, + E805A0471B55CBAF00EA654A /* SourceKitTests.swift */, E8C9EA071A5C99C400A6D4D1 /* StringTests.swift */, E8C9EA031A5C986A00A6D4D1 /* StructureTests.swift */, E80F23661A5CADD900FD2352 /* SwiftDocsTests.swift */, @@ -492,7 +501,9 @@ D0D1211019E87861005E4BAA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0630; + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = SourceKitten; TargetAttributes = { D0D1216C19E87B05005E4BAA = { @@ -572,9 +583,9 @@ E8CC8A2D1A587FD300D1FEC7 /* SyntaxMap.swift in Sources */, E89291A91A5B800300D91568 /* SwiftDeclarationKind.swift in Sources */, E83748C31A5BCD7900862B1B /* OffsetMap.swift in Sources */, - E8DEEB141A6313070001BBD1 /* SequenceType+SourceKitten.swift in Sources */, E8AE53C71A5B5FCA0092D24A /* String+SourceKitten.swift in Sources */, E852418F1A5F4FB3007099FB /* Dictionary+Merge.swift in Sources */, + E8A9B8901B56CB5500CD17D4 /* Xcode.swift in Sources */, E80F23691A5CB01A00FD2352 /* SyntaxKind.swift in Sources */, E872121A1AD2FFCD00A484F4 /* Array+SourceKitten.swift in Sources */, E847636A1A5A0651000EAE22 /* File.swift in Sources */, @@ -583,6 +594,7 @@ E8241CA51A5E01A10047687E /* Module.swift in Sources */, E80F236B1A5CB04100FD2352 /* SyntaxToken.swift in Sources */, E868473E1A587CCC0043DC65 /* sourcekitd.swift in Sources */, + E8A9B8921B56D1B100CD17D4 /* SourceDeclaration.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -590,9 +602,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E805A04A1B560FCA00EA654A /* FileTests.swift in Sources */, E80F23671A5CADD900FD2352 /* SwiftDocsTests.swift in Sources */, E8AB1A301A64A21400452012 /* ClangTranslationUnitTests.swift in Sources */, D0DB09A419EA354200234B16 /* SyntaxTests.swift in Sources */, + E805A0481B55CBAF00EA654A /* SourceKitTests.swift in Sources */, E8C9EA0A1A5C9A2900A6D4D1 /* OffsetMapTests.swift in Sources */, E8C9EA081A5C99C400A6D4D1 /* StringTests.swift in Sources */, E8C9EA041A5C986A00A6D4D1 /* StructureTests.swift in Sources */, @@ -604,12 +618,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E83A0B351A5D382B0041A60A /* Version.swift in Sources */, - E8DD06E71AE447AB006D9C86 /* Syntax.swift in Sources */, - E8DD06E81AE447E9006D9C86 /* Doc.swift in Sources */, + E83A0B351A5D382B0041A60A /* VersionCommand.swift in Sources */, + E8DD06E71AE447AB006D9C86 /* SyntaxCommand.swift in Sources */, + E8DD06E81AE447E9006D9C86 /* DocCommand.swift in Sources */, D0E7B65619E9C76900EDBA4D /* main.swift in Sources */, E8D86D851A688EF20063E8E9 /* Errors.swift in Sources */, - E8DD06E61AE44540006D9C86 /* Structure.swift in Sources */, + E8DD06E61AE44540006D9C86 /* StructureCommand.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -633,6 +647,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1212619E878CC005E4BAA /* Debug.xcconfig */; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; @@ -670,6 +685,7 @@ "$(inherited)", "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -701,6 +717,7 @@ "$(inherited)", "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -720,7 +737,9 @@ "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); + GCC_GENERATE_TEST_COVERAGE_FILES = YES; INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; name = Debug; @@ -733,7 +752,9 @@ "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); + GCC_GENERATE_TEST_COVERAGE_FILES = YES; INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; name = Release; @@ -768,6 +789,7 @@ "$(inherited)", "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -787,7 +809,9 @@ "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); + GCC_GENERATE_TEST_COVERAGE_FILES = YES; INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; name = Profile; @@ -822,6 +846,7 @@ "$(inherited)", "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -841,7 +866,9 @@ "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); + GCC_GENERATE_TEST_COVERAGE_FILES = YES; INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; name = Test; @@ -852,7 +879,8 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -863,7 +891,8 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Test; @@ -874,7 +903,8 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -885,7 +915,8 @@ buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/SourceKittenFramework.framework/Versions/Current/Frameworks /Library/Frameworks /Library/Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Profile; diff --git a/sourcekitten.xcodeproj/xcshareddata/xcschemes/SourceKittenFramework.xcscheme b/sourcekitten.xcodeproj/xcshareddata/xcschemes/SourceKittenFramework.xcscheme index c2d9c5fa2..3c6be242f 100644 --- a/sourcekitten.xcodeproj/xcshareddata/xcschemes/SourceKittenFramework.xcscheme +++ b/sourcekitten.xcodeproj/xcshareddata/xcschemes/SourceKittenFramework.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES"> @@ -62,15 +63,18 @@ ReferencedContainer = "container:SourceKitten.xcodeproj"> + + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -48,16 +48,19 @@ ReferencedContainer = "container:SourceKitten.xcodeproj"> + +