chore: Add VS Code devcontainer

This commit is contained in:
nedia 2021-10-29 14:37:49 +00:00 committed by Michael Aaron Murphy
parent be7438fe64
commit ac4ff8b735
2 changed files with 49 additions and 0 deletions

15
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,15 @@
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT}
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive
RUN apt-get install libgtk-3-dev libssl-dev -y
# generate completions
RUN su vscode -c 'mkdir ~/.zfunc'
RUN su vscode -c 'rustup completions zsh > ~/.zfunc/_rustup'
RUN su vscode -c 'rustup completions zsh cargo > ~/.zfunc/_cargo'
# load completions via .zshrc
RUN su vscode -c 'echo fpath+=~/.zfunc >> ~/.zshrc'
RUN su vscode -c 'echo autoload -U compinit >> ~/.zshrc'
RUN su vscode -c 'echo compinit -i >> ~/.zshrc'

View file

@ -0,0 +1,34 @@
{
"name": "rust",
"runArgs": [
"--init",
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--userns=keep-id"
],
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "buster"
}
},
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"files.watcherExclude": {
"**/target/**": true
},
"lldb.executable": "/usr/bin/lldb",
"rust-analyzer.checkOnSave.command": "clippy"
},
"extensions": [
"matklad.rust-analyzer",
"serayuzgur.crates",
"tamasfe.even-better-toml",
"vadimcn.vscode-lldb",
],
"remoteUser": "vscode",
"containerUser": "vscode",
"workspaceMount": "src=${localWorkspaceFolder},dst=/workspace,type=bind,Z",
"workspaceFolder": "/workspace"
}