Skip to content

Commit e29aac9

Browse files
committed
fix XDG dirs and use locally built HLS binary
1 parent 5390421 commit e29aac9

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.gitpod.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
22
tasks:
33
- 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
413
export GHCUP_INSTALL_BASE_PREFIX=/workspace
514
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
615
export BOOTSTRAP_HASKELL_MINIMAL=1
7-
export CABAL_DIR=/workspace/.cabal
8-
export STACK_ROOT=/workspace/.stack
916
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
1318
/workspace/.ghcup/bin/ghcup install cabal
1419
1520
# Add ghcup binaries to the PATH since VSCode does not see 'source .ghcup/env'
@@ -21,8 +26,15 @@ tasks:
2126
cabal update
2227
mkdir ~/.cabal
2328
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+
2434
init: |
25-
cabal build --enable-tests
35+
cabal configure --enable-executable-dynamic
36+
cabal build --enable-tests
37+
cabal install exe:haskell-language-server
2638
command: |
2739
cabal build --enable-tests
2840

0 commit comments

Comments
 (0)