1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Prefer import edges over parent edges

This commit is contained in:
joshvera 2018-09-13 18:27:19 -04:00
parent 0cdbd1e51d
commit c61c592ef6

View File

@ -95,7 +95,7 @@ reference ref declaration g@ScopeGraph{..} = fromMaybe g $ do
scopes <- Map.lookup edge linkMap
-- Return the first path to the declaration through the scopes.
getFirst (foldMap (First . ap (go currentAddress currentScope) ((path .) . EPath edge)) scopes)
in traverseEdges P <|> traverseEdges I
in traverseEdges I <|> traverseEdges P
create :: Ord address => address -> Map EdgeLabel [address] -> ScopeGraph address -> ScopeGraph address
create address edges g@ScopeGraph{..} = g { graph = Map.insert address newScope graph, currentScope = Just address }