From 01da6135bd795edcf08c1462ce9925e9917df956 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Fri, 20 Dec 2019 02:05:48 +0000 Subject: [PATCH] Squashed commit of the following: commit 2ba261a93d4d1aebb3f749d65e7ad038fe1fb8ce Author: Luke Lau Date: Fri Dec 20 02:04:40 2019 +0000 Remove extraneous flag commit 358ddf1c3f5138c2ddf5f40d6ab543ab6ea75f27 Author: Luke Lau Date: Fri Dec 20 01:50:46 2019 +0000 Do some tidying up commit 4f1628681efec92fdb69dc2faf09c3c73e1d6d83 Author: Luke Lau Date: Fri Dec 20 00:57:46 2019 +0000 Replace rename test while HaRe is gone commit 60b309d19338bc584dae5388b2fa7486779fdaa6 Author: Luke Lau Date: Fri Dec 20 00:01:42 2019 +0000 Update hie commit 14966566f56badb30e257defe62463e484a2892a Merge: a61a867 6c549ae Author: Luke Lau Date: Fri Dec 20 00:01:01 2019 +0000 Merge branch 'master' into github-actions commit a61a867b278edc025489298b360340e7ddec05e7 Author: Luke Lau Date: Tue Nov 26 15:45:25 2019 +0000 Update hie version commit ef87eb25780e65706b1ec9437a0c1084b4940b9a Author: Luke Lau Date: Mon Nov 25 21:59:41 2019 +0000 Skip caching commit 803c622b2a390a310584d9f8170c9ec1c8ea67db Merge: d46bb3d 95ef237 Author: Luke Lau Date: Mon Nov 25 17:24:41 2019 +0000 Merge branch 'master' into github-actions commit d46bb3df79fd71344d0c8d7c6de5b67c99f65906 Author: Luke Lau Date: Wed Nov 13 15:33:41 2019 +0000 Add restore keys commit d88f852bc000c0d743f50c9328bf7f94c68a917a Author: Luke Lau Date: Wed Nov 13 15:27:26 2019 +0000 Cache ~/.cabal commit 51a500ceafa6d32b39e8c79bbb885fd1f0d559a4 Author: Luke Lau Date: Wed Nov 13 14:05:47 2019 +0000 Turn back on tests commit 4ecafadfae6e2f85bd92fd26ef5a79171a8114c9 Author: Luke Lau Date: Wed Nov 13 13:14:29 2019 +0000 Skip tests commit f1fca115d4447601b5547c75762fbb0bab0ebcff Author: Luke Lau Date: Wed Nov 13 13:14:03 2019 +0000 Add hie.yaml file commit ff565d6a883324c593d394ca43483ed5304ff7bb Author: Luke Lau Date: Tue Nov 12 23:11:32 2019 +0000 Use hie-bios commit 282975ed02c212a8a70b002adceefe9be17828ab Author: Luke Lau Date: Tue Nov 12 22:14:21 2019 +0000 Turn back on tests commit 9466153bd3fec0fb4f3a6a70659fbc2ded68ff07 Author: Luke Lau Date: Tue Nov 12 22:13:12 2019 +0000 Fix cache path commit d0957b1bb20206a72daf042b62d8d31acb58f6ec Author: Luke Lau Date: Tue Nov 12 22:10:11 2019 +0000 Install Cabal library commit 005f2a5b9a388355fac1978a0c191ace407703dc Author: Luke Lau Date: Wed Nov 6 01:21:53 2019 +0000 Try tests commit 1fece5cbea8a496f0ffd9bcdc66799a789d9bc6d Author: Luke Lau Date: Wed Nov 6 01:12:43 2019 +0000 Update readme badge commit 4d7d4a7889723fcac14b034b4af5bc007a78505f Author: Luke Lau Date: Wed Nov 6 01:00:42 2019 +0000 Cache dist-newstyle commit 81f355b80c168555f5af9a40bd3722e27e1b20a6 Author: Luke Lau Date: Tue Nov 5 23:28:14 2019 +0000 Skip tests so it passes and caches hie commit 5d347a640ed7f3967e0a48c8e039d263e585c90c Author: Luke Lau Date: Tue Nov 5 23:12:42 2019 +0000 Fix typo commit c153a088c325d7ca9ec2d385f1616216dba8231b Author: Luke Lau Date: Tue Nov 5 23:10:35 2019 +0000 Move into the right dir commit 322f51e3ab0bf60b1a791a7128c8954bb8c1dd08 Author: Luke Lau Date: Tue Nov 5 23:05:15 2019 +0000 Try and figure out where its being checked out to commit 344a84171b685571ea8a8b2c01e577db9bf2b225 Author: Luke Lau Date: Tue Nov 5 23:00:26 2019 +0000 Try moving hie checkout path commit d1933f6079eef0a92255f0d291c08b63ce258998 Author: Luke Lau Date: Tue Nov 5 22:56:55 2019 +0000 Don't use wrong condition for hie test commit d55147cdd6b333a1fa5125a4868842266cdbb1d8 Author: Luke Lau Date: Tue Nov 5 22:56:02 2019 +0000 Only cache cabal binaries commit badc948ab7affaa15f5c6a6a6e8af07a74e56dea Author: Luke Lau Date: Tue Nov 5 22:54:28 2019 +0000 Try caching hie commit a3cd5371e2fe29acd8b9653d0eacebf3087d9715 Author: Luke Lau Date: Tue Nov 5 22:33:04 2019 +0000 Start debugging these failing tests commit ebfabfaac2438f69625b72d9867a21bec489181d Author: Luke Lau Date: Sun Nov 3 21:11:54 2019 +0000 Go back to using hie master commit a262b90b6df2b3aff0fd23019390f83f16d7a75f Author: Luke Lau Date: Sat Oct 19 01:54:41 2019 +0100 Add npm bin directory to PATH commit 3d9f14e3d376b069169a13ffba59211e4838134e Author: Luke Lau Date: Sat Oct 19 00:49:44 2019 +0100 Use hie-bios commit ba2031ed9c5237c40dc6de1376bf74ec134f78bf Merge: 38bf0b7 c80fbbc Author: Luke Lau Date: Sat Oct 19 00:49:15 2019 +0100 Merge branch 'master' into github-actions commit 38bf0b76556e21891319a2e2af92efe8ff4bf5b7 Author: Luke Lau Date: Sun Oct 6 00:42:27 2019 +0100 Install JS language server commit 0980bdc3a13cc183ef4de6a00820d386c498d7f7 Author: Luke Lau Date: Sat Oct 5 21:29:08 2019 +0100 Tidy up workflow commit 83f521b928a6c952dba54061dde684869ca5c669 Author: Luke Lau Date: Wed Oct 2 19:50:10 2019 +0100 Update haskell.yml commit 588e085d12244b795441c0e17b71a561ac5db80b Author: Luke Lau Date: Wed Oct 2 15:09:13 2019 +0100 Debug PATH commit 89407b82feba0a4c025d118eb6bf03b3fa6bef39 Author: Luke Lau Date: Wed Oct 2 14:00:38 2019 +0100 Add cabal bin to PATH commit 0de9d38dfe3a9b0f9c029e9da72054261702e3f1 Author: Luke Lau Date: Wed Oct 2 12:12:17 2019 +0100 Update haskell.yml commit 9fa751f3d517dd071d9af47ae42988c6acd7334f Author: Luke Lau Date: Wed Oct 2 12:09:13 2019 +0100 Update haskell.yml commit d6bfa2476eae9b86896bdcf9116965feccb2ca7a Merge: 550d88c c066f37 Author: Luke Lau Date: Wed Oct 2 12:08:03 2019 +0100 Merge branch 'github-actions' of https://github.com/bubba/lsp-test into github-actions commit 550d88ca15b7909e2988d400f0fd0882304c1d1f Author: Luke Lau Date: Sat Aug 24 18:19:04 2019 -0400 Add secret commit 1d9d650e6391f03527db6bae6b0e8d6ac9c2231c Author: Luke Lau Date: Sat Aug 24 18:15:15 2019 -0400 Add hlinter commit 860ba10766f52281e31fe1a778e290b30ac37676 Author: Luke Lau Date: Sat Aug 24 18:11:27 2019 -0400 Try upgrading ghc and cabal commit c066f37e7955511a5f02acefb2d8c7360397d3df Author: Luke Lau Date: Sat Aug 24 18:19:04 2019 -0400 Add secret commit 80aeabcf9c63706c07c33f0933c2622aac7fc376 Author: Luke Lau Date: Sat Aug 24 18:15:15 2019 -0400 Add hlinter commit 2d99d48db3865ad7f5916fea82ad4ce8b6a695f4 Author: Luke Lau Date: Sat Aug 24 18:11:27 2019 -0400 Try upgrading ghc and cabal --- .github/workflows/haskell.yml | 49 ++++++++++++++++++++++++++++------- README.md | 2 +- test/Test.hs | 17 ++++++++---- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index e4cdf76..53827ca 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -1,32 +1,61 @@ name: Haskell CI on: [push] - jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + + env: + hieref: cd0d1eb88334c359b8a220f2aebec703d66012ff + + strategy: + matrix: + ghc: ['8.6.5'] + os: [ubuntu-latest, macOS-latest] steps: - uses: actions/checkout@v1 - - uses: actions/setup-haskell@v1 + - uses: bubba/setup-haskell@macos-ghcup with: - ghc-version: '8.6.5' + ghc-version: ${{ matrix.ghc }} cabal-version: '3.0' - run: cabal update - - name: Install HIE + + - name: Clone HIE + uses: actions/checkout@v1 + with: + repository: mpickering/haskell-ide-engine + submodules: recursive + ref: ${{ env.hieref }} + path: haskell-ide-engine + + # - name: Cache Cabal + # uses: actions/cache@v1 + # with: + # path: ~/.cabal + # key: ${{ runner.OS }}-${{ matrix.ghc }}-cabal-${{ hashFiles('../**/*.cabal') }} + # restore-keys: | + # ${{ runner.OS }}-${{ matrix.ghc }}-cabal + + - name: Build HIE run: | - pushd $HOME - git clone https://github.com/haskell/haskell-ide-engine --recurse-submodules - cd haskell-ide-engine + # if [ -e $HOME/.cabal/bin/hie ]; then + # echo "hie is already built" + # exit 0 + # fi + pushd ../haskell-ide-engine cabal install hie cabal install hoogle - export PATH=$PATH:$HOME/.cabal/bin hoogle generate popd + - name: Install JS Language Server + run: npm install -g javascript-typescript-langserver - name: Build run: cabal build - name: Test run: | - export PATH=$PATH:$HOME/.cabal/bin + echo $PATH + echo $(npm bin) + export PATH=$PATH:$(npm bin) cabal test diff --git a/README.md b/README.md index ce452fe..9f0251b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lsp-test [![Build Status](https://travis-ci.com/bubba/lsp-test.svg?branch=master)](https://travis-ci.com/bubba/lsp-test) [![Hackage](https://img.shields.io/hackage/v/lsp-test.svg)](https://hackage.haskell.org/package/lsp-test-0.1.0.0) +# lsp-test [![Actions Status](https://github.com/bubba/lsp-test/workflows/Haskell%20CI/badge.svg)](https://github.com/bubba/lsp-test/actions) [![Hackage](https://img.shields.io/hackage/v/lsp-test.svg)](https://hackage.haskell.org/package/lsp-test-0.1.0.0) lsp-test is a functional testing framework for Language Server Protocol servers. ```haskell diff --git a/test/Test.hs b/test/Test.hs index dc770d9..eb0eef0 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -281,11 +281,18 @@ main = hspec $ do diag ^. severity `shouldBe` Just DsError diag ^. source `shouldBe` Just "bios" - describe "rename" $ - it "works" $ runSession "hie" fullCaps "test/data" $ do - doc <- openDoc "Rename.hs" "haskell" - rename doc (Position 1 0) "bar" - documentContents doc >>= liftIO . shouldBe "main = bar\nbar = return 42\n" + describe "rename" $ do + it "works" $ pendingWith "HaRe not in hie-bios yet" + it "works on javascript" $ + runSession "javascript-typescript-stdio" fullCaps "test/data/javascriptPass" $ do + doc <- openDoc "test.js" "javascript" + rename doc (Position 2 11) "bar" + documentContents doc >>= liftIO . (`shouldContain` "function bar()") . T.unpack + + -- runSession "hie" fullCaps "test/data" $ do + -- doc <- openDoc "Rename.hs" "haskell" + -- rename doc (Position 1 0) "bar" + -- documentContents doc >>= liftIO . shouldBe "main = bar\nbar = return 42\n" describe "getHover" $ it "works" $ runSession "hie" fullCaps "test/data/renamePass" $ do -- 2.30.2