From 5ca76865d139307fce78ec5fb520ff0bf336a3d9 Mon Sep 17 00:00:00 2001 From: Sebastian Steger Date: Wed, 20 Aug 2025 14:52:41 +0200 Subject: [PATCH] devcontainer --- haskell/.devcontainer/Dockerfile | 10 ++++ haskell/.devcontainer/devcontainer.json | 12 +++++ haskell/.vscode/settings.json | 3 ++ haskell/.vscode/tasks.json | 61 +++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 haskell/.devcontainer/Dockerfile create mode 100644 haskell/.devcontainer/devcontainer.json create mode 100644 haskell/.vscode/settings.json create mode 100644 haskell/.vscode/tasks.json diff --git a/haskell/.devcontainer/Dockerfile b/haskell/.devcontainer/Dockerfile new file mode 100644 index 0000000..cfa1e8f --- /dev/null +++ b/haskell/.devcontainer/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get install -y build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh +ENV PATH="$PATH:/root/.ghcup/bin" +RUN ghcup install hls +RUN apt-get update && apt-get install -y git zlib1g-dev +RUN cabal update && cabal install ghci-dap haskell-debug-adapter +RUN cabal update && cabal install --lib HUnit + diff --git a/haskell/.devcontainer/devcontainer.json b/haskell/.devcontainer/devcontainer.json new file mode 100644 index 0000000..7703059 --- /dev/null +++ b/haskell/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "Haskell Dev Container", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { "extensions": [ + "haskell.haskell", + "phoityne.phoityne-vscode" + ]} + } +} diff --git a/haskell/.vscode/settings.json b/haskell/.vscode/settings.json new file mode 100644 index 0000000..23fd35f --- /dev/null +++ b/haskell/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/haskell/.vscode/tasks.json b/haskell/.vscode/tasks.json new file mode 100644 index 0000000..e6efc25 --- /dev/null +++ b/haskell/.vscode/tasks.json @@ -0,0 +1,61 @@ + +{ + // Automatically created by phoityne-vscode extension. + + "version": "2.0.0", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "tasks": [ + { + // F7 + "group": { + "kind": "build", + "isDefault": false + }, + "label": "haskell build", + "type": "shell", + "command": "cabal configure && cabal build" + }, + { + // F6 + "group": "build", + "type": "shell", + "label": "haskell clean & build", + "command": "cabal clean && cabal configure && cabal build" + }, + { + // F8 + "group": { + "kind": "test", + "isDefault": true + }, + "type": "shell", + "label": "haskell test", + "command": "cabal test" + }, + { + // F6 + "isBackground": true, + "type": "shell", + "label": "haskell watch", + "command": "stack build --test --no-run-tests --file-watch" + } + + , + { + // Build a single Haskell file + "type": "shell", + "label": "haskell build single file", + "command": "ghc", + "args": [ "${file}" ], + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + } + + ] +}