Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change KindIdentifier into a struct to handle unknown symbol kinds #7

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
tweak definitions of static KindIdentifiers
QuietMisdreavus committed Apr 8, 2022
commit 378980d717c4300662c5625a43dda27e0f37f316
42 changes: 21 additions & 21 deletions Sources/SymbolKit/SymbolGraph/Symbol/KindIdentifier.swift
Original file line number Diff line number Diff line change
@@ -21,27 +21,27 @@ extension SymbolGraph.Symbol {
self.identifier = rawIdentifier
}

public static let `associatedtype` : Self = .init(rawIdentifier: "associatedtype")
public static let `class` : Self = .init(rawIdentifier: "class")
public static let `deinit` : Self = .init(rawIdentifier: "deinit")
public static let `enum` : Self = .init(rawIdentifier: "enum")
public static let `case` : Self = .init(rawIdentifier: "enum.case")
public static let `func` : Self = .init(rawIdentifier: "func")
public static let `operator` : Self = .init(rawIdentifier: "func.op")
public static let `init` : Self = .init(rawIdentifier: "init")
public static let `method` : Self = .init(rawIdentifier: "method")
public static let `property` : Self = .init(rawIdentifier: "property")
public static let `protocol` : Self = .init(rawIdentifier: "protocol")
public static let snippet : Self = .init(rawIdentifier: "snippet")
public static let snippetGroup : Self = .init(rawIdentifier: "snippetGroup")
public static let `struct` : Self = .init(rawIdentifier: "struct")
public static let `subscript` : Self = .init(rawIdentifier: "subscript")
public static let typeMethod : Self = .init(rawIdentifier: "type.method")
public static let typeProperty : Self = .init(rawIdentifier: "type.property")
public static let typeSubscript : Self = .init(rawIdentifier: "type.subscript")
public static let `typealias` : Self = .init(rawIdentifier: "typealias")
public static let `var` : Self = .init(rawIdentifier: "var")
public static let module : Self = .init(rawIdentifier: "module")
public static let `associatedtype` = KindIdentifier(rawIdentifier: "associatedtype")
public static let `class` = KindIdentifier(rawIdentifier: "class")
public static let `deinit` = KindIdentifier(rawIdentifier: "deinit")
public static let `enum` = KindIdentifier(rawIdentifier: "enum")
public static let `case` = KindIdentifier(rawIdentifier: "enum.case")
public static let `func` = KindIdentifier(rawIdentifier: "func")
public static let `operator` = KindIdentifier(rawIdentifier: "func.op")
public static let `init` = KindIdentifier(rawIdentifier: "init")
public static let `method` = KindIdentifier(rawIdentifier: "method")
public static let `property` = KindIdentifier(rawIdentifier: "property")
public static let `protocol` = KindIdentifier(rawIdentifier: "protocol")
public static let snippet = KindIdentifier(rawIdentifier: "snippet")
public static let snippetGroup = KindIdentifier(rawIdentifier: "snippetGroup")
public static let `struct` = KindIdentifier(rawIdentifier: "struct")
public static let `subscript` = KindIdentifier(rawIdentifier: "subscript")
public static let typeMethod = KindIdentifier(rawIdentifier: "type.method")
public static let typeProperty = KindIdentifier(rawIdentifier: "type.property")
public static let typeSubscript = KindIdentifier(rawIdentifier: "type.subscript")
public static let `typealias` = KindIdentifier(rawIdentifier: "typealias")
public static let `var` = KindIdentifier(rawIdentifier: "var")
public static let module = KindIdentifier(rawIdentifier: "module")

public static let allCases: [KindIdentifier] = [
.`associatedtype`,