Skip to content

Instantly share code, notes, and snippets.

@galli-leo
Last active June 24, 2018 17:25
Show Gist options
  • Save galli-leo/169a8a65bc504fd8d4db78ca7ecdfdf8 to your computer and use it in GitHub Desktop.
Save galli-leo/169a8a65bc504fd8d4db78ca7ecdfdf8 to your computer and use it in GitHub Desktop.
TestFramework SourceKitten example
//
// ClassWithEnum.swift
// TestFramework
//
// Created by Leonardo Galli on 15.06.18.
// Copyright © 2018 Leonardo Galli. All rights reserved.
//
import Foundation
public class WithEnum {
public let name: String = "enumclass"
public enum TestEnum {
case test
case otherTest
}
}
[{
"\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/ClassWithEnum.swift" : {
"key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
"key.length" : 320,
"key.offset" : 0,
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public class WithEnum<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 173
}
],
"key.bodylength" : 122,
"key.bodyoffset" : 196,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/ClassWithEnum.swift",
"key.fully_annotated_decl" : "<decl.class><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>class<\/syntaxtype.keyword> <decl.name>WithEnum<\/decl.name><\/decl.class>",
"key.kind" : "source.lang.swift.decl.class",
"key.length" : 139,
"key.name" : "WithEnum",
"key.namelength" : 8,
"key.nameoffset" : 186,
"key.offset" : 180,
"key.parsed_annotated_decl" : "public class WithEnum",
"key.parsed_declaration" : "public class WithEnum",
"key.parsed_scope.end" : 18,
"key.parsed_scope.start" : 11,
"key.runtime_name" : "_TtC8__main__8WithEnum",
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public let name: <Type usr=\"s:SS\">String<\/Type><\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 201
}
],
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/ClassWithEnum.swift",
"key.fully_annotated_decl" : "<decl.var.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>let<\/syntaxtype.keyword> <decl.name>name<\/decl.name>: <decl.var.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.type><\/decl.var.instance>",
"key.kind" : "source.lang.swift.decl.var.instance",
"key.length" : 30,
"key.name" : "name",
"key.namelength" : 4,
"key.nameoffset" : 212,
"key.offset" : 208,
"key.parsed_annotated_decl" : "public let name: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>",
"key.parsed_declaration" : "public let name: String = \"enumclass\"",
"key.parsed_scope.end" : 12,
"key.parsed_scope.start" : 12,
"key.typename" : "String",
"key.typeusr" : "_T0SSD",
"key.usr" : "s:13TestFramework8WithEnumC4nameSSvp"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public enum <Type usr=\"s:13TestFramework8WithEnumC\">WithEnum<\/Type>.TestEnum<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 248
}
],
"key.bodylength" : 46,
"key.bodyoffset" : 270,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/ClassWithEnum.swift",
"key.fully_annotated_decl" : "<decl.enum><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>enum<\/syntaxtype.keyword> <ref.class usr=\"s:13TestFramework8WithEnumC\">WithEnum<\/ref.class>.<decl.name>TestEnum<\/decl.name><\/decl.enum>",
"key.kind" : "source.lang.swift.decl.enum",
"key.length" : 62,
"key.name" : "TestEnum",
"key.namelength" : 8,
"key.nameoffset" : 260,
"key.offset" : 255,
"key.parsed_annotated_decl" : "public enum <USRLINK usr=\"s:13TestFramework8WithEnumC\">WithEnum<\/USRLINK>.TestEnum",
"key.parsed_declaration" : "public enum TestEnum",
"key.parsed_scope.end" : 17,
"key.parsed_scope.start" : 14,
"key.substructure" : [
{
"key.kind" : "source.lang.swift.decl.enumcase",
"key.length" : 9,
"key.namelength" : 0,
"key.nameoffset" : 0,
"key.offset" : 279,
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.internal",
"key.annotated_decl" : "<Declaration>case test<\/Declaration>",
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/ClassWithEnum.swift",
"key.fully_annotated_decl" : "<decl.enumelement><syntaxtype.keyword>case<\/syntaxtype.keyword> <decl.name>test<\/decl.name><\/decl.enumelement>",
"key.kind" : "source.lang.swift.decl.enumelement",
"key.length" : 4,
"key.name" : "test",
"key.namelength" : 4,
"key.nameoffset" : 284,
"key.offset" : 284,
"key.parsed_annotated_decl" : "case test",
"key.parsed_declaration" : "case test",
"key.parsed_scope.end" : 15,
"key.parsed_scope.start" : 15,
"key.typename" : "(WithEnum.TestEnum.Type) -> WithEnum.TestEnum",
"key.typeusr" : "_T013TestFramework8WithEnumC0aD0OAEmcD",
"key.usr" : "s:13TestFramework8WithEnumC0aD0O4testA2EmF"
}
]
},
{
"key.kind" : "source.lang.swift.decl.enumcase",
"key.length" : 14,
"key.namelength" : 0,
"key.nameoffset" : 0,
"key.offset" : 297,
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.internal",
"key.annotated_decl" : "<Declaration>case otherTest<\/Declaration>",
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/ClassWithEnum.swift",
"key.fully_annotated_decl" : "<decl.enumelement><syntaxtype.keyword>case<\/syntaxtype.keyword> <decl.name>otherTest<\/decl.name><\/decl.enumelement>",
"key.kind" : "source.lang.swift.decl.enumelement",
"key.length" : 9,
"key.name" : "otherTest",
"key.namelength" : 9,
"key.nameoffset" : 302,
"key.offset" : 302,
"key.parsed_annotated_decl" : "case otherTest",
"key.parsed_declaration" : "case otherTest",
"key.parsed_scope.end" : 16,
"key.parsed_scope.start" : 16,
"key.typename" : "(WithEnum.TestEnum.Type) -> WithEnum.TestEnum",
"key.typeusr" : "_T013TestFramework8WithEnumC0aD0OAEmcD",
"key.usr" : "s:13TestFramework8WithEnumC0aD0O05otherA0A2EmF"
}
]
}
],
"key.typename" : "WithEnum.TestEnum.Type",
"key.typeusr" : "_T013TestFramework8WithEnumC0aD0OmD",
"key.usr" : "s:13TestFramework8WithEnumC0aD0O"
}
],
"key.typename" : "WithEnum.Type",
"key.typeusr" : "_T013TestFramework8WithEnumCmD",
"key.usr" : "s:13TestFramework8WithEnumC"
}
]
}
}, {
"\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift" : {
"key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
"key.length" : 1251,
"key.offset" : 0,
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public class Test : Swift.<Type usr=\"s:s23CustomStringConvertibleP\">CustomStringConvertible<\/Type><\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 169
}
],
"key.bodylength" : 651,
"key.bodyoffset" : 220,
"key.elements" : [
{
"key.kind" : "source.lang.swift.structure.elem.typeref",
"key.length" : 29,
"key.offset" : 189
}
],
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.class><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>class<\/syntaxtype.keyword> <decl.name>Test<\/decl.name> : Swift.<ref.protocol usr=\"s:s23CustomStringConvertibleP\">CustomStringConvertible<\/ref.protocol><\/decl.class>",
"key.inheritedtypes" : [
{
"key.name" : "Swift.CustomStringConvertible"
}
],
"key.kind" : "source.lang.swift.decl.class",
"key.length" : 696,
"key.name" : "Test",
"key.namelength" : 4,
"key.nameoffset" : 182,
"key.offset" : 176,
"key.parsed_annotated_decl" : "public class Test : Swift.<USRLINK usr=\"s:s23CustomStringConvertibleP\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/customstringconvertible\">CustomStringConvertible<\/USRLINK>",
"key.parsed_declaration" : "public class Test : Swift.CustomStringConvertible",
"key.parsed_scope.end" : 37,
"key.parsed_scope.start" : 11,
"key.runtime_name" : "_TtC8__main__4Test",
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public let name: <Type usr=\"s:SS\">String<\/Type><\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 225
}
],
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.var.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>let<\/syntaxtype.keyword> <decl.name>name<\/decl.name>: <decl.var.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.type><\/decl.var.instance>",
"key.kind" : "source.lang.swift.decl.var.instance",
"key.length" : 25,
"key.name" : "name",
"key.namelength" : 4,
"key.nameoffset" : 236,
"key.offset" : 232,
"key.parsed_annotated_decl" : "public let name: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>",
"key.parsed_declaration" : "public let name: String = \"test\"",
"key.parsed_scope.end" : 12,
"key.parsed_scope.start" : 12,
"key.typename" : "String",
"key.typeusr" : "_T0SSD",
"key.usr" : "s:13TestFramework0A0C4nameSSvp"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public var description: <Type usr=\"s:SS\">String<\/Type> { get }<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 293
}
],
"key.bodylength" : 30,
"key.bodyoffset" : 325,
"key.doc.column" : 16,
"key.doc.comment" : "My test documentation",
"key.doc.declaration" : "public var description: String { get }",
"key.doc.file" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.doc.full_as_xml" : "<Other file=\"\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift\" line=\"15\" column=\"16\"><Name>description<\/Name><USR>s:13TestFramework0A0C11descriptionSSvp<\/USR><Declaration>public var description: String { get }<\/Declaration><CommentParts><Abstract><Para>My test documentation<\/Para><\/Abstract><\/CommentParts><\/Other>",
"key.doc.line" : 15,
"key.doc.name" : "description",
"key.doc.parsed_comment" : "My test documentation",
"key.doc.type" : "Other",
"key.doclength" : 26,
"key.docoffset" : 263,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.var.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>var<\/syntaxtype.keyword> <decl.name>description<\/decl.name>: <decl.var.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.type> { <syntaxtype.keyword>get<\/syntaxtype.keyword> }<\/decl.var.instance>",
"key.kind" : "source.lang.swift.decl.var.instance",
"key.length" : 56,
"key.name" : "description",
"key.namelength" : 11,
"key.nameoffset" : 304,
"key.offset" : 300,
"key.overrides" : [
{
"key.usr" : "s:s23CustomStringConvertibleP11descriptionSSvp"
}
],
"key.parsed_annotated_decl" : "public var description: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK> { get }",
"key.parsed_declaration" : "public var description: String",
"key.parsed_scope.end" : 17,
"key.parsed_scope.start" : 15,
"key.typename" : "String",
"key.typeusr" : "_T0SSD",
"key.usr" : "s:13TestFramework0A0C11descriptionSSvp"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public func test(first: <Type usr=\"s:SS\">String<\/Type>, second: <Type usr=\"s:SS\">String<\/Type>, closure: @escaping ((<Type usr=\"s:SS\">String<\/Type>, <Type usr=\"s:SS\">String<\/Type>) -&gt; (<Type usr=\"s:SS\">String<\/Type>, <Type usr=\"s:SS\">String<\/Type>))) throws -&gt; <Type usr=\"s:SS\">String<\/Type><\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 366
}
],
"key.bodylength" : 23,
"key.bodyoffset" : 491,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.function.method.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>func<\/syntaxtype.keyword> <decl.name>test<\/decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>first<\/decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.parameter.type><\/decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>second<\/decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.parameter.type><\/decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>closure<\/decl.var.parameter.argument_label>: @escaping <decl.var.parameter.type><tuple>(<tuple.element><tuple.element.type>(<decl.var.parameter><decl.var.parameter.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.parameter.type><\/decl.var.parameter>, <decl.var.parameter><decl.var.parameter.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.parameter.type><\/decl.var.parameter>) -&gt; <decl.function.returntype><tuple>(<tuple.element><tuple.element.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/tuple.element.type><\/tuple.element>, <tuple.element><tuple.element.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/tuple.element.type><\/tuple.element>)<\/tuple><\/decl.function.returntype><\/tuple.element.type><\/tuple.element>)<\/tuple><\/decl.var.parameter.type><\/decl.var.parameter>) <syntaxtype.keyword>throws<\/syntaxtype.keyword> -&gt; <decl.function.returntype><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.function.returntype><\/decl.function.method.instance>",
"key.kind" : "source.lang.swift.decl.function.method.instance",
"key.length" : 142,
"key.name" : "test(first:second:closure:)",
"key.namelength" : 94,
"key.nameoffset" : 378,
"key.offset" : 373,
"key.parsed_annotated_decl" : "public func test(first: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>, second: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>, closure: @escaping ((<USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>, <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>) -> (<USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>, <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>))) throws -> <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>",
"key.parsed_declaration" : "public func test(first: String, second: String, closure: @escaping ((String, String) -> (String, String))) throws -> String",
"key.parsed_scope.end" : 21,
"key.parsed_scope.start" : 19,
"key.related_decls" : [
{
"key.annotated_decl" : "<RelatedName usr=\"s:13TestFramework0A0C4testySS5first_tF\">test(first:)<\/RelatedName>"
}
],
"key.substructure" : [
],
"key.typename" : "(Test) -> (String, String, @escaping ((String, String) -> (String, String))) throws -> String",
"key.typeusr" : "_T0S2S5first_SS6secondSS_SStSS_SStc7closuretKcD",
"key.usr" : "s:13TestFramework0A0C4testS2S5first_SS6secondSS_SStSS_SStc7closuretKF"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public func test(first: <Type usr=\"s:SS\">String<\/Type>)<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 645
}
],
"key.bodylength" : 81,
"key.bodyoffset" : 678,
"key.doc.column" : 17,
"key.doc.comment" : "Declares a special enum `Test.test.InsideFunction` with case `Test.test(_:).InsideFunction.insideFunctionTest`.",
"key.doc.declaration" : "public func test(first: String)",
"key.doc.file" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.doc.full_as_xml" : "<Function file=\"\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift\" line=\"24\" column=\"17\"><Name>test(first:)<\/Name><USR>s:13TestFramework0A0C4testySS5first_tF<\/USR><Declaration>public func test(first: String)<\/Declaration><CommentParts><Abstract><Para>Declares a special enum <codeVoice>Test.test.InsideFunction<\/codeVoice> with case <codeVoice>Test.test(_:).InsideFunction.insideFunctionTest<\/codeVoice>.<\/Para><\/Abstract><\/CommentParts><\/Function>",
"key.doc.line" : 24,
"key.doc.name" : "test(first:)",
"key.doc.parsed_comment" : "Declares a special enum `<USRLINK usr=\"s:13TestFramework0A0C4testySS5first_tF14InsideFunctionL_O\">Test.test.InsideFunction<\/USRLINK>` with case `<USRLINK usr=\"s:13TestFramework0A0C4testySS5first_tF14InsideFunctionL_O06insidefA0A2GmF\">Test.test(_:).InsideFunction.insideFunctionTest<\/USRLINK>`.",
"key.doc.type" : "Function",
"key.doclength" : 116,
"key.docoffset" : 525,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.function.method.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>func<\/syntaxtype.keyword> <decl.name>test<\/decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>first<\/decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.parameter.type><\/decl.var.parameter>)<\/decl.function.method.instance>",
"key.kind" : "source.lang.swift.decl.function.method.instance",
"key.length" : 108,
"key.name" : "test(first:)",
"key.namelength" : 19,
"key.nameoffset" : 657,
"key.offset" : 652,
"key.parsed_annotated_decl" : "public func test(first: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>)",
"key.parsed_declaration" : "public func test(first: String)",
"key.parsed_scope.end" : 28,
"key.parsed_scope.start" : 24,
"key.related_decls" : [
{
"key.annotated_decl" : "<RelatedName usr=\"s:13TestFramework0A0C4testS2S5first_SS6secondSS_SStSS_SStc7closuretKF\">test(first:second:closure:)<\/RelatedName>"
}
],
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.private",
"key.annotated_decl" : "<Declaration>enum InsideFunction<\/Declaration>",
"key.bodylength" : 45,
"key.bodyoffset" : 708,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.enum><syntaxtype.keyword>enum<\/syntaxtype.keyword> <decl.name>InsideFunction<\/decl.name><\/decl.enum>",
"key.kind" : "source.lang.swift.decl.enum",
"key.length" : 67,
"key.name" : "InsideFunction",
"key.namelength" : 14,
"key.nameoffset" : 692,
"key.offset" : 687,
"key.parsed_annotated_decl" : "enum InsideFunction",
"key.parsed_declaration" : "enum InsideFunction",
"key.parsed_scope.end" : 27,
"key.parsed_scope.start" : 25,
"key.substructure" : [
{
"key.kind" : "source.lang.swift.decl.enumcase",
"key.length" : 23,
"key.namelength" : 0,
"key.nameoffset" : 0,
"key.offset" : 721,
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.private",
"key.annotated_decl" : "<Declaration>case insideFunctionTest<\/Declaration>",
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.enumelement><syntaxtype.keyword>case<\/syntaxtype.keyword> <decl.name>insideFunctionTest<\/decl.name><\/decl.enumelement>",
"key.kind" : "source.lang.swift.decl.enumelement",
"key.length" : 18,
"key.name" : "insideFunctionTest",
"key.namelength" : 18,
"key.nameoffset" : 726,
"key.offset" : 726,
"key.parsed_annotated_decl" : "case insideFunctionTest",
"key.parsed_declaration" : "case insideFunctionTest",
"key.parsed_scope.end" : 26,
"key.parsed_scope.start" : 26,
"key.typename" : "(InsideFunction.Type) -> InsideFunction",
"key.typeusr" : "_T013TestFramework0A0C4testySS5first_tF14InsideFunctionL_OAGmcD",
"key.usr" : "s:13TestFramework0A0C4testySS5first_tF14InsideFunctionL_O06insidefA0A2GmF"
}
]
}
],
"key.typename" : "InsideFunction.Type",
"key.typeusr" : "_T013TestFramework0A0C4testySS5first_tF14InsideFunctionL_OmD",
"key.usr" : "s:13TestFramework0A0C4testySS5first_tF14InsideFunctionL_O"
}
],
"key.typename" : "(Test) -> (String) -> ()",
"key.typeusr" : "_T0ySS5first_tcD",
"key.usr" : "s:13TestFramework0A0C4testySS5first_tF"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public func test2(first: <Type usr=\"s:SS\">String<\/Type>)<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 770
}
],
"key.bodylength" : 14,
"key.bodyoffset" : 804,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.function.method.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>func<\/syntaxtype.keyword> <decl.name>test2<\/decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>first<\/decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.parameter.type><\/decl.var.parameter>)<\/decl.function.method.instance>",
"key.kind" : "source.lang.swift.decl.function.method.instance",
"key.length" : 42,
"key.name" : "test2(first:)",
"key.namelength" : 20,
"key.nameoffset" : 782,
"key.offset" : 777,
"key.parsed_annotated_decl" : "public func test2(first: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK>)",
"key.parsed_declaration" : "public func test2(first: String)",
"key.parsed_scope.end" : 32,
"key.parsed_scope.start" : 30,
"key.substructure" : [
],
"key.typename" : "(Test) -> (String) -> ()",
"key.typeusr" : "_T0ySS5first_tcD",
"key.usr" : "s:13TestFramework0A0C5test2ySS5first_tF"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public class <Type usr=\"s:13TestFramework0A0C\">Test<\/Type>.NestedClass<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 829
}
],
"key.bodylength" : 14,
"key.bodyoffset" : 855,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.class><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>class<\/syntaxtype.keyword> <ref.class usr=\"s:13TestFramework0A0C\">Test<\/ref.class>.<decl.name>NestedClass<\/decl.name><\/decl.class>",
"key.kind" : "source.lang.swift.decl.class",
"key.length" : 34,
"key.name" : "NestedClass",
"key.namelength" : 11,
"key.nameoffset" : 842,
"key.offset" : 836,
"key.parsed_annotated_decl" : "public class <USRLINK usr=\"s:13TestFramework0A0C\">Test<\/USRLINK>.NestedClass",
"key.parsed_declaration" : "public class NestedClass",
"key.parsed_scope.end" : 36,
"key.parsed_scope.start" : 34,
"key.typename" : "Test.NestedClass.Type",
"key.typeusr" : "_T013TestFramework0A0C11NestedClassCmD",
"key.usr" : "s:13TestFramework0A0C11NestedClassC"
}
],
"key.typename" : "Test.Type",
"key.typeusr" : "_T013TestFramework0A0CmD",
"key.usr" : "s:13TestFramework0A0C"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public class ChildTest : <Type usr=\"s:13TestFramework0A0C\">Test<\/Type><\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 1042
}
],
"key.bodylength" : 119,
"key.bodyoffset" : 1072,
"key.doc.column" : 14,
"key.doc.comment" : "This class is a subclass of `Test`. It does not override `Test.test(_:_:_:)` also known as `Test.test(...)`. Additionally it provides no impl for `Test.test(_:)`.",
"key.doc.declaration" : "public class ChildTest : Test",
"key.doc.file" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.doc.full_as_xml" : "<Class file=\"\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift\" line=\"41\" column=\"14\"><Name>ChildTest<\/Name><USR>s:13TestFramework05ChildA0C<\/USR><Declaration>public class ChildTest : Test<\/Declaration><CommentParts><Abstract><Para>This class is a subclass of <codeVoice>Test<\/codeVoice>. It does not override <codeVoice>Test.test(_:_:_:)<\/codeVoice> also known as <codeVoice>Test.test(...)<\/codeVoice>. Additionally it provides no impl for <codeVoice>Test.test(_:)<\/codeVoice>.<\/Para><\/Abstract><\/CommentParts><\/Class>",
"key.doc.line" : 41,
"key.doc.name" : "ChildTest",
"key.doc.parsed_comment" : "This class is a subclass of `<USRLINK usr=\"s:13TestFramework0A0C\">Test<\/USRLINK>`. It does not override `<USRLINK usr=\"s:13TestFramework0A0C4testS2S5first_SS6secondSS_SStSS_SStc7closuretKF\">Test.test(_:_:_:)<\/USRLINK>` also known as `<USRLINK usr=\"s:13TestFramework0A0C4testS2S5first_SS6secondSS_SStSS_SStc7closuretKF\">Test.test(...)<\/USRLINK>`. Additionally it provides no impl for `<USRLINK usr=\"s:13TestFramework0A0C4testySS5first_tF\">Test.test(_:)<\/USRLINK>`.",
"key.doc.type" : "Class",
"key.doclength" : 167,
"key.docoffset" : 875,
"key.elements" : [
{
"key.kind" : "source.lang.swift.structure.elem.typeref",
"key.length" : 4,
"key.offset" : 1066
}
],
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.class><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>class<\/syntaxtype.keyword> <decl.name>ChildTest<\/decl.name> : <ref.class usr=\"s:13TestFramework0A0C\">Test<\/ref.class><\/decl.class>",
"key.inheritedtypes" : [
{
"key.name" : "Test"
}
],
"key.kind" : "source.lang.swift.decl.class",
"key.length" : 143,
"key.name" : "ChildTest",
"key.namelength" : 9,
"key.nameoffset" : 1055,
"key.offset" : 1049,
"key.parsed_annotated_decl" : "public class ChildTest : <USRLINK usr=\"s:13TestFramework0A0C\">Test<\/USRLINK>",
"key.parsed_declaration" : "public class ChildTest: Test",
"key.parsed_scope.end" : 46,
"key.parsed_scope.start" : 41,
"key.runtime_name" : "_TtC8__main__9ChildTest",
"key.substructure" : [
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public override var description: <Type usr=\"s:SS\">String<\/Type> { get }<\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.override",
"key.length" : 8,
"key.offset" : 1120
},
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 1113
}
],
"key.bodylength" : 35,
"key.bodyoffset" : 1154,
"key.doc.column" : 25,
"key.doc.comment" : "My other test documentation",
"key.doc.declaration" : "public override var description: String { get }",
"key.doc.file" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.doc.full_as_xml" : "<Other file=\"\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift\" line=\"43\" column=\"25\"><Name>description<\/Name><USR>s:13TestFramework05ChildA0C11descriptionSSvp<\/USR><Declaration>public override var description: String { get }<\/Declaration><CommentParts><Abstract><Para>My other test documentation<\/Para><\/Abstract><\/CommentParts><\/Other>",
"key.doc.line" : 43,
"key.doc.name" : "description",
"key.doc.parsed_comment" : "My other test documentation",
"key.doc.type" : "Other",
"key.doclength" : 32,
"key.docoffset" : 1077,
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.var.instance><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>override<\/syntaxtype.keyword> <syntaxtype.keyword>var<\/syntaxtype.keyword> <decl.name>description<\/decl.name>: <decl.var.type><ref.struct usr=\"s:SS\">String<\/ref.struct><\/decl.var.type> { <syntaxtype.keyword>get<\/syntaxtype.keyword> }<\/decl.var.instance>",
"key.kind" : "source.lang.swift.decl.var.instance",
"key.length" : 61,
"key.name" : "description",
"key.namelength" : 11,
"key.nameoffset" : 1133,
"key.offset" : 1129,
"key.overrides" : [
{
"key.usr" : "s:13TestFramework0A0C11descriptionSSvp"
},
{
"key.usr" : "s:s23CustomStringConvertibleP11descriptionSSvp"
}
],
"key.parsed_annotated_decl" : "public override var description: <USRLINK usr=\"s:SS\" url=\"https:\/\/developer.apple.com\/documentation\/swift\/string\">String<\/USRLINK> { get }",
"key.parsed_declaration" : "public override var description: String",
"key.parsed_scope.end" : 45,
"key.parsed_scope.start" : 43,
"key.typename" : "String",
"key.typeusr" : "_T0SSD",
"key.usr" : "s:13TestFramework05ChildA0C11descriptionSSvp"
}
],
"key.typename" : "ChildTest.Type",
"key.typeusr" : "_T013TestFramework05ChildA0CmD",
"key.usr" : "s:13TestFramework05ChildA0C"
},
{
"key.accessibility" : "source.lang.swift.accessibility.public",
"key.annotated_decl" : "<Declaration>public class ChildNestedClass : <Type usr=\"s:13TestFramework0A0C\">Test<\/Type>.<Type usr=\"s:13TestFramework0A0C11NestedClassC\">NestedClass<\/Type><\/Declaration>",
"key.attributes" : [
{
"key.attribute" : "source.decl.attribute.public",
"key.length" : 6,
"key.offset" : 1194
}
],
"key.bodylength" : 6,
"key.bodyoffset" : 1243,
"key.elements" : [
{
"key.kind" : "source.lang.swift.structure.elem.typeref",
"key.length" : 16,
"key.offset" : 1225
}
],
"key.filepath" : "\/Users\/leonardogalli\/Code\/jazzy\/TestFramework\/TestFramework\/TestClass.swift",
"key.fully_annotated_decl" : "<decl.class><syntaxtype.keyword>public<\/syntaxtype.keyword> <syntaxtype.keyword>class<\/syntaxtype.keyword> <decl.name>ChildNestedClass<\/decl.name> : <ref.class usr=\"s:13TestFramework0A0C\">Test<\/ref.class>.<ref.class usr=\"s:13TestFramework0A0C11NestedClassC\">NestedClass<\/ref.class><\/decl.class>",
"key.inheritedtypes" : [
{
"key.name" : "Test.NestedClass"
}
],
"key.kind" : "source.lang.swift.decl.class",
"key.length" : 49,
"key.name" : "ChildNestedClass",
"key.namelength" : 16,
"key.nameoffset" : 1207,
"key.offset" : 1201,
"key.parsed_annotated_decl" : "public class ChildNestedClass : <USRLINK usr=\"s:13TestFramework0A0C\">Test<\/USRLINK>.<USRLINK usr=\"s:13TestFramework0A0C11NestedClassC\">NestedClass<\/USRLINK>",
"key.parsed_declaration" : "public class ChildNestedClass: Test.NestedClass",
"key.parsed_scope.end" : 50,
"key.parsed_scope.start" : 48,
"key.runtime_name" : "_TtC8__main__16ChildNestedClass",
"key.typename" : "ChildNestedClass.Type",
"key.typeusr" : "_T013TestFramework16ChildNestedClassCmD",
"key.usr" : "s:13TestFramework16ChildNestedClassC"
}
]
}
}]
//
// TestClass.swift
// TestFramework
//
// Created by Leonardo Galli on 15.06.18.
// Copyright © 2018 Leonardo Galli. All rights reserved.
//
import Foundation
public class Test : Swift.CustomStringConvertible {
public let name: String = "test"
/// My test documentation
public var description: String {
return "My test"
}
public func test(first: String, second: String, closure: @escaping ((String, String) -> (String, String))) throws -> String {
return ""
}
/// Declares a special enum `Test.test.InsideFunction` with case `Test.test(_:).InsideFunction.insideFunctionTest`.
public func test(first: String) {
enum InsideFunction {
case insideFunctionTest
}
}
public func test2(first: String) {
}
public class NestedClass {
}
}
/// This class is a subclass of `Test`. It does not override `Test.test(_:_:_:)` also known as `Test.test(...)`. Additionally it provides no impl for `Test.test(_:)`.
public class ChildTest: Test {
/// My other test documentation
public override var description: String {
return "My ChildTest"
}
}
public class ChildNestedClass: Test.NestedClass {
}
@galli-leo
Copy link
Author

See http://galli.me/jazzy-demo/index.html for a rendered live demo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment