mirror of
https://github.com/github/semantic.git
synced 2024-12-28 09:21:35 +03:00
🔥 Data.Name.
This commit is contained in:
parent
14c68c407d
commit
7dacb55e35
@ -21,11 +21,11 @@ module Language.Python.ScopeGraph
|
||||
( scopeGraphModule
|
||||
) where
|
||||
|
||||
import Analysis.Name
|
||||
import Control.Algebra (Algebra (..), handleCoercible)
|
||||
import Control.Effect.Sketch
|
||||
import Data.Foldable
|
||||
import Data.Monoid
|
||||
import Data.Name
|
||||
import GHC.Generics
|
||||
import GHC.Records
|
||||
import GHC.TypeLits
|
||||
|
@ -6,11 +6,11 @@
|
||||
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
|
||||
module Main (main) where
|
||||
|
||||
import Analysis.Name (Name)
|
||||
import Control.Algebra
|
||||
import Control.Carrier.Sketch.Fresh
|
||||
import Control.Monad
|
||||
import qualified Data.ByteString as ByteString
|
||||
import Data.Name (Name)
|
||||
import qualified Data.ScopeGraph as ScopeGraph
|
||||
import qualified Language.Python ()
|
||||
import qualified Language.Python as Py (Term)
|
||||
|
@ -25,7 +25,6 @@ library
|
||||
ScopeGraph.Convert
|
||||
Data.Hole
|
||||
Data.Module
|
||||
Data.Name
|
||||
Data.ScopeGraph
|
||||
build-depends:
|
||||
base >= 4.13 && < 5
|
||||
|
@ -18,6 +18,8 @@ module Control.Carrier.Sketch.Fresh
|
||||
, module Control.Effect.Sketch
|
||||
) where
|
||||
|
||||
import Analysis.Name (Name)
|
||||
import qualified Analysis.Name
|
||||
import Control.Algebra
|
||||
import Control.Carrier.Fresh.Strict
|
||||
import Control.Carrier.State.Strict
|
||||
@ -25,8 +27,6 @@ import Control.Effect.Sketch
|
||||
import Control.Monad.IO.Class
|
||||
import Data.Bifunctor
|
||||
import Data.Module
|
||||
import Data.Name (Name)
|
||||
import qualified Data.Name
|
||||
import Data.ScopeGraph (ScopeGraph)
|
||||
import qualified Data.ScopeGraph as ScopeGraph
|
||||
import Data.Semilattice.Lower
|
||||
@ -43,7 +43,7 @@ instance Lower (Sketchbook Name) where
|
||||
let
|
||||
initialGraph = ScopeGraph.insertScope n initialScope lowerBound
|
||||
initialScope = ScopeGraph.Scope mempty mempty mempty
|
||||
n = Data.Name.nameI 0
|
||||
n = Analysis.Name.nameI 0
|
||||
in
|
||||
Sketchbook initialGraph n
|
||||
|
||||
@ -55,7 +55,7 @@ instance (Effect sig, Algebra sig m) => Algebra (Sketch Name :+: sig) (SketchC N
|
||||
Sketchbook old current <- SketchC (get @(Sketchbook Name))
|
||||
let (new, _pos) =
|
||||
ScopeGraph.declare
|
||||
(ScopeGraph.Declaration (Data.Name.name n))
|
||||
(ScopeGraph.Declaration (Analysis.Name.name n))
|
||||
(lowerBound @ModuleInfo)
|
||||
ScopeGraph.Default
|
||||
ScopeGraph.Public
|
||||
@ -70,11 +70,11 @@ instance (Effect sig, Algebra sig m) => Algebra (Sketch Name :+: sig) (SketchC N
|
||||
Sketchbook old current <- SketchC (get @(Sketchbook Name))
|
||||
let new =
|
||||
ScopeGraph.reference
|
||||
(ScopeGraph.Reference (Data.Name.name n))
|
||||
(ScopeGraph.Reference (Analysis.Name.name n))
|
||||
(lowerBound @ModuleInfo)
|
||||
(lowerBound @Span)
|
||||
ScopeGraph.Identifier
|
||||
(ScopeGraph.Declaration (Data.Name.name decl))
|
||||
(ScopeGraph.Declaration (Analysis.Name.name decl))
|
||||
current
|
||||
old
|
||||
SketchC (put @(Sketchbook Name) (Sketchbook new current))
|
||||
|
@ -1,5 +0,0 @@
|
||||
module Data.Name
|
||||
( module Analysis.Name
|
||||
) where
|
||||
|
||||
import Analysis.Name
|
@ -48,6 +48,7 @@ module Data.ScopeGraph
|
||||
|
||||
import Prelude hiding (lookup)
|
||||
|
||||
import Analysis.Name
|
||||
import Control.Applicative
|
||||
import Control.Lens.Lens
|
||||
import Control.Monad
|
||||
@ -61,7 +62,6 @@ import qualified Data.Map.Strict as Map
|
||||
import Data.Maybe
|
||||
import Data.Module
|
||||
import Data.Monoid
|
||||
import Data.Name
|
||||
import Data.Semilattice.Lower
|
||||
import Data.Sequence (Seq)
|
||||
import qualified Data.Sequence as Seq
|
||||
|
@ -13,9 +13,9 @@ module ScopeGraph.Convert
|
||||
, complete
|
||||
) where
|
||||
|
||||
import Analysis.Name (Name)
|
||||
import Control.Effect.Sketch
|
||||
import Data.List.NonEmpty
|
||||
import Data.Name (Name)
|
||||
import Data.Typeable
|
||||
import Source.Loc
|
||||
|
||||
|
@ -285,6 +285,7 @@ library
|
||||
, proto-lens-jsonpb
|
||||
, proto-lens-runtime >= 0.5 && <0.7
|
||||
, reducers ^>= 3.12.3
|
||||
, semantic-analysis ^>= 0
|
||||
, semantic-go ^>= 0
|
||||
, semantic-java ^>= 0
|
||||
, semantic-json ^>= 0
|
||||
|
@ -2,4 +2,4 @@ module Data.Abstract.Name
|
||||
( module X
|
||||
) where
|
||||
|
||||
import Data.Name as X
|
||||
import Analysis.Name as X
|
||||
|
Loading…
Reference in New Issue
Block a user