mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Refine import spec imports
This commit is contained in:
parent
1687c63d64
commit
68ec7adef3
@ -1,23 +1,9 @@
|
||||
module Rendering.Imports.Spec (spec) where
|
||||
|
||||
import Analysis.Declaration (HasDeclaration, declarationAlgebra)
|
||||
import Analysis.ModuleDef (HasModuleDef, moduleDefAlgebra)
|
||||
import Data.Output
|
||||
import Parsing.Parser
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.ByteString.Char8 as BC
|
||||
import qualified Data.Map as Map
|
||||
import qualified Semantic.Util as Util
|
||||
import Analysis.Declaration (declarationAlgebra)
|
||||
import Analysis.ModuleDef (moduleDefAlgebra)
|
||||
import Rendering.Imports
|
||||
import Rendering.Renderer
|
||||
import Rendering.TOC.Spec hiding (spec)
|
||||
import Semantic
|
||||
import Semantic.Task
|
||||
import SpecHelpers
|
||||
import Test.Hspec (Spec, describe, it, xit, parallel, pendingWith)
|
||||
import Test.Hspec.Expectations.Pretty
|
||||
import Test.Hspec.LeanCheck
|
||||
import Test.LeanCheck
|
||||
|
||||
|
||||
spec :: Spec
|
||||
@ -46,5 +32,5 @@ spec = parallel $ do
|
||||
where
|
||||
toVerbatimOutput = verbatim . toOutput
|
||||
parseToImports parser path = do
|
||||
blob <- Util.file path
|
||||
blob <- file path
|
||||
runTask (parse parser blob >>= decorate (declarationAlgebra blob) >>= decorate (moduleDefAlgebra blob) >>= render (renderToImports blob))
|
||||
|
@ -9,10 +9,10 @@ module SpecHelpers (
|
||||
, readFileVerbatim
|
||||
, ) where
|
||||
|
||||
import Analysis.Abstract.Evaluating
|
||||
import Control.Exception
|
||||
import Control.Monad ((<=<))
|
||||
import Control.Monad.IO.Class
|
||||
-- import Analysis.Abstract.Evaluating
|
||||
-- import Control.Exception
|
||||
-- import Control.Monad ((<=<))
|
||||
-- import Control.Monad.IO.Class
|
||||
import Data.Abstract.Address as X
|
||||
import Data.Abstract.Environment as X
|
||||
import Data.Abstract.Evaluatable as X
|
||||
@ -22,21 +22,20 @@ import Data.Abstract.Store as X
|
||||
-- import Data.Abstract.Value as Value
|
||||
import Data.Blob
|
||||
import Data.Functor.Both
|
||||
import Data.Functor.Foldable
|
||||
import Data.Language
|
||||
import Data.Map as Map
|
||||
import Data.Maybe (fromMaybe, fromJust)
|
||||
import Data.Semigroup
|
||||
import Data.Source
|
||||
import Data.Text.Encoding (decodeUtf8)
|
||||
-- import Data.Functor.Foldable
|
||||
-- import Data.Language
|
||||
-- import Data.Map as Map
|
||||
import Data.Maybe as X
|
||||
-- import Data.Semigroup
|
||||
-- import Data.Source
|
||||
-- import Data.Text.Encoding (decodeUtf8)
|
||||
-- import Data.Union
|
||||
import Data.Output as X
|
||||
import Parsing.Parser as X
|
||||
import qualified Data.ByteString as B
|
||||
-- import qualified Data.Text as T
|
||||
import qualified Semantic.IO as IO
|
||||
import Rendering.Renderer
|
||||
import Semantic
|
||||
import Semantic.Task
|
||||
import Rendering.Renderer as X
|
||||
import Semantic as X
|
||||
import Semantic.Task as X
|
||||
import Semantic.Util as X
|
||||
-- import System.FilePath
|
||||
import Data.Monoid as X (Monoid(..), First(..), Last(..))
|
||||
@ -44,6 +43,11 @@ import Data.Semigroup as X (Semigroup(..))
|
||||
|
||||
import Test.Hspec as X (Spec, describe, it, xit, parallel, pendingWith)
|
||||
import Test.Hspec.Expectations.Pretty as X
|
||||
import Test.Hspec.LeanCheck
|
||||
import Test.LeanCheck
|
||||
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Semantic.IO as IO
|
||||
|
||||
-- | Returns an s-expression formatted diff for the specified FilePath pair.
|
||||
diffFilePaths :: Both FilePath -> IO B.ByteString
|
||||
|
Loading…
Reference in New Issue
Block a user