Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/softmotions/acdb
Clang's C/C++ compile_commands.json generator for Arduino projects
https://github.com/softmotions/acdb
arduino autocompletion clangd coc-clangd coc-nvim language-server neovim nvim vim
Last synced: 8 days ago
JSON representation
Clang's C/C++ compile_commands.json generator for Arduino projects
- Host: GitHub
- URL: https://github.com/softmotions/acdb
- Owner: Softmotions
- License: other
- Created: 2022-08-16T15:21:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T15:38:02.000Z (about 1 year ago)
- Last Synced: 2024-04-13T07:35:13.989Z (7 months ago)
- Topics: arduino, autocompletion, clangd, coc-clangd, coc-nvim, language-server, neovim, nvim, vim
- Language: C
- Homepage:
- Size: 92.8 KB
- Stars: 4
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog
- License: LICENSE
Awesome Lists containing this project
README
# Clang's C/C++ compile commands .json generator for Arduino projects
This is a small utility program which generates a `compile_commands.json` file in your Arduino sketch directory.
A `compile_commands.json` is used by `cland` language server give you a proper IDE code completion.Now you can code Arduino projects in vim/neovim editor with [CoC](https://github.com/neoclide/coc.nvim) or neovim LSP.
## Prerequisites
* The latest `arduino-cli` tool in your path
* CMake build tool
* gcc/clang compiler## Installation
### CoC users
Associate `.ino` files with coc-clangd language server in `init.vim`
```vim
let g:coc_filetype_map = {
\ 'ino': 'cpp',
\ }
``````sh
git clone https://github.com/Softmotions/acdbmkdir ./acdb/build && cd ./acdb/build
cmake .. -DCMAKE_INSTALL_PREFIX=~/.local
make install
```## Usage
```sh
acdb [options] [sketch directory
-a, --arduino-cli=<> Path to the arduino-cli binary.
-b, --fqbn=<> Fully Qualified Board Name, e.g.: arduino:avr:uno
-V, --verbose Print verbose output.
-v, --version Show program version.
-h, --help Print usage help.
``````sh
cd ./MySketch
acdb --fqbn=arduino:avr:nano:cpu=atmega328old
````or
```sh
cat ./sketch.json
{
"cpu": {
"fqbn": "arduino:avr:nano:cpu=atmega328old"
}
}acdb
```## Troubleshooting
Refer to https://github.com/Softmotions/acdb/issues/1