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
Update symbol Id parsing to allow filters and use that to search for references
Summary:
# Doc
https://docs.google.com/document/d/1zlJlGSmDhQxuJ87K1bH59wPJk2IyY5WMQFTEgKA4Ak0/edit?tab=t.0#heading=h.qn82j2uc6gbw
# Stack
- Currently for directory branches like xlformers-branches when finding references, the references for all branches are returned. This is because the **symbol id is the same across branches**.
- In order to fix this in a more general way (that can apply to other directory based branches) we are implementing nhawkes design of adding filters to symbol ID's which can then be used to decide which references to return.
- With this set, glass will now only issue a new query, where the go-to-definition for the symbol's match. This means that the go-to-defintion for the symbol you searched for must point to the same file to that the references searched for point to.
- When codehub issues a request, we append this filter since the go-to-defintion information is available at load time.
# This diff
- Add a thrift `union` type which describes the filters we will allow on SymbolId.
- Update parsing logic for symbolId to return a list of SymbolFilters.
- Update `findReferenceRanges` in glass to extract the definition file from the symbol filters if it exists. If this exists issue a new query.
- Add a new query which adds constraints onto the EntityReferences predicate such that the filename of the reference's xref must match the filename of the original entities xref. (Both the go-to-definition's must match).
Reviewed By: pepeiborra
Differential Revision: D78165656
fbshipit-source-id: ea1a3697b4e887dc060211224ac58f4fe4eed8d9
0 commit comments