Trouble completing macros/#define constants

8 views
Skip to first unread message

Andrew Oates

unread,
Jul 7, 2023, 8:33:23 AM7/7/23
to ycm-users
I have a C codebase with a lot of #define'd constants, and I consistently have a lot of trouble with YCM completing them.  Based on some debugging, I suspect it is a clangd issue, not a YCMd one (I enabled verbose logging on clangd and snooped the logs, and it's not returning the results -- though I don't really know much past that).

In particular, it seems to not do proper fuzzy subsequence matching, only prefix matching (but the behavior is somewhat inconsistent).

For example, if I have a header file that say,
extern int RSV_PTE_WTEST;
#define RSV_PTE_WRITE 5

In my source file, if I trigger completion after RSV_PTE_W, I will get both results back.  However if I trigger completion after PTEW, I only get RSV_PTE_WTEST (the extern int), not the #define.

Anyone have suggestions for working around this?

Thanks,
Andrew
Reply all
Reply to author
Forward
0 new messages