Skip to content

Commit c0532b2

Browse files
authored
feat vscode: add devcontainer support (#88)
1 parent 4f420fd commit c0532b2

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.devcontainer/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This is the minimal devcontainers configuration e.g. for use in VSCode or CLion.
2+
If you don't use devcontainers, feel free to delete this directory.

.devcontainer/devcontainer.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"image": "ghcr.io/userver-framework/ubuntu-22.04-userver-pg-dev",
3+
"remoteUser": "user",
4+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/user/service_template,type=bind",
5+
"workspaceFolder": "/home/user/service_template",
6+
"runArgs": [
7+
"--cap-add=SYS_PTRACE",
8+
"--security-opt",
9+
"seccomp=unconfined"
10+
],
11+
"forwardPorts": [
12+
8080
13+
],
14+
"containerEnv": {
15+
"SHELL": "/bin/bash",
16+
"PREFIX": "${PREFIX:-~/.local}",
17+
"CCACHE_DIR": "/home/user/service_template/.ccache",
18+
"CORES_DIR": "/cores"
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
"llvm-vs-code-extensions.vscode-clangd",
24+
"ms-vscode.cmake-tools",
25+
"ms-vscode.makefile-tools",
26+
"vadimcn.vscode-lldb",
27+
"ms-azuretools.vscode-docker"
28+
],
29+
"settings": {
30+
"cmake.automaticReconfigure": false,
31+
"cmake.configureOnEdit": false,
32+
"cmake.configureOnOpen": false,
33+
"cmake.copyCompileCommands": "${workspaceFolder}/.vscode/compile_commands.json",
34+
"clangd.path": "/usr/bin/clangd",
35+
"clangd.arguments": [
36+
"--background-index",
37+
"--compile-commands-dir=.vscode",
38+
"--clang-tidy",
39+
"--completion-style=detailed",
40+
"--header-insertion=never"
41+
]
42+
}
43+
}
44+
},
45+
"onCreateCommand": "sudo git config --global --add safe.directory /home/user/service_template",
46+
"mounts": []
47+
}

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ dist-clean:
4141
rm -rf build*
4242
rm -rf tests/__pycache__/
4343
rm -rf tests/.pytest_cache/
44+
rm -rf .ccache
45+
rm -rf .vscode/.cache
46+
rm -rf .vscode/compile_commands.json
4447

4548
# Install
4649
.PHONY: $(addprefix install-, $(PRESETS))

0 commit comments

Comments
 (0)