mirror of
https://github.com/Avi-D-coder/implicit-hie.git
synced 2024-11-22 17:55:51 +03:00
Remove autogen-modules from other-modules + Update tests
This commit is contained in:
parent
4513e5033b
commit
3350d7c90f
3
hie.yaml
3
hie.yaml
@ -6,8 +6,5 @@ cradle:
|
|||||||
- path: "app/Main.hs"
|
- path: "app/Main.hs"
|
||||||
component: "implicit-hie:exe:gen-hie"
|
component: "implicit-hie:exe:gen-hie"
|
||||||
|
|
||||||
- path: "app/Paths_implicit_hie.hs"
|
|
||||||
component: "implicit-hie:exe:gen-hie"
|
|
||||||
|
|
||||||
- path: "test"
|
- path: "test"
|
||||||
component: "implicit-hie:test:implicit-hie-test"
|
component: "implicit-hie:test:implicit-hie-test"
|
||||||
|
@ -76,7 +76,7 @@ parseBench = parseSecMain (Comp Bench) "benchmark"
|
|||||||
parseSecMain :: (Name -> Path -> Component) -> Text -> Indent -> Parser [Component]
|
parseSecMain :: (Name -> Path -> Component) -> Text -> Indent -> Parser [Component]
|
||||||
parseSecMain c s i = do
|
parseSecMain c s i = do
|
||||||
n <- componentHeader i s
|
n <- componentHeader i s
|
||||||
p <- pathMain (i + 1) ["./"] "" []
|
p <- pathMain (i + 1) ["./"] "" [] []
|
||||||
pure $ map (c n) p
|
pure $ map (c n) p
|
||||||
|
|
||||||
parseQuoted :: Parser Text
|
parseQuoted :: Parser Text
|
||||||
@ -106,17 +106,24 @@ parseList i = items <|> (emptyOrComLine >> indent i >> items)
|
|||||||
<|> pure []
|
<|> pure []
|
||||||
pure $ h : t
|
pure $ h : t
|
||||||
|
|
||||||
pathMain :: Indent -> [Text] -> Text -> [Text] -> Parser [Text]
|
pathMain :: Indent -> [Text] -> Text -> [Text] -> [Text] -> Parser [Text]
|
||||||
pathMain i p m o =
|
pathMain i p m o a =
|
||||||
(hsSourceDir i >>= (\p' -> pathMain i p' m o))
|
(hsSourceDir i >>= (\p' -> pathMain i p' m o a))
|
||||||
<|> (field i "main-is" (const parseString) >>= flip (pathMain i p) o)
|
<|> (field i "main-is" (const parseString) >>= (\m' -> pathMain i p m' o a))
|
||||||
<|> (field i "other-modules" parseList >>= pathMain i p m)
|
<|> (field i "other-modules" parseList >>= flip (pathMain i p m) a)
|
||||||
<|> (skipBlockLine i >> pathMain i p m o)
|
<|> (field i "autogen-modules" parseList >>= pathMain i p m o)
|
||||||
<|> pure (map (<//> m) p <> [p' <//> (o' <> ".hs") | p' <- p, o' <- o])
|
<|> (skipBlockLine i >> pathMain i p m o a)
|
||||||
|
<|> pure
|
||||||
|
( map (<//> m) p
|
||||||
|
<> [ p' <//> (o' <> ".hs")
|
||||||
|
| p' <- p,
|
||||||
|
o' <- filter (`notElem` a) o
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
(<//>) :: Text -> Text -> Text
|
(<//>) :: Text -> Text -> Text
|
||||||
a <//> b = T.pack (T.unpack a </> T.unpack b)
|
a <//> b = T.pack (T.unpack a </> T.unpack b)
|
||||||
|
|
||||||
infixr 5 <//>
|
infixr 5 <//>
|
||||||
|
|
||||||
parseSec :: Indent -> Text -> (Name -> Path -> Component) -> Parser [Component]
|
parseSec :: Indent -> Text -> (Name -> Path -> Component) -> Parser [Component]
|
||||||
|
11
test/Spec.hs
11
test/Spec.hs
@ -17,9 +17,7 @@ spec = do
|
|||||||
describe "Should Succeed"
|
describe "Should Succeed"
|
||||||
$ it "successfully parses executable section"
|
$ it "successfully parses executable section"
|
||||||
$ exeSection ~> parseExe 0
|
$ exeSection ~> parseExe 0
|
||||||
`shouldParse` [ Comp Exe "implicit-hie-exe" "app/Main.hs",
|
`shouldParse` [Comp Exe "gen-hie" "app/Main.hs"]
|
||||||
Comp Exe "implicit-hie-exe" "app/Paths_implicit_hie.hs"
|
|
||||||
]
|
|
||||||
describe "Should Succeed"
|
describe "Should Succeed"
|
||||||
$ it "successfully parses test section"
|
$ it "successfully parses test section"
|
||||||
$ testSection ~> parseTestSuite 0
|
$ testSection ~> parseTestSuite 0
|
||||||
@ -50,8 +48,7 @@ spec = do
|
|||||||
`shouldParse` Package
|
`shouldParse` Package
|
||||||
"implicit-hie"
|
"implicit-hie"
|
||||||
[ Comp Lib "" "src",
|
[ Comp Lib "" "src",
|
||||||
Comp Exe "implicit-hie-exe" "app/Main.hs",
|
Comp Exe "gen-hie" "app/Main.hs",
|
||||||
Comp Exe "implicit-hie-exe" "app/Paths_implicit_hie.hs",
|
|
||||||
Comp Test "implicit-hie-test" "test"
|
Comp Test "implicit-hie-test" "test"
|
||||||
]
|
]
|
||||||
describe "Should Succeed"
|
describe "Should Succeed"
|
||||||
@ -92,9 +89,11 @@ spec = do
|
|||||||
|
|
||||||
exeSection :: Text
|
exeSection :: Text
|
||||||
exeSection =
|
exeSection =
|
||||||
"executable implicit-hie-exe\n\
|
"executable gen-hie\n\
|
||||||
\ other-modules:\n\
|
\ other-modules:\n\
|
||||||
\ Paths_implicit_hie\n\
|
\ Paths_implicit_hie\n\
|
||||||
|
\ autogen-modules:\n\
|
||||||
|
\ Paths_implicit_hie\n\
|
||||||
\ hs-source-dirs:\n\
|
\ hs-source-dirs:\n\
|
||||||
\ app\n\
|
\ app\n\
|
||||||
\ ghc-options: -O2\n\
|
\ ghc-options: -O2\n\
|
||||||
|
@ -1,28 +1,22 @@
|
|||||||
cradle:
|
cradle:
|
||||||
cabal:
|
cabal:
|
||||||
- path: "src"
|
- path: "./src"
|
||||||
component: "lib:haskell-language-server"
|
component: "lib:haskell-language-server"
|
||||||
|
|
||||||
- path: "exe/Main.hs"
|
- path: "./exe/Main.hs"
|
||||||
component: "haskell-language-server:exe:haskell-language-server"
|
component: "haskell-language-server:exe:haskell-language-server"
|
||||||
|
|
||||||
- path: "exe/Arguments.hs"
|
- path: "./exe/Arguments.hs"
|
||||||
component: "haskell-language-server:exe:haskell-language-server"
|
component: "haskell-language-server:exe:haskell-language-server"
|
||||||
|
|
||||||
- path: "exe/Paths_haskell_language_server.hs"
|
- path: "./exe/Wrapper.hs"
|
||||||
component: "haskell-language-server:exe:haskell-language-server"
|
|
||||||
|
|
||||||
- path: "exe/Wrapper.hs"
|
|
||||||
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
||||||
|
|
||||||
- path: "exe/Arguments.hs"
|
- path: "./exe/Arguments.hs"
|
||||||
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
||||||
|
|
||||||
- path: "exe/Paths_haskell_language_server.hs"
|
- path: "./test/functional"
|
||||||
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
|
||||||
|
|
||||||
- path: "test/functional"
|
|
||||||
component: "haskell-language-server:test:func-test"
|
component: "haskell-language-server:test:func-test"
|
||||||
|
|
||||||
- path: "test/utils"
|
- path: "./test/utils"
|
||||||
component: "haskell-language-server:lib:hls-test-utils"
|
component: "haskell-language-server:lib:hls-test-utils"
|
||||||
|
@ -6,8 +6,5 @@ cradle:
|
|||||||
- path: "./app/Main.hs"
|
- path: "./app/Main.hs"
|
||||||
component: "implicit-hie:exe:gen-hie"
|
component: "implicit-hie:exe:gen-hie"
|
||||||
|
|
||||||
- path: "./app/Paths_implicit_hie.hs"
|
|
||||||
component: "implicit-hie:exe:gen-hie"
|
|
||||||
|
|
||||||
- path: "./test"
|
- path: "./test"
|
||||||
component: "implicit-hie:test:implicit-hie-test"
|
component: "implicit-hie:test:implicit-hie-test"
|
||||||
|
Loading…
Reference in New Issue
Block a user