From: Luke Lau Date: Wed, 1 Aug 2018 13:29:30 +0000 (+0100) Subject: Move example to separate cabal file X-Git-Tag: 0.1.0.0~5 X-Git-Url: http://git.lukelau.me/?p=lsp-test.git;a=commitdiff_plain;h=fdef0cfe8916eb2e97ca0b5ae1c85e783b1c9172 Move example to separate cabal file Prevents example being installed with cabal install --- diff --git a/.gitignore b/.gitignore index e6ad272..21a6195 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,10 @@ cabal.project.local* **/.DS_Store *.swp +example/dist +example/dist-newstyle +example/cabal.project.local +example/.ghc.environment.* + # used for rerunning failed hspec tests .hspec-failures diff --git a/README.md b/README.md index 6fa8ce6..3151bbf 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ count 4 (message :: Session ApplyWorkspaceEditRequest) anyRequest <|> anyResponse ``` +Try out the example tests in the `example` directory with `cabal new-test`. For more examples check the [Wiki](https://github.com/Bubba/haskell-lsp-test/wiki/Introduction) ## Developing diff --git a/example/Main.hs b/example/Test.hs similarity index 82% rename from example/Main.hs rename to example/Test.hs index 1e2e3ba..0f5cdb4 100644 --- a/example/Main.hs +++ b/example/Test.hs @@ -3,8 +3,8 @@ import Control.Monad.IO.Class import Language.Haskell.LSP.Test import Language.Haskell.LSP.Types -main = runSession "hie --lsp" fullCaps "test/data/renamePass" $ do - docItem <- openDoc "Desktop/simple.hs" "haskell" +main = runSession "hie --lsp" fullCaps "../test/data/" $ do + docItem <- openDoc "Rename.hs" "haskell" -- Use your favourite favourite combinators. skipManyTill loggingNotification (count 2 publishDiagnosticsNotification) diff --git a/example/cabal.project b/example/cabal.project new file mode 100644 index 0000000..2aea019 --- /dev/null +++ b/example/cabal.project @@ -0,0 +1,2 @@ +packages: . + ../ diff --git a/example/example.cabal b/example/example.cabal new file mode 100644 index 0000000..d6c88c4 --- /dev/null +++ b/example/example.cabal @@ -0,0 +1,11 @@ +name: example +version: 0.0.0.0 +cabal-version: >= 1.22 +build-type: Simple + +test-suite tests + type: exitcode-stdio-1.0 + main-is: Test.hs + build-depends: base + , lsp-test + , parser-combinators diff --git a/lsp-test.cabal b/lsp-test.cabal index c293534..4a23da9 100644 --- a/lsp-test.cabal +++ b/lsp-test.cabal @@ -91,9 +91,3 @@ test-suite tests , text default-language: Haskell2010 -executable lsp-test-example - hs-source-dirs: example - main-is: Main.hs - default-language: Haskell2010 - build-depends: base >= 4.7 && < 5 - , lsp-test