Bug 1829512 - Use .clangd rather than vscode-specific configuration to point to the compilation database. r=andi

Differential Revision: https://phabricator.services.mozilla.com/D176230
This commit is contained in:
Emilio Cobos Álvarez 2023-04-23 06:23:39 +00:00
parent d3cbada9f4
commit 169a3e63a8
3 changed files with 11 additions and 2 deletions

1
.gitignore vendored
View File

@ -35,6 +35,7 @@ ID
# User files that may appear at the root
/.clang-tidy
/.clangd
/.mozconfig*
/mozconfig*
/old-configure

View File

@ -33,6 +33,7 @@ compile_commands\.json
# User files that may appear at the root
^\.clang-tidy
^\.clangd
^\.mozconfig
^mozconfig*
^\.moz-fast-forward

View File

@ -299,11 +299,18 @@ def setup_clangd_rust_in_vscode(command_context):
with open(".clang-tidy", "w") as file:
yaml.dump(clang_tidy, file)
clangd_cfg = {
"CompileFlags": {
"CompilationDatabase": clangd_cc_path,
}
}
with open(".clangd", "w") as file:
yaml.dump(clangd_cfg, file)
return {
"clangd.path": clangd_path,
"clangd.arguments": [
"--compile-commands-dir",
clangd_cc_path,
"-j",
str(multiprocessing.cpu_count() // 2),
"--limit-results",