Fix default Haskell VSCode extension settings in GitHub Codespace (#146)

This commit is contained in:
Yvan Sraka 2024-04-11 09:09:27 +02:00 committed by GitHub
parent b915e67dbf
commit fec21531a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,12 +29,15 @@ source $(grep -m 1 -e '-env.sh$' store-paths.txt)
EOF
# This enforce those settings in DevContainer whatever "Settings Sync" user preferences ...
RUN bash -ic 'source $HOME/.bashrc && mkdir -p $HOME/.vscode-server/data/Machine/ && \
echo -e "{\n\
\"haskell.manageHLS\": \"PATH\",\n\
\"haskell.serverEnvironment\": { \"PATH\": \"$PATH\" },\n\
\"haskell.serverExecutablePath\": \"$(which haskell-language-server)\"\n\
}" > $HOME/.vscode-server/data/Machine/settings.json'
# ... VSCode DevContainer and GitHub Codespace does not look for the same settings file ><'
RUN mkdir -p $HOME/.vscode-server/data/Machine/ \
&& mkdir -p $HOME/.vscode-remote/data/Machine/ \
&& bash -ic 'echo -e "{\n \
\"haskell.manageHLS\": \"PATH\",\n \
\"haskell.serverEnvironment\": { \"PATH\": \"$PATH\" },\n \
\"haskell.serverExecutablePath\": \"$(which haskell-language-server)\"\n \
}" > $HOME/.vscode-server/data/Machine/settings.json' \
&& cp $HOME/.vscode-server/data/Machine/settings.json $HOME/.vscode-remote/data/Machine/settings.json
# FIXME: Consider moving this script into a Nix `writeShellApplication` trivial builder within the closure ...
# ... but that means I should figure it out how to pass to it $COMPILER_NIX_NAME as input?