hscope 0.4 → 0.4.1
raw patch · 3 files changed
+8/−23 lines, 3 filesdep ~basedep ~haskell-src-extsdep ~uniplate
Dependency ranges changed: base, haskell-src-exts, uniplate
Files
- HScope.hs +4/−3
- hscope.cabal +3/−5
- t/Build.hs +1/−15
HScope.hs view
@@ -94,7 +94,7 @@ handleDefinitions :: Lines -> Decl SrcSpanInfo -> WriteCDB IO () handleDefinitions vec = go where- go (PatBind _ (PVar _ n) _ _ _) = addDef n+ go (PatBind _ (PVar _ n) _ _) = addDef n go (FunBind _ ((Match _ n _ _ _):_)) = addDef n go _ = return () addDef = addInfo vec Definition@@ -112,9 +112,10 @@ handleConstructors vec (InfixConDecl _ _ n _) = addInfo vec Definition n handleDeclarations :: Lines -> DeclHead SrcSpanInfo -> WriteCDB IO ()-handleDeclarations vec (DHead _ n _) = addInfo vec Definition n-handleDeclarations vec (DHInfix _ _ n _) = addInfo vec Definition n+handleDeclarations vec (DHead _ n) = addInfo vec Definition n+handleDeclarations vec (DHInfix _ _ n) = addInfo vec Definition n handleDeclarations vec (DHParen _ declHead) = handleDeclarations vec declHead+handleDeclarations vec (DHApp _ declHead _) = handleDeclarations vec declHead mapLines :: FilePath -> [a] -> [String] -> [a] mapLines f to = reverse . snd . foldl' go ((to, True), []) where
hscope.cabal view
@@ -1,5 +1,5 @@ Name: hscope-Version: 0.4+Version: 0.4.1 License: BSD3 License-File: COPYING Category: source-tools@@ -41,10 +41,8 @@ Executable hscope Main-Is: HScope.hs GHC-Options: -Wall- -- uniplate >= 1.6.11 to avoid 10x performance regression- -- uniplate 1.6.6 is what Ubuntu 12.04 has in its packages. To be removed eventually...- Build-Depends: base (< 5), pure-cdb, haskell-src-exts, mtl- , uniplate >= 1.6.11 || == 1.6.6, cereal+ Build-Depends: base == 4.7.*, haskell-src-exts == 1.16.*, mtl, pure-cdb+ , uniplate >= 1.6.12 && < 1.7, cereal , vector, bytestring, process, deepseq, directory, cpphs Default-Language: Haskell2010
t/Build.hs view
@@ -23,25 +23,11 @@ main :: IO () main = withTemporaryDirectory "/tmp/hscope_test_XXXXXX" $ \td -> testSimpleMain $ do- plan 48+ plan 43 hpath <- liftIO $ canonicalizePath "./dist/build/hscope/hscope" tfile <- liftIO $ canonicalizePath "./t/files/Simple.hs" ec1 <- liftIO $ system $ "cd " ++ td ++ " && " ++ hpath ++ " -b " ++ tfile- res1 <- liftIO $ readProcess "cdb" [ "-l", td ++ "/hscope.out" ] "" is ec1 ExitSuccess- like res1 "main"-- res2 <- liftIO $ readProcess "cdb" [ "-q", td ++ "/hscope.out", "main" ] ""- like res2 "main = "-- res3 <- liftIO $ readProcess "cdb" [ "-q", td ++ "/hscope.out", "findInfo" ] ""- like res3 "-> findInfo "-- res4 <- liftIO $ readProcess "cdb" [ "-q", td ++ "/hscope.out", "options" ] ""- like res4 "Permute options"-- res5 <- liftIO $ readProcess "cdb" [ "-q", td ++ "/hscope.out", "runLines" ] ""- like res5 ">>= runLines" (ec2, l1) <- liftIO $ hscopeInteract hpath td [ "1main", "1findInfo" ] is ec2 ExitSuccess