Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clang_complete pattern not found for C structs

So I have a very basic C program to try and test clang_complete:

#include <stdio.h>
#include <stdlib.h>

struct xampl {
  int x;
};

int main()
{
  struct xampl structure;
  struct xampl *ptr1;
}

However, every time I try to do structure. or ptr1->, the program gives me the error:

User defined completion (^U^N^P) Pattern not found.

I tried adding this to my vimrc:

let g:clang_user_options='|| exit 0' -- 

(from this thread) but, the completion still doesn't work.

Is there something I am missing or not understanding here?

like image 554
Dasun Avatar asked Nov 12 '22 13:11

Dasun


1 Answers

When you say ptr-> you mean ptr1-> right? I have only two strings in my .vimrc

let g:clang_complete_copen=1
let g:clang_hl_errors=1

and your example works fine for me. Make sure you have .clang_complete file with valid include paths (see :help clang_complete for example file). Try to debug clang completer by set up variable let g:clang_debug=1. And read this thread maybe it help you.

like image 69
Alex Kroll Avatar answered Nov 15 '22 04:11

Alex Kroll