I’ve been having trouble with Neovim/DWM. Mostly the fact that DWM defines variables in source files that need to be accessed in header files. I can’t figure out how to get clangd to realize that. Is there any way to get Clangd to search the entire directory (not just the current file and files it #include
s)?
I have a compile_commands.json
, generated with bear
. I used compdb
to add header files, in case it just doesn’t realize they’re part of the same project. Still no luck. If it helps, DWM’s project structure basically looks like this.
Here’s the JSON file:
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "drw.c"
},
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "dwm.c"
},
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "util.c"
},
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "drw.h"
},
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "util.h"
},
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "config.h"
},
{
"directory": "/home/<me>/config-sync/.config/dwm",
"command": "cc -c -g -std=c99 -pedantic -Wall -O0 -I/usr/X11R6/include -I/usr/include/freetype2 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\\\"6.5\\\" -DXINERAMA drw.c dwm.c util.c movestack.c drw.h util.h config.h",
"file": "movestack.c"
}
]