From 5bc7cc9361546a611a32fff32238fe25fed16f09 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Mon, 17 Oct 2016 17:53:21 -0700 Subject: [PATCH] Merge Swift 3 api guidelines into master (#273) * label argument in CXCursor.swiftDeclaration() method * rename CodeCompletionItem.parseResponse(_:) for Swift 3 * update File.swift for Swift 3 API Design Guidelines * update Language enum members to be lowercase for Swift 3 API Design Guidelines * Rename DynamicLinkLibrary.loadSymbol(_:) to load(symbol:) for Swift 3 API Design Guidelines * update library_wrapper.swift for Swift 3 API Design Guidelines * update ObjCDeclarationKind members to Swift 3 API Design Guidelines * change ObjCDeclarationKind.fromClang(_:) to an initializer * update OffsetMap for Swift 3 API Design Guidelines * refactor Request.swift for Swift 3 API Design Guidelines * update SourceDeclaration.swift for Swift 3 API Design Guidelines * update SourceDeclaration.swift for Swift 3 API Design Guidelines * update StatementKind, SwiftDeclarationKind and SyntaxKind enums to have lowercase members to comply with Swift 3 API Design Guidelines * refactor String+SourceKitten.swift for Swift 3 API Design Guidelines * refactor SwiftDocKey for Swift 3 API Design Guidelines * refactor SyntaxMap for Swift 3 API Design Guidelines * update Xcode.swift for Swift 3 API Design Guidelines * update sourcekitten target for Swift 3 API Design Guidelines * refactor tests for Swift 3 API Design Guidelines * amend Swift 3 changelog entry to note API changes * lowercase Request members to conform to Swift 3 API Design Guidelines * Add `@available` to swift 3 api guidelines changes * Add `@available` to `Request.Error` * lowercase Request.Error members to conform to Swift 3 API Design Guidelines (#272) `@available` will be added by separate commit. --- .../CodeCompletionItem.swift | 8 ++ Source/SourceKittenFramework/File.swift | 13 ++ Source/SourceKittenFramework/Language.swift | 13 ++ .../ObjCDeclarationKind.swift | 62 +++++++++ Source/SourceKittenFramework/OffsetMap.swift | 8 ++ Source/SourceKittenFramework/Request.swift | 47 +++++++ .../SourceDeclaration.swift | 6 + .../SourceLocation.swift | 8 ++ .../SourceKittenFramework/StatementKind.swift | 30 +++++ .../String+SourceKitten.swift | 55 ++++++++ .../SwiftDeclarationKind.swift | 120 ++++++++++++++++++ .../SourceKittenFramework/SwiftDocKey.swift | 108 ++++++++++++++++ Source/SourceKittenFramework/SyntaxKind.swift | 60 +++++++++ Source/SourceKittenFramework/SyntaxMap.swift | 8 ++ Source/SourceKittenFramework/Xcode.swift | 6 + 15 files changed, 552 insertions(+) diff --git a/Source/SourceKittenFramework/CodeCompletionItem.swift b/Source/SourceKittenFramework/CodeCompletionItem.swift index ea2abb91a..04c42c3c1 100644 --- a/Source/SourceKittenFramework/CodeCompletionItem.swift +++ b/Source/SourceKittenFramework/CodeCompletionItem.swift @@ -59,3 +59,11 @@ public struct CodeCompletionItem: CustomStringConvertible { } } } + +// MARK: - migration support +extension CodeCompletionItem { + @available(*, unavailable, renamed: "parse(response:)") + public static func parseResponse(_ response: [String: SourceKitRepresentable]) -> [CodeCompletionItem] { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/File.swift b/Source/SourceKittenFramework/File.swift index 79a5805ab..9bdf28fd5 100644 --- a/Source/SourceKittenFramework/File.swift +++ b/Source/SourceKittenFramework/File.swift @@ -446,3 +446,16 @@ private extension XMLIndexer { } as [SourceKitRepresentable] } } + +// MARK: - migration support +extension File { + @available(*, unavailable, renamed: "process(dictionary:cursorInfoRequest:syntaxMap:)") + public func processDictionary(_ dictionary: [String: SourceKitRepresentable], cursorInfoRequest: sourcekitd_object_t? = nil, syntaxMap: SyntaxMap? = nil) -> [String: SourceKitRepresentable] { + fatalError() + } + + @available(*, unavailable, renamed: "parseDocumentationCommentBody(_:syntaxMap:)") + public func getDocumentationCommentBody(_ dictionary: [String: SourceKitRepresentable], syntaxMap: SyntaxMap) -> String? { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/Language.swift b/Source/SourceKittenFramework/Language.swift index 69f12567a..20dae5ccd 100644 --- a/Source/SourceKittenFramework/Language.swift +++ b/Source/SourceKittenFramework/Language.swift @@ -13,3 +13,16 @@ public enum Language { /// Objective-C. case objc } + +// MARK: - migration support +extension Language { + @available(*, unavailable, renamed: "swift") + public static var Swift: Language { + fatalError() + } + + @available(*, unavailable, renamed: "objc") + public static var ObjC: Language { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/ObjCDeclarationKind.swift b/Source/SourceKittenFramework/ObjCDeclarationKind.swift index a1e6c52bb..d25a2e054 100644 --- a/Source/SourceKittenFramework/ObjCDeclarationKind.swift +++ b/Source/SourceKittenFramework/ObjCDeclarationKind.swift @@ -75,3 +75,65 @@ public enum ObjCDeclarationKind: String { } } } + +// MARK: - migration support +extension ObjCDeclarationKind { + @available(*, unavailable, renamed: "category") + public static var Category: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "class") + public static var Class: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "constant") + public static var Constant: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "enum") + public static var Enum: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "enumcase") + public static var Enumcase: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "initializer") + public static var Initializer: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "methodClass") + public static var MethodClass: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "methodInstance") + public static var MethodInstance: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "property") + public static var Property: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "protocol") + public static var `Protocol`: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "typedef") + public static var Typedef: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "function") + public static var Function: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "mark") + public static var Mark: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "struct") + public static var Struct: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "field") + public static var Field: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "ivar") + public static var Ivar: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "moduleImport") + public static var ModuleImport: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "unexposedDecl") + public static var UnexposedDecl: ObjCDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "init(_:)") + public static func fromClang(_ kind: CXCursorKind) -> ObjCDeclarationKind { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/OffsetMap.swift b/Source/SourceKittenFramework/OffsetMap.swift index 8083d7147..710b0cf88 100644 --- a/Source/SourceKittenFramework/OffsetMap.swift +++ b/Source/SourceKittenFramework/OffsetMap.swift @@ -71,3 +71,11 @@ extension File { return offsetMap } } + +// MARK: - migration support +extension File { + @available(*, unavailable, renamed: "makeOffsetMap(documentedTokenOffsets:dictionary:)") + public func generateOffsetMap(_ documentedTokenOffsets: [Int], dictionary: [String: SourceKitRepresentable]) -> OffsetMap { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/Request.swift b/Source/SourceKittenFramework/Request.swift index 2202717f2..0c68c6b66 100644 --- a/Source/SourceKittenFramework/Request.swift +++ b/Source/SourceKittenFramework/Request.swift @@ -451,3 +451,50 @@ internal func libraryWrapperForModule(_ module: String, loadPath: String, spmMod let library = "private let library = toolchainLoader.load(path: \"\(loadPath)\")\n" return spmImport + library + freeFunctions.joined(separator: "\n") + "\n" } + +// MARK: - migration support +extension Request { + @available(*, unavailable, renamed: "editorOpen(file:)") + public static func EditorOpen(_: File) -> Request { fatalError() } + + @available(*, unavailable, renamed: "cursorInfo(file:offset:arguments:)") + public static func CursorInfo(file: String, offset: Int64, arguments: [String])-> Request { fatalError() } + + @available(*, unavailable, renamed: "customRequest(request:)") + public static func CustomRequest(_: sourcekitd_object_t) -> Request { fatalError() } + + @available(*, unavailable, renamed: "codeCompletionRequest(file:contents:offset:arguments:)") + public static func CodeCompletionRequest(file: String, contents: String, offset: Int64, arguments: [String]) -> Request { fatalError() } + + @available(*, unavailable, renamed: "interface(file:uuid:)") + public static func Interface(file: String, uuid: String) -> Request { fatalError() } + + @available(*, unavailable, renamed: "findUSR(file:usr:)") + public static func FindUSR(file: String, usr: String) -> Request { fatalError() } + + @available(*, unavailable, renamed: "index(file:arguments:)") + public static func Index(file: String, arguments: [String]) -> Request { fatalError() } + + @available(*, unavailable, renamed: "format(file:line:useTabs:indentWith:)") + public static func Format(file: String, line: Int64, useTabs: Bool, indentWidth: Int64) -> Request { fatalError() } + + @available(*, unavailable, renamed: "replaceText(file:offset:length:sourceText:)") + public static func ReplaceText(file: String, offset: Int64, length: Int64, sourceText: String) -> Request { fatalError() } +} + +extension Request.Error { + @available(*, unavailable, renamed: "connectionInterrupted(_:)") + public static func ConnectionInterrupted(_: String?) -> Request.Error { fatalError() } + + @available(*, unavailable, renamed: "invalid(_:)") + public static func Invalid(_: String?) -> Request.Error { fatalError() } + + @available(*, unavailable, renamed: "failed(_:)") + public static func Failed(_: String?) -> Request.Error { fatalError() } + + @available(*, unavailable, renamed: "cancelled(_:)") + public static func Cancelled(_: String?) -> Request.Error { fatalError() } + + @available(*, unavailable, renamed: "unknown(_:)") + public static func Unknown(_: String?) -> Request.Error { fatalError() } +} diff --git a/Source/SourceKittenFramework/SourceDeclaration.swift b/Source/SourceKittenFramework/SourceDeclaration.swift index 367102372..c530d731d 100644 --- a/Source/SourceKittenFramework/SourceDeclaration.swift +++ b/Source/SourceKittenFramework/SourceDeclaration.swift @@ -140,3 +140,9 @@ extension SourceDeclaration: Comparable {} public func <(lhs: SourceDeclaration, rhs: SourceDeclaration) -> Bool { return lhs.location < rhs.location } + +// MARK: - migration support +@available(*, unavailable, renamed: "insertMarks(declarations:limit:)") +public func insertMarks(_ declarations: [SourceDeclaration], limitRange: NSRange? = nil) -> [SourceDeclaration] { + fatalError() +} diff --git a/Source/SourceKittenFramework/SourceLocation.swift b/Source/SourceKittenFramework/SourceLocation.swift index 668e6bedf..23e4ce42f 100644 --- a/Source/SourceKittenFramework/SourceLocation.swift +++ b/Source/SourceKittenFramework/SourceLocation.swift @@ -61,3 +61,11 @@ public func <(lhs: SourceLocation, rhs: SourceLocation) -> Bool { // Then offset. return lhs.offset < rhs.offset } + +// MARK: - migration support +extension SourceLocation { + @available(*, unavailable, renamed: "range(toEnd:)") + public func rangeToEndLocation(_ end: SourceLocation) -> NSRange { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/StatementKind.swift b/Source/SourceKittenFramework/StatementKind.swift index c629d2517..88277e65a 100644 --- a/Source/SourceKittenFramework/StatementKind.swift +++ b/Source/SourceKittenFramework/StatementKind.swift @@ -28,3 +28,33 @@ public enum StatementKind: String, SwiftLangSyntax { /// `while`. case `while` = "source.lang.swift.stmt.while" } + +// MARK: - migration support +extension StatementKind { + @available(*, unavailable, renamed: "brace") + public static var Brace: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "case") + public static var Case: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "for") + public static var For: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "forEach") + public static var ForEach: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "guard") + public static var Guard: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "if") + public static var If: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "repeatWhile") + public static var RepeatWhile: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "switch") + public static var Switch: StatementKind { fatalError() } + + @available(*, unavailable, renamed: "while") + public static var While: StatementKind { fatalError() } +} diff --git a/Source/SourceKittenFramework/String+SourceKitten.swift b/Source/SourceKittenFramework/String+SourceKitten.swift index 75b2dd671..4ad087aa9 100644 --- a/Source/SourceKittenFramework/String+SourceKitten.swift +++ b/Source/SourceKittenFramework/String+SourceKitten.swift @@ -566,3 +566,58 @@ extension String { return trimmingCharacters(in: unwantedSet) } } + +// MARK: - migration support +extension NSString { + @available(*, unavailable, renamed: "lineAndCharacter(forCharacterOffset:)") + public func lineAndCharacterForCharacterOffset(_ offset: Int) -> (line: Int, character: Int)? { + fatalError() + } + + @available(*, unavailable, renamed: "lineAndCharacter(forByteOffset:)") + public func lineAndCharacterForByteOffset(_ offset: Int) -> (line: Int, character: Int)? { + fatalError() + } + + @available(*, unavailable, renamed: "trimmingTrailingCharacters(in:)") + public func stringByTrimmingTrailingCharactersInSet(_ characterSet: CharacterSet) -> String { + fatalError() + } + + @available(*, unavailable, renamed: "absolutePathRepresentation(rootDirectory:)") + public func absolutePathRepresentation(_ rootDirectory: String = FileManager.default.currentDirectoryPath) -> String { + fatalError() + } + + @available(*, unavailable, renamed: "substringWithSourceRange(start:end:)") + public func substringWithSourceRange(_ start: SourceLocation, end: SourceLocation) -> String? { + fatalError() + } +} + +extension String { + @available(*, unavailable, renamed: "pragmaMarks(_:excludeRanges:limit:)") + public func pragmaMarks(_ filename: String, excludeRanges: [NSRange], limitRange: NSRange?) -> [SourceDeclaration] { + fatalError() + } + + @available(*, unavailable, renamed: "documentedTokenOffsets(syntaxMap:)") + public func documentedTokenOffsets(_ syntaxMap: SyntaxMap) -> [Int] { + fatalError() + } + + @available(*, unavailable, renamed: "commentBody(range:)") + public func commentBody(_ range: NSRange? = nil) -> String? { + fatalError() + } + + @available(*, unavailable, renamed: "removingCommonLeadingWhitespaceFromLines()") + public func stringByRemovingCommonLeadingWhitespaceFromLines() -> String { + fatalError() + } + + @available(*, unavailable, renamed: "countOfLeadingCharacters(in:)") + public func countOfLeadingCharactersInSet(_ characterSet: CharacterSet) -> Int { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/SwiftDeclarationKind.swift b/Source/SourceKittenFramework/SwiftDeclarationKind.swift index f0e2cc7ac..05b063387 100644 --- a/Source/SourceKittenFramework/SwiftDeclarationKind.swift +++ b/Source/SourceKittenFramework/SwiftDeclarationKind.swift @@ -88,3 +88,123 @@ public enum SwiftDeclarationKind: String, SwiftLangSyntax { /// `var.static`. case varStatic = "source.lang.swift.decl.var.static" } + +// MARK: - migration support +extension SwiftDeclarationKind { + @available(*, unavailable, renamed: "associatedtype") + public static var Associatedtype: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "class") + public static var Class: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "enum") + public static var Enum: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "enumcase") + public static var Enumcase: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "enumelement") + public static var Enumelement: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "extension") + public static var Extension: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "extensionClass") + public static var ExtensionClass: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "extensionEnum") + public static var ExtensionEnum: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "extensionProtocol") + public static var ExtensionProtocol: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "extensionStruct") + public static var ExtensionStruct: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionAccessorAddress") + public static var FunctionAccessorAddress: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionAccessorDidset") + public static var FunctionAccessorDidset: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionAccessorGetter") + public static var FunctionAccessorGetter: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionAccessorMutableaddress") + public static var FunctionAccessorMutableaddress: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionAccessorSetter") + public static var FunctionAccessorSetter: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionAccessorWillset") + public static var FunctionAccessorWillset: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionConstructor") + public static var FunctionConstructor: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionDestructor") + public static var FunctionDestructor: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionFree") + public static var FunctionFree: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionMethodClass") + public static var FunctionMethodClass: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionMethodInstance") + public static var FunctionMethodInstance: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionMethodStatic") + public static var FunctionMethodStatic: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionOperator") + public static var FunctionOperator: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionOperatorInfix") + public static var FunctionOperatorInfix: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionOperatorPostfix") + public static var FunctionOperatorPostfix: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionOperatorPrefix") + public static var FunctionOperatorPrefix: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "functionSubscript") + public static var FunctionSubscript: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "genericTypeParam") + public static var GenericTypeParam: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "module") + public static var Module: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "precedenceGroup") + public static var PrecedenceGroup: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "protocol") + public static var `Protocol`: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "struct") + public static var Struct: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "typealias") + public static var Typealias: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "varClass") + public static var VarClass: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "varGlobal") + public static var VarGlobal: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "varInstance") + public static var VarInstance: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "varLocal") + public static var VarLocal: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "varParameter") + public static var VarParameter: SwiftDeclarationKind { fatalError() } + + @available(*, unavailable, renamed: "varStatic") + public static var VarStatic: SwiftDeclarationKind { fatalError() } +} diff --git a/Source/SourceKittenFramework/SwiftDocKey.swift b/Source/SourceKittenFramework/SwiftDocKey.swift index b03ca2ee5..011e59c24 100644 --- a/Source/SourceKittenFramework/SwiftDocKey.swift +++ b/Source/SourceKittenFramework/SwiftDocKey.swift @@ -244,3 +244,111 @@ public enum SwiftDocKey: String { return get(.fullXMLDocs, dictionary) } } + +// MARK: - migration support +extension SwiftDocKey { + @available(*, unavailable, renamed: "annotatedDeclaration") + public static var AnnotatedDeclaration: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "bodyLength") + public static var BodyLength: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "bodyOffset") + public static var BodyOffset: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "diagnosticStage") + public static var DiagnosticStage: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "filePath") + public static var FilePath: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "fullXMLDocs") + public static var FullXMLDocs: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "kind") + public static var Kind: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "length") + public static var Length: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "name") + public static var Name: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "nameLength") + public static var NameLength: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "nameOffset") + public static var NameOffset: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "offset") + public static var Offset: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "substructure") + public static var Substructure: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "syntaxMap") + public static var SyntaxMap: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "typeName") + public static var TypeName: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "inheritedtypes") + public static var Inheritedtypes: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docColumn") + public static var DocColumn: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "documentationComment") + public static var DocumentationComment: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docDeclaration") + public static var DocDeclaration: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docDiscussion") + public static var DocDiscussion: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docFile") + public static var DocFile: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docLine") + public static var DocLine: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docName") + public static var DocName: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docParameters") + public static var DocParameters: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docResultDiscussion") + public static var DocResultDiscussion: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "docType") + public static var DocType: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "usr") + public static var USR: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "parsedDeclaration") + public static var ParsedDeclaration: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "parsedScopeEnd") + public static var ParsedScopeEnd: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "parsedScopeStart") + public static var ParsedScopeStart: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "swiftDeclaration") + public static var SwiftDeclaration: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "alwaysDeprecated") + public static var AlwaysDeprecated: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "alwaysUnavailable") + public static var AlwaysUnavailable: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "deprecationMessage") + public static var DeprecationMessage: SwiftDocKey { fatalError() } + + @available(*, unavailable, renamed: "unavailableMessage") + public static var UnavailableMessage: SwiftDocKey { fatalError() } +} diff --git a/Source/SourceKittenFramework/SyntaxKind.swift b/Source/SourceKittenFramework/SyntaxKind.swift index eb6ac6e43..ee5010a1d 100644 --- a/Source/SourceKittenFramework/SyntaxKind.swift +++ b/Source/SourceKittenFramework/SyntaxKind.swift @@ -53,3 +53,63 @@ public enum SyntaxKind: String, SwiftLangSyntax { return [.commentURL, .docComment, .docCommentField] } } + +// MARK: - migration support +extension SyntaxKind { + @available(*, unavailable, renamed: "argument") + public static var Argument: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "attributeBuiltin") + public static var AttributeBuiltin: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "attributeID") + public static var AttributeID: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "buildconfigID") + public static var BuildconfigID: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "buildconfigKeyword") + public static var BuildconfigKeyword: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "comment") + public static var Comment: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "commentMark") + public static var CommentMark: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "commentURL") + public static var CommentURL: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "docComment") + public static var DocComment: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "docCommentField") + public static var DocCommentField: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "identifier") + public static var Identifier: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "keyword") + public static var Keyword: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "number") + public static var Number: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "objectLiteral") + public static var ObjectLiteral: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "parameter") + public static var Parameter: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "placeholder") + public static var Placeholder: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "string") + public static var String: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "stringInterpolationAnchor") + public static var StringInterpolationAnchor: SyntaxKind { fatalError() } + + @available(*, unavailable, renamed: "typeidentifier") + public static var Typeidentifier: SyntaxKind { fatalError() } +} diff --git a/Source/SourceKittenFramework/SyntaxMap.swift b/Source/SourceKittenFramework/SyntaxMap.swift index 6d28ad502..ec7735592 100644 --- a/Source/SourceKittenFramework/SyntaxMap.swift +++ b/Source/SourceKittenFramework/SyntaxMap.swift @@ -118,3 +118,11 @@ public func ==(lhs: SyntaxMap, rhs: SyntaxMap) -> Bool { } return true } + +// MARK: - migration support +extension SyntaxMap { + @available(*, unavailable, renamed: "commentRange(beforeOffset:)") + public func commentRangeBeforeOffset(_ offset: Int) -> Range? { + fatalError() + } +} diff --git a/Source/SourceKittenFramework/Xcode.swift b/Source/SourceKittenFramework/Xcode.swift index 219700d53..4fac1967b 100644 --- a/Source/SourceKittenFramework/Xcode.swift +++ b/Source/SourceKittenFramework/Xcode.swift @@ -171,3 +171,9 @@ public func sdkPath() -> String { file.closeFile() return sdkPath?.replacingOccurrences(of: "\n", with: "") ?? "" } + +// MARK: - migration support +@available(*, unavailable, renamed: "parseHeaderFilesAndXcodebuildArguments(sourcekittenArguments:)") +public func parseHeaderFilesAndXcodebuildArguments(_ sourcekittenArguments: [String]) -> (headerFiles: [String], xcodebuildArguments: [String]) { + fatalError() +}