Initializer
init(_:interfaceLanguages:defaultSymbol:shouldAddHash:shouldAddKind:)
Creates a new reference to a symbol.
init(_ identifier: String, interfaceLanguages: Set<SourceLanguage>, defaultSymbol symbol: SymbolGraph.Symbol? = nil, shouldAddHash: Bool = false, shouldAddKind: Bool = false)
Parameters
identifierThe precise identifier of a symbol.
interfaceLanguagesThe source languages of the symbol.
symbolThe default symbol graph node representing this symbol, if available.
shouldAddHashIf true, the new reference has a hash appended to its path.
shouldAddKindIf true, the new reference has the referenced-symbol kind appended to its path.
Discussion
The two symbols MyFramework/Manager, a class, and MyFramework/manager, a static variable, have the same topic reference paths. For such symbols, set shouldAddKind to true to add the symbol kind to the reference path and generate the unique paths /myframework/manager-swift.class and /myframework/manager-swift.variable.
Another case might be two symbols of the same kind with colliding paths, for example, the variable MyFramework/vaRiable and MyFramework/VARiable. Set shouldAddHash to true to append a hash of the symbol name at the end of the path to make the two paths distinct.