From 0a4925e84f6b225a7e0f1146d603af3f92cc63bc Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 12 Nov 2024 03:11:50 +0200 Subject: [PATCH] move compile_commands.json to build/ --- .gitignore | 2 +- build/src/clangd.bqn | 6 +++++- src/README.md | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 75228046..ae5b56dd 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,7 @@ perf.data* # clangd compile_commands.json -/.cache/ +.cache/ # things not used anymore, but still may be present in existing clones /SingeliClone/ diff --git a/build/src/clangd.bqn b/build/src/clangd.bqn index 8ac84949..8e1ef76a 100644 --- a/build/src/clangd.bqn +++ b/build/src/clangd.bqn @@ -94,7 +94,11 @@ Finish ⇐ { 𝕊 write: "file"‿"directory"‿"arguments" JObj ⟨JStr name, JStr AtRoot "", ", " JArr JStr¨ flags⟩ } res ← (","∾n) JArr FileObj¨ objects - resPath ← AtRoot "compile_commands.json" + { + •Out {write? "Removing"; "Would remove"} ∾ " old "∾𝕩 + •file.Remove⍟write 𝕩 + }⍟•file.Exists AtRoot "compile_commands.json" + resPath ← AtRoot "build/compile_commands.json" { write? resPath •FChars res diff --git a/src/README.md b/src/README.md index e6c4fe2a..bb425ec3 100644 --- a/src/README.md +++ b/src/README.md @@ -3,7 +3,7 @@ ## clangd Run `build/build clangd` to generate a `compile_commands.json` file which clangd will use to resolve the flags CBQN expects. Other `build/build` flags will also be respected, e.g. `build/build replxx singeli native clangd` will result in clangd assuming the `SINGELI` and `USE_REPLXX` macros are defined, and will resolve generated Singeli sources to ones `build/build replxx singeli native` generates (along with everything else the configurations change). -(depending on the LSP in use, you may need to restart the LSP/clangd/editor after a modified `compile_commands.json`) +(you may need to restart clangd or your editor after a modified `compile_commands.json`) ## Conventions