online
online copied to clipboard
cool#9772: VSCodium/clangd: Add generation of .clangd and .vscode files to ease editing via IDE/language-server
Change-Id: Ic53e554598302e0b5e67568c6b72b9be1bd890a4
- Resolves: #9772
- Target version: master
Summary
Initial integration of .clangd via make gen-clangd and vscode via make gen-vscode, for
- compile_commands.json
- already supported via make compile_commands
- fixed with earlier commit
- .clangd
- in addition to compile_commands.json (CompileFlags), allowing setting include defaults, workspace-dir as well as other clangd settings: Index, Diagnostics (clang-tidy IDE setup), InlayHints (IDE), Hover (IDE).
- .vscode/settings.json
- VSCodium workspace settings (actually empty)
- .vscode/online.code-workspace
- VSCodium workspace project file (proposal)
New make targets:
gen-clangdProduces.clangdandcompile_commands.jsonfilesgen-vscodeProduces.clangdand andcompile_commands.jsonfiles and.vscodedirectory.clean-clangdremoves.clangdfile.clean-vscoderemoves.clangdfile and.vscodedirectory.
Note: The clang* setup has been tested with
- VSCodium Version: 1.91.1, Release: 24193, Commit: 8512cb3341b26a5dba985a9a17eed8d7c3362886, Date: 2024-07-11T18:37:10.462Z
- Eclipse cdt-jsp: C/C++ LSP Support , 2.1.0.202408070815, org.eclipse.cdt.lsp.feature.feature.group, Eclipse CDT
TODO
Maybe we can refine
- Documentation (manuals or wiki) ?
Checklist
- [X] I have run
make prettier-writeand formatted the code. - [x] All commits have Change-Id
- [x] I have run tests with
make check - [x] I have issued
make runand manually verified that everything looks okay - [ ] Documentation (manuals or wiki) has been updated or is not required
Thanks for opening this pull request!
Things that will help get your PR across the finish line:
- Check out our contributing guidelines.
- Connect with us through one of our communication channels.
- Click on the details link next to the failing CI checks, if any, to see an explanation on how to fix it.
- Feel free to ping @pedropintosilva or the mentor of the easyHack you are solving if you need help.
- force pushed with 2 commits
- updated description (aligned with commit 988f6b3f19e080b712cc1aee43747c6b898e259d)
re .clangd file:
in addition to compile_commands.json (CompileFlags), allowing setting include defaults, workspace-dir as well as other clangd settings: Index, Diagnostics (clang-tidy IDE setup), InlayHints (IDE), Hover (IDE).
Essentially the CompileFlags are similar if not same, but added the APP_NAME. We could make them actually the very same. Would allow having same flags for files not reflected by compile_commands.json
The other mentioned use case are for better mentioned indexing and IDE integration, i.e. https://clangd.llvm.org/config
Will revise CompileFlags in .clangd to match compiler_commands.json 100% .. i.e. reuse the settings from Makefile.am.
Hello Sven, is this PR is good to merge in this green cycle release ? If yes, then please can you rebase and merge it ?
Hello Sven, is this PR is good to merge in this green cycle release ? If yes, then please can you rebase and merge it ?
Yeah, just cleaned up the clangd.am config (hardcoded path -> @macro_name@ ... oops) and rebased. Ready to be merged IMHO.