Skip to content

Commit a43933a

Browse files
authored
Merge pull request #438 from tittoassini/master
Extended Eval Plugin
2 parents 0f07efc + 2584a4d commit a43933a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3329
-861
lines changed

.circleci/config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ defaults: &defaults
3636

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

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

66+
- run:
67+
name: Setup stack eval hie.html
68+
command: cp test/testdata/eval/hie-stack.yaml test/testdata/eval/hie.yaml
69+
70+
- run:
71+
name: Setup stack eval stack.html
72+
command: grep '^resolver:\|^compiler:' stack-build.txt > test/testdata/eval/stack.yaml
73+
6674
- run:
6775
name: Test haskell-language-server func-test suite
6876
# Tasty by default will run all the tests in parallel. Which should

.github/workflows/test.yml

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,76 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
ghc: ['8.10.2', '8.10.1', '8.8.4', '8.8.3', '8.8.2', '8.6.5', '8.6.4']
10+
ghc: ["8.10.2", "8.10.1", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
1111
os: [ubuntu-latest, macOS-latest, windows-latest]
1212
exclude:
1313
- os: windows-latest
14-
ghc: '8.10.2' # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
14+
ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
1515
- os: windows-latest
16-
ghc: '8.8.4' # also fails due to segfault :(
16+
ghc: "8.8.4" # also fails due to segfault :(
1717
- os: windows-latest
18-
ghc: '8.8.3' # fails due to segfault
18+
ghc: "8.8.3" # fails due to segfault
1919
- os: windows-latest
20-
ghc: '8.8.2' # fails due to error with Cabal
20+
ghc: "8.8.2" # fails due to error with Cabal
2121
include:
2222
- os: windows-latest
23-
ghc: '8.10.2.2' # only available for windows and choco
23+
ghc: "8.10.2.2" # only available for windows and choco
2424

2525
steps:
26-
- uses: actions/checkout@v2
27-
with:
28-
submodules: true
29-
- uses: actions/setup-haskell@v1
30-
with:
31-
ghc-version: ${{ matrix.ghc }}
32-
cabal-version: '3.2'
33-
enable-stack: true
26+
- uses: actions/checkout@v2
27+
with:
28+
submodules: true
29+
- uses: actions/setup-haskell@v1
30+
with:
31+
ghc-version: ${{ matrix.ghc }}
32+
cabal-version: "3.2"
33+
enable-stack: true
3434

35-
- name: Cache Cabal
36-
uses: actions/cache@v2
37-
env:
38-
cache-name: cache-cabal
39-
with:
40-
path: ~/.cabal/
41-
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
42-
restore-keys: |
43-
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
44-
${{ runner.os }}-${{ matrix.ghc }}-build-
45-
${{ runner.os }}-${{ matrix.ghc }}
35+
- name: Cache Cabal
36+
uses: actions/cache@v2
37+
env:
38+
cache-name: cache-cabal
39+
with:
40+
path: ~/.cabal/
41+
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
42+
restore-keys: |
43+
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
44+
${{ runner.os }}-${{ matrix.ghc }}-build-
45+
${{ runner.os }}-${{ matrix.ghc }}
4646
47-
- run: cabal update
47+
- run: cabal update
4848

49-
# Need this to work around filepath length limits in Windows
50-
- name: Shorten binary names
51-
shell: bash
52-
run: |
53-
sed -i.bak -e 's/haskell-language-server/hls/g' \
54-
-e 's/haskell_language_server/hls/g' \
55-
haskell-language-server.cabal
56-
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
57-
src/**/*.hs exe/*.hs
49+
# Need this to work around filepath length limits in Windows
50+
- name: Shorten binary names
51+
shell: bash
52+
run: |
53+
sed -i.bak -e 's/haskell-language-server/hls/g' \
54+
-e 's/haskell_language_server/hls/g' \
55+
haskell-language-server.cabal
56+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
57+
src/**/*.hs exe/*.hs
5858
59-
- name: Build
60-
shell: bash
61-
# Retry it three times to workaround compiler segfaults in windows
62-
run: cabal build || cabal build || cabal build
59+
- name: Build
60+
shell: bash
61+
# Retry it three times to workaround compiler segfaults in windows
62+
run: cabal build || cabal build || cabal build
6363

64-
- name: Test func-test suite
65-
shell: bash
66-
env:
67-
HLS_TEST_EXE: hls
68-
HLS_WRAPPER_TEST_EXE: hls-wrapper
69-
# run the tests without parallelism, otherwise tasty will attempt to run
70-
# all functional test cases simultaneously which causes way too many hls
71-
# instances to be spun up for the poor github actions runner to handle
72-
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"
64+
- name: Test func-test suite
65+
shell: bash
66+
env:
67+
HLS_TEST_EXE: hls
68+
HLS_WRAPPER_TEST_EXE: hls-wrapper
69+
# run the tests without parallelism, otherwise tasty will attempt to run
70+
# all functional test cases simultaneously which causes way too many hls
71+
# instances to be spun up for the poor github actions runner to handle
72+
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"
7373

74-
- name: Test wrapper-test suite
75-
shell: bash
76-
env:
77-
HLS_TEST_EXE: hls
78-
HLS_WRAPPER_TEST_EXE: hls-wrapper
79-
# run the tests without parallelism, otherwise tasty will attempt to run
80-
# all functional test cases simultaneously which causes way too many hls
81-
# instances to be spun up for the poor github actions runner to handle
82-
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"
74+
- name: Test wrapper-test suite
75+
shell: bash
76+
env:
77+
HLS_TEST_EXE: hls
78+
HLS_WRAPPER_TEST_EXE: hls-wrapper
79+
# run the tests without parallelism, otherwise tasty will attempt to run
80+
# all functional test cases simultaneously which causes way too many hls
81+
# instances to be spun up for the poor github actions runner to handle
82+
run: cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1" || cabal test wrapper-test --test-options="-j1"

exe/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import Ide.Arguments (Arguments (..), LspArguments (..),
88
getArguments)
99
import Ide.Main (defaultMain)
1010
import Plugins
11-
11+
import Main.Utf8 (withUtf8)
1212

1313
main :: IO ()
14-
main = do
14+
main = withUtf8 $ do
1515
args <- getArguments "haskell-language-server"
1616

1717
let withExamples =

haskell-language-server.cabal

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,16 @@ common example-plugins
157157
common eval
158158
if flag(eval) || flag(all-plugins)
159159
hs-source-dirs: plugins/default/src
160-
other-modules: Ide.Plugin.Eval
160+
other-modules: Ide.Plugin.Eval
161+
Ide.Plugin.Eval.Code
162+
Ide.Plugin.Eval.CodeLens
163+
Ide.Plugin.Eval.GHC
164+
Ide.Plugin.Eval.Parse.Option
165+
Ide.Plugin.Eval.Parse.Parser
166+
Ide.Plugin.Eval.Parse.Section
167+
Ide.Plugin.Eval.Parse.Token
168+
Ide.Plugin.Eval.Types
169+
Ide.Plugin.Eval.Util
161170
build-depends:
162171
cpp-options: -Deval
163172

@@ -289,6 +298,12 @@ executable haskell-language-server
289298
, time
290299
, transformers
291300
, unordered-containers
301+
, parser-combinators
302+
, pretty-simple
303+
, Diff
304+
, QuickCheck
305+
, ghc-paths
306+
, with-utf8
292307

293308
include-dirs: include
294309
default-language: Haskell2010
@@ -425,3 +440,7 @@ test-suite wrapper-test
425440
hs-source-dirs: test/wrapper
426441
main-is: Main.hs
427442
ghc-options: -Wall
443+
444+
445+
446+

0 commit comments

Comments
 (0)