                 insertDoc(response, &openResponse, Int64(offsetsMap[offset]!), file)
             }
         }
-        println(toJSON(openResponse))
-    }
+        responses.append(openResponse)
+    }
+    println(toJSON(responses))
 }
 
 /**

    }
    xpc_dictionary_set_value(cursorInfoRequest, "key.compilerargs", xpcArguments)

    // Print docs for each Swift file
    for file in swiftFiles {
        xpc_dictionary_set_string(openRequest, "key.sourcefile", file)

:returns: Converted JSON
*/
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
*/
func toJSON(array: XPCArray) -> String {
    var anyArray = [AnyObject]()
    for item in array {
        anyArray.append(toAnyObject(item as XPCDictionary))
    }
    return toJSON(anyArray)
}

/**
JSON Object to JSON String

:param: object Object to convert to JSON.
:returns: JSON string representation of the input object.
*/
func toJSON(object: AnyObject) -> String {
    let prettyJSONData = NSJSONSerialization.dataWithJSONObject(object,
        options: .PrettyPrinted,
        error: nil)
    return NSString(data: prettyJSONData!, encoding: NSUTF8StringEncoding)!
