Skip to content

chore: fix clangd config for multi-root workspace#18

Merged
deku2026 merged 3 commits into
mainfrom
chore/vscode-multiroot-clangd
Mar 16, 2026
Merged

chore: fix clangd config for multi-root workspace#18
deku2026 merged 3 commits into
mainfrom
chore/vscode-multiroot-clangd

Conversation

@deku2026
Copy link
Copy Markdown

Summary

Fix clangd.arguments warning in VS Code multi-root workspace.

Problem

clangd.arguments is a window-scoped VS Code setting and cannot be applied in a per-folder .vscode/settings.json when using a multi-root workspace. VS Code shows:

This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly.

Solution

  • Add .clangd config file with CompileFlags.CompilationDatabase: build to handle per-project compile commands path
  • The remaining clangd.arguments (non path-specific flags) are now set at the workspace level in Arc.code-workspace
  • Remove clangd.arguments from .vscode/settings.json

Move --compile-commands-dir from VS Code settings (window-scoped,
not applicable per-folder in multi-root) into .clangd config file.
clangd's CompileFlags.CompilationDatabase resolves relative to each
project root, achieving the same per-project path resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 16, 2026 07:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves clangd configuration out of VS Code workspace settings into a repo-wide .clangd file, aiming to make clangd setup editor-agnostic while keeping the compilation database location consistent.

Changes:

  • Removed clangd.arguments from .vscode/settings.json.
  • Added a root .clangd file to point clangd at build/ for compile_commands.json.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.vscode/settings.json Removes VS Code-specific clangd argument configuration.
.clangd Adds a clangd config to set the compilation database directory to build/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .vscode/settings.json
Comment thread .clangd
Chris and others added 2 commits March 16, 2026 16:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ClangTidy: true is not valid clangd config (expects a dict, not bool).
clang-tidy is enabled via --clang-tidy in Arc.code-workspace and reads
.clang-tidy automatically; no extra .clangd entry needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@deku2026 deku2026 merged commit a7078c2 into main Mar 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants