1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00

Remove extra reference call in tests

This commit is contained in:
joshvera 2020-02-11 12:56:47 -05:00
parent 13ebd4650b
commit 284912ad21
2 changed files with 2 additions and 3 deletions

View File

@ -89,8 +89,7 @@ assertSimpleReference = do
expectedReference :: ScopeGraphEff sig m => m Result
expectedReference = do
declare "x" (Props.Declaration ScopeGraph.Assignment ScopeGraph.Default Nothing (Span (Pos 0 0) (Pos 0 5)))
let refProperties = Props.Reference ScopeGraph.Assignment ScopeGraph.Default (Span (Pos 0 0) (Pos 0 1))
reference "x" "x" refProperties
let refProperties = Props.Reference ScopeGraph.Identifier ScopeGraph.Default (Span (Pos 1 0) (Pos 1 1))
newReference "x" refProperties
pure Complete

View File

@ -150,7 +150,7 @@ newReference name props = do
in
(ScopeGraph.insertScope currentAddress scope' scopeGraph)
scopeGraph <- get @(ScopeGraph.ScopeGraph Name)
case ((AdjacencyList.findPath (const Nothing) (ScopeGraph.Declaration name) currentAddress scopeGraph) :: Maybe (Scope.Path Name)) of
case AdjacencyList.findPath (const Nothing) (ScopeGraph.Declaration name) currentAddress scopeGraph of
Just path -> modify (\scopeGraph -> insertRef' path scopeGraph)
Nothing -> undefined
-- maybe