mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
rename to newEdge
This commit is contained in:
parent
6ea34352e4
commit
639fac1a74
@ -236,11 +236,11 @@ instance ToScopeGraph Py.ImportStatement where scopeGraph = todo
|
|||||||
instance ToScopeGraph Py.ImportFromStatement where
|
instance ToScopeGraph Py.ImportFromStatement where
|
||||||
scopeGraph (Py.ImportFromStatement _ [] (L1 (Py.DottedName _ names)) (Just (Py.WildcardImport _ _))) = do
|
scopeGraph (Py.ImportFromStatement _ [] (L1 (Py.DottedName _ names)) (Just (Py.WildcardImport _ _))) = do
|
||||||
let toName (Py.Identifier _ name) = Name.name name
|
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
|
scopeGraph (Py.ImportFromStatement _ [] (L1 (Py.DottedName _ names)) Nothing) = do
|
||||||
let toName (Py.Identifier _ name) = Name.name name
|
let toName (Py.Identifier _ name) = Name.name name
|
||||||
names' = toName <$> names
|
names' = toName <$> names
|
||||||
insertEdge ScopeGraph.Import names'
|
newEdge ScopeGraph.Import names'
|
||||||
|
|
||||||
for_ names $ \(Py.Identifier ann name) -> do
|
for_ names $ \(Py.Identifier ann name) -> do
|
||||||
let referenceProps = Props.Reference ScopeGraph.Identifier ScopeGraph.Default (ann^.span_ :: Span)
|
let referenceProps = Props.Reference ScopeGraph.Identifier ScopeGraph.Default (ann^.span_ :: Span)
|
||||||
|
@ -117,7 +117,7 @@ expectedFunctionArg = do
|
|||||||
|
|
||||||
expectedImportHole :: (Has ScopeGraph sig m) => m Result
|
expectedImportHole :: (Has ScopeGraph sig m) => m Result
|
||||||
expectedImportHole = do
|
expectedImportHole = do
|
||||||
insertEdge ScopeGraph.Import (NonEmpty.fromList ["cheese", "ints"])
|
newEdge ScopeGraph.Import (NonEmpty.fromList ["cheese", "ints"])
|
||||||
pure Complete
|
pure Complete
|
||||||
|
|
||||||
assertLexicalScope :: HUnit.Assertion
|
assertLexicalScope :: HUnit.Assertion
|
||||||
|
Loading…
Reference in New Issue
Block a user