You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filed based on discussion on swift forums. Filed under "Swift-DocC" because there isn't a separate "SymbolKit" component.
Declarations/symbols (properties, methods, subscripts, etc.) should have their type information encoded as structural data. This helps with the goal of visualizing the connections between types and declarations.
An example: for the following declaration of bar(baz: ), we should be able to pull out both that the parameter baz takes an Optional with the generic Wrapped parameter substituted with String AND that the return type is a tuple with element .0 equal to Int and element .what equal to Array with the generic Element parameter substituted by UInt. For each type mentioned here I’d like to be able to pull out the USR/“precise identifier” of the type if there is one (i.e. not for the anonymous tuple) along with any generic parameters substituted.
Ideally I’d be able to draw out from the information above that given the result of calling bar(baz: ) I can get a UInt by accessing the Array subscript of the .what member. That requires being able to take the generic substitution map from [UInt] and apply it to a symbol like Array’s subscript. If I could then also connect that to Sequence.Element (so I can tell that iteration can also extract a UInt), that would be fantastic!
The text was updated successfully, but these errors were encountered:
The symbol graph contains type signatures (parameters and return values) for functions/methods, and as of apple/swift#70207 also for subscripts and initializers.
If you want to request more type signature information that's not already in symbol graph files today, please open new issues on the compiler for that source language (for issues on the Swift compiler please prefix the issue with "[SymbolGraphGen]")
Additional Detail from JIRA
md5: 5e91a1a29db3a0603ba5134fd34897a1
Issue Description:
Filed based on discussion on swift forums. Filed under "Swift-DocC" because there isn't a separate "SymbolKit" component.
Declarations/symbols (properties, methods, subscripts, etc.) should have their type information encoded as structural data. This helps with the goal of visualizing the connections between types and declarations.
An example: for the following declaration of
bar(baz: )
, we should be able to pull out both that the parameter baz takes an Optional with the generic Wrapped parameter substituted with String AND that the return type is a tuple with element.0
equal to Int and element.what
equal to Array with the generic Element parameter substituted by UInt. For each type mentioned here I’d like to be able to pull out the USR/“precise identifier” of the type if there is one (i.e. not for the anonymous tuple) along with any generic parameters substituted.Ideally I’d be able to draw out from the information above that given the result of calling
bar(baz: )
I can get a UInt by accessing the Array subscript of the.what
member. That requires being able to take the generic substitution map from[UInt]
and apply it to a symbol like Array’s subscript. If I could then also connect that toSequence.Element
(so I can tell that iteration can also extract a UInt), that would be fantastic!The text was updated successfully, but these errors were encountered: