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
Summary:
This diff implements cross-language navigation in glass from swift to objc. Note that schema changes have been split out in previous diff.
The way this works is roughly:
* do a glean query to get all the "dangling" references from the swift file. By "dangling", we mean references to things that don't have a definition in the DB. By "reference", we really mean a USR, which is a unique symbol identifier use in the swift/objc/cxx compiler toolchains.
* then use those collected USR to query the cxx DB for definitions.
* Caveat: from the Swift DB, we get plain USR, but in the cxx DB, we only have USR hashes. So we need to hash the USRs before querying the cxx DB. This diff ensures that the hashing function is the same between the cxx indexer and glass, by FFI-ing into the cxx hashing function. There is a bit of refactor done to that purpose.
This way of doing xlang references, although very simple since there are common symbol identifiers across the two DBs, is unfortunately not well adapted to how glass / codemarkup does xlang references for other languages, so we had to adapt the codemarkup schema a bit, see GenericEntity in codemarkup.angle, which uses a new code.SymbolId type.
Suggested review order:
* angle code:
* codemarkup.angle, code.angle, code.scip.angle, code.cxx.angle
* "dangling" references on swift side: scip.angle, codemarkup.scip.angle
* USR resolution on cxx side: codemarkup.cxx.angle, codemarkup.angle
* haskell code:
* Document.hs
* Xrefs.hs
* other stuff
Reviewed By: phlalx
Differential Revision: D74811891
fbshipit-source-id: 5956c0364ce2dcbe5eb654e3010e56856db15943
0 commit comments