1
1
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
2
2
tasks :
3
3
- before : |
4
+ # Only the /workspace folder is persistent
5
+ export XDG_DATA_HOME=/workspace/.local/share
6
+ export XDG_CONFIG_HOME=/workspace/.local/config
7
+ export XDG_STATE_HOME=/workspace/.local/state
8
+ export XDG_CACHE_HOME=/workspace/.cache
9
+ export CABAL_DIR=/workspace/.cabal
10
+ export STACK_ROOT=/workspace/.stack
11
+
12
+ # install ghcup, ghc and cabal
4
13
export GHCUP_INSTALL_BASE_PREFIX=/workspace
5
14
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
6
15
export BOOTSTRAP_HASKELL_MINIMAL=1
7
- export CABAL_DIR=/workspace/.cabal
8
- export STACK_ROOT=/workspace/.stack
9
16
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
10
-
11
- # ensure that there is an HLS binary for the installed GHC version
12
- /workspace/.ghcup/bin/ghcup install ghc 8.10.5 --set
17
+ /workspace/.ghcup/bin/ghcup install ghc --set
13
18
/workspace/.ghcup/bin/ghcup install cabal
14
19
15
20
# Add ghcup binaries to the PATH since VSCode does not see 'source .ghcup/env'
@@ -21,8 +26,15 @@ tasks:
21
26
cabal update
22
27
mkdir ~/.cabal
23
28
cp /workspace/.cabal/config ~/.cabal/config
29
+
30
+ # Configure VSCode to use the locally built version of HLS
31
+ mkdir -p .vscode
32
+ echo '{ "haskell.serverExecutablePath": "/workspace/.cabal/bin/haskell-language-server" }' > settings.json
33
+
24
34
init: |
25
- cabal build --enable-tests
35
+ cabal configure --enable-executable-dynamic
36
+ cabal build --enable-tests
37
+ cabal install exe:haskell-language-server
26
38
command: |
27
39
cabal build --enable-tests
28
40
0 commit comments