Skip to content

Extended Eval Plugin #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ defaults: &defaults

- run:
name: Build (we need the exe for tests)
# need j1, else ghc-lib-parser triggers OOM
command: stack -j 1 --stack-yaml=${STACK_FILE} install
# need j1, else ghc-lib-parser triggers OOM
no_output_timeout: 30m

- run:
Expand All @@ -63,6 +63,14 @@ defaults: &defaults
command: echo "ghcide tests disabled until they got fixed, see https://github.com/mpickering/ghcide/issues/25"
no_output_timeout: 120m

- run:
name: Setup stack eval hie.html
command: cp test/testdata/eval/hie-stack.yaml test/testdata/eval/hie.yaml

- run:
name: Setup stack eval stack.html
command: grep '^resolver:\|^compiler:' stack-build.txt > test/testdata/eval/stack.yaml

- run:
name: Test haskell-language-server func-test suite
# Tasty by default will run all the tests in parallel. Which should
Expand Down
114 changes: 57 additions & 57 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,76 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10.2', '8.10.1', '8.8.4', '8.8.3', '8.8.2', '8.6.5', '8.6.4']
ghc: ["8.10.2", "8.10.1", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
os: [ubuntu-latest, macOS-latest, windows-latest]
exclude:
- os: windows-latest
ghc: '8.10.2' # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
- os: windows-latest
ghc: '8.8.4' # also fails due to segfault :(
ghc: "8.8.4" # also fails due to segfault :(
- os: windows-latest
ghc: '8.8.3' # fails due to segfault
ghc: "8.8.3" # fails due to segfault
- os: windows-latest
ghc: '8.8.2' # fails due to error with Cabal
ghc: "8.8.2" # fails due to error with Cabal
include:
- os: windows-latest
ghc: '8.10.2.2' # only available for windows and choco
ghc: "8.10.2.2" # only available for windows and choco

steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
enable-stack: true
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "3.2"
enable-stack: true

- name: Cache Cabal
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: ~/.cabal/
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.ghc }}-build-
${{ runner.os }}-${{ matrix.ghc }}
- name: Cache Cabal
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: ~/.cabal/
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.ghc }}-build-
${{ runner.os }}-${{ matrix.ghc }}

- run: cabal update
- run: cabal update

# Need this to work around filepath length limits in Windows
- name: Shorten binary names
shell: bash
run: |
sed -i.bak -e 's/haskell-language-server/hls/g' \
-e 's/haskell_language_server/hls/g' \
haskell-language-server.cabal
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
src/**/*.hs exe/*.hs
# Need this to work around filepath length limits in Windows
- name: Shorten binary names
shell: bash
run: |
sed -i.bak -e 's/haskell-language-server/hls/g' \
-e 's/haskell_language_server/hls/g' \
haskell-language-server.cabal
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
src/**/*.hs exe/*.hs

- name: Build
shell: bash
# Retry it three times to workaround compiler segfaults in windows
run: cabal build || cabal build || cabal build
- name: Build
shell: bash
# Retry it three times to workaround compiler segfaults in windows
run: cabal build || cabal build || cabal build

- name: Test func-test suite
shell: bash
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
# run the tests without parallelism, otherwise tasty will attempt to run
# all functional test cases simultaneously which causes way too many hls
# instances to be spun up for the poor github actions runner to handle
run: cabal test func-test --test-options="-j1 --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"
- name: Test func-test suite
shell: bash
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
# run the tests without parallelism, otherwise tasty will attempt to run
# all functional test cases simultaneously which causes way too many hls
# instances to be spun up for the poor github actions runner to handle
run: cabal test func-test --test-options="-j1 --rerun-update" || cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"

- name: Test wrapper-test suite
shell: bash
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
# run the tests without parallelism, otherwise tasty will attempt to run
# all functional test cases simultaneously which causes way too many hls
# instances to be spun up for the poor github actions runner to handle
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"
- name: Test wrapper-test suite
shell: bash
env:
HLS_TEST_EXE: hls
HLS_WRAPPER_TEST_EXE: hls-wrapper
# run the tests without parallelism, otherwise tasty will attempt to run
# all functional test cases simultaneously which causes way too many hls
# instances to be spun up for the poor github actions runner to handle
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"
4 changes: 2 additions & 2 deletions exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import Ide.Arguments (Arguments (..), LspArguments (..),
getArguments)
import Ide.Main (defaultMain)
import Plugins

import Main.Utf8 (withUtf8)

main :: IO ()
main = do
main = withUtf8 $ do
args <- getArguments "haskell-language-server"

let withExamples =
Expand Down
21 changes: 20 additions & 1 deletion haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,16 @@ common example-plugins
common eval
if flag(eval) || flag(all-plugins)
hs-source-dirs: plugins/default/src
other-modules: Ide.Plugin.Eval
other-modules: Ide.Plugin.Eval
Ide.Plugin.Eval.Code
Ide.Plugin.Eval.CodeLens
Ide.Plugin.Eval.GHC
Ide.Plugin.Eval.Parse.Option
Ide.Plugin.Eval.Parse.Parser
Ide.Plugin.Eval.Parse.Section
Ide.Plugin.Eval.Parse.Token
Ide.Plugin.Eval.Types
Ide.Plugin.Eval.Util
build-depends:
cpp-options: -Deval

Expand Down Expand Up @@ -289,6 +298,12 @@ executable haskell-language-server
, time
, transformers
, unordered-containers
, parser-combinators
, pretty-simple
, Diff
, QuickCheck
, ghc-paths
, with-utf8

include-dirs: include
default-language: Haskell2010
Expand Down Expand Up @@ -425,3 +440,7 @@ test-suite wrapper-test
hs-source-dirs: test/wrapper
main-is: Main.hs
ghc-options: -Wall




Loading