asyncomplete.vim icon indicating copy to clipboard operation
asyncomplete.vim copied to clipboard

[Question] How to auto popup struct field or class memer in C/C++ when you type dot or ->

Open tracyone opened this issue 2 years ago • 2 comments

example

struct xx_t {
int a;
int b
};

int main(){
struct xx_t var;

var. //when i type dot, nothing popup, I have to press tab or type 2 more char
}



tracyone avatar Sep 08 '22 13:09 tracyone

C-x C-o

xylo987 avatar Sep 14 '22 01:09 xylo987

@syz-lm YouCompletMe can auto popup complete menu when user type dot or ->

tracyone avatar Sep 14 '22 02:09 tracyone

@syz-lm YouCompletMe can auto popup complete menu when user type dot or ->

YCM is too complicated and too coupled, vim-lsp is the best I have ever used. Resolutely do not use YCM, it is big and unfriendly.

xylo987 avatar Sep 17 '22 01:09 xylo987

@syz-lm

I have found a way to do that

https://github.com/tracyone/vinux/commit/3d9bf3a32e1d6e3613a85e459840068c8b8ab74c

I use InsertCharPre event to detect user input when user type dot or ">", I will change b:asyncomplete_min_chars to zero

then the complete menu will auto popup

tracyone avatar Sep 20 '22 14:09 tracyone