1
1
mirror of https://github.com/github/semantic.git synced 2024-11-30 14:47:30 +03:00

rename to newEdge

This commit is contained in:
joshvera 2020-02-07 22:21:23 -05:00
parent 6ea34352e4
commit 639fac1a74
2 changed files with 3 additions and 3 deletions

View File

@ -236,11 +236,11 @@ instance ToScopeGraph Py.ImportStatement where scopeGraph = todo
instance ToScopeGraph Py.ImportFromStatement where
scopeGraph (Py.ImportFromStatement _ [] (L1 (Py.DottedName _ names)) (Just (Py.WildcardImport _ _))) = do
let toName (Py.Identifier _ name) = Name.name name
complete <* insertEdge ScopeGraph.Import (toName <$> names)
complete <* newEdge ScopeGraph.Import (toName <$> names)
scopeGraph (Py.ImportFromStatement _ [] (L1 (Py.DottedName _ names)) Nothing) = do
let toName (Py.Identifier _ name) = Name.name name
names' = toName <$> names
insertEdge ScopeGraph.Import names'
newEdge ScopeGraph.Import names'
for_ names $ \(Py.Identifier ann name) -> do
let referenceProps = Props.Reference ScopeGraph.Identifier ScopeGraph.Default (ann^.span_ :: Span)

View File

@ -117,7 +117,7 @@ expectedFunctionArg = do
expectedImportHole :: (Has ScopeGraph sig m) => m Result
expectedImportHole = do
insertEdge ScopeGraph.Import (NonEmpty.fromList ["cheese", "ints"])
newEdge ScopeGraph.Import (NonEmpty.fromList ["cheese", "ints"])
pure Complete
assertLexicalScope :: HUnit.Assertion