Open verybada opened 11 years ago
Works perfectly fine for me. I supposed that the variable st was declared inside a function (say main()). Are you using libclang or not? Vim version? clang_complete version?
https://github.com/verybada/sample Here is a sample that I could not complete nested struct. ( line 355 ) Vim is 7.3, I dunno where can I find clang_complete's version, but I think it newest one that I clone from github yesterday.
And here is my vimrc settings let g:clang_close_preview=1 let g:clang_complete_copen=1 let g:clang_library_path="/usr/lib" let g:clang_use_library=1 let g:clang_snippets=1
hope those might some helpful and thanks ur help :D
The sample misses the file "detect_module.h".
Still, the completion shows for me:
storage_st m STORAGE_S storage_st
cam_num m int cam_num
cam_st m CAMERA_S * cam_st
In case you want to further debug this, please set g:clang_debug=1, call ":mess" in vim and send us the output. The debug output should contain a clang statement, you can use to try clang code completion, without clang_complete involved:
clang -Wall -Wno-documentation -x c-header -I/home/grosser/Downloads/c lang+llvm-3.2-x86_64-linux-ubuntu-12.04/lib/../lib/clang/3.2/include/ -fsyntax- only -Xclang -code-completion-at=/tmp/sample/sample.c:354:22 /tmp/sample/sampl e.c
Executing this one gives me:
clang -Wall -Wno-documentation -x c-header -I/home/grosser/Downloads/clang+llvm-3.2-x86_64-linux-ubuntu-12.04/lib/../lib/clang/3.2/include/ -fsyntax-only -Xclang -code-completion-at=/tmp/sample/sample.c:354:22 /tmp/sample/sample.c
/tmp/sample/sample.c:10:10: fatal error: 'detect_module.h' file not found
#include "detect_module.h"
^
COMPLETION: cam_num : [#int#]cam_num
COMPLETION: cam_st : [#CAMERA_S *#]cam_st
COMPLETION: storage_st : [#STORAGE_S#]storage_st
1 error generated.
Which again looks right.
Hi, I got some problem when I want to complete my nested struct like this
typedef struct { int memb_c; int memb_d; }STRUCT_B;
typedef struct { int memb_a; STRUCT_B memb_b; }STRUCT_A;
STRUCT_A st;
when I type "st. ", the plugin will pop up a list include memb_a and memb_b, it looks good. Then I type "st.memb_b." continually, I think it should pop up a list include member c & d, but it tell me nothing. How can I fix this question? Thanks