Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate clangd #280

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/.clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
Remove: [-fno-printf-return-value, -mfp16-format=ieee, -fno-reorder-functions, -mthumb-interwork]
22 changes: 15 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@

{
"name": "Bridle",
"build": {
"dockerfile": "Dockerfile",
// Specify version for Zephyr Container
// See https://github.com/zephyrproject-rtos/docker-image/releases
"args": { "ZEPHYR_TAG": "v0.27.4" }
"args": {
"ZEPHYR_TAG": "v0.27.4"
}
},
// Needed for USB devices in container
"privileged": true,
"postCreateCommand": "bash ${localWorkspaceFolderBasename}/.devcontainer/post-create.sh /workspace ${localWorkspaceFolderBasename}",
"postStartCommand": "bash ${localWorkspaceFolderBasename}/.devcontainer/post-start.sh /workspace",
// Mount and set workspace folder
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspace,type=bind",
"workspaceFolder": "/workspace",
"workspaceFolder": "/workspace",
// Username in container - align with Dockerfile
"remoteUser": "user",
"remoteUser": "user",
"mounts": [
// Persist installed extensions in container
"source=bridle-devcontainer-extensions,target=/home/user/.vscode-server/extensions,type=volume",
// Allow attaching USB devices to running container
"source=/dev,target=/dev,type=bind"
],"customizations": {
],
"customizations": {
"vscode": {
"settings": {
"editor.trimAutoWhitespace": true,
"editor.insertFinalNewline": true
"editor.insertFinalNewline": true,
"clangd.arguments": [
"--compile-commands-dir=/workspace/build",
"--header-insertion=never"
],
"clangd.path": "clangd-16"
},
"extensions": [
"marus25.cortex-debug",
"ms-vscode.cmake-tools"
"ms-vscode.cmake-tools",
"llvm-vs-code-extensions.vscode-clangd"
]
}
}
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if [ ! -d ".west" ]; then
west init -l $REPO_NAME
fi

ln -s $REPO_NAME/.devcontainer/.clangd

west update
west bridle-export

Expand Down
Loading