From 4ee17e2188c1d4e45ea9908ce772508aea860881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 22 May 2025 14:27:00 +0000 Subject: [PATCH] dev environment --- .devcontainer/devcontainer.json | 26 ++++++++++++++++++-------- .vscode/settings.json | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1284f54..b12406e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,8 +2,23 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/rust { "name": "Rust", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/rust:1-bookworm", + "image": "debian:bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + // "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "configureZshAsDefaultShell": "true" + }, + "ghcr.io/devcontainers/features/rust:1": { + // "targets": "thumbv7m-none-eabi" + }, + "ghcr.io/devcontainers-contrib/features/apt-get-packages:1": { + "packages": "git-flow" + } + }, // cargo cache persistence "mounts": [ @@ -14,11 +29,6 @@ } ], - // Features to add to the dev container. More info: https://containers.dev/features. - "features": { - "ghcr.io/devcontainers/features/git-lfs:1": {} - }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], @@ -35,8 +45,8 @@ "mhutchie.git-graph" ] } - } + }, // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" + "remoteUser": "vscode" } diff --git a/.vscode/settings.json b/.vscode/settings.json index 309c306..57afccf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,19 @@ "**/.cargo/registry/src/**/*.rs": true, "**/.cargo/git/checkouts/**/*.rs": true, "**/lib/rustlib/src/rust/library/**/*.rs": true, - } + }, + "git.closeDiffOnOperation": true, + "[rust]": { + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, + }, + // // override the default setting (`cargo check --all-targets`) which produces the following error + // // "can't find crate for `test`" when the default compilation target is a no_std target + // "rust-analyzer.checkOnSave.allTargets": false, + // // with these changes RA will call `cargo check --bins` on save + // "rust-analyzer.checkOnSave.extraArgs": [ + // "--bins" + // ], } \ No newline at end of file