mirror of
https://github.com/github/semantic.git
synced 2024-12-30 02:14:20 +03:00
Prefer import edges over parent edges
This commit is contained in:
parent
0cdbd1e51d
commit
c61c592ef6
@ -95,7 +95,7 @@ reference ref declaration g@ScopeGraph{..} = fromMaybe g $ do
|
|||||||
scopes <- Map.lookup edge linkMap
|
scopes <- Map.lookup edge linkMap
|
||||||
-- Return the first path to the declaration through the scopes.
|
-- Return the first path to the declaration through the scopes.
|
||||||
getFirst (foldMap (First . ap (go currentAddress currentScope) ((path .) . EPath edge)) 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 :: 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 }
|
create address edges g@ScopeGraph{..} = g { graph = Map.insert address newScope graph, currentScope = Just address }
|
||||||
|
Loading…
Reference in New Issue
Block a user