Community
Participate
Working Groups
Build Identifier: 20110615-0604 Using following test c file, struct members are not offered by content assist in struct declaration. In a large project like linux kernel content assist fails. (Proposals are enabled in settings) #include <stdio.h> #include <stdlib.h> struct foo { int a; float b; double c; }; struct foo bar = { . CONTENT ASSIST DOES NOT OFFER STRUCT MEMBERS HERE }; int main(void) { bar.a = 1; /* a member was correctly offered here */ puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; } Reproducible: Always Steps to Reproduce: 1. Create a sample test c file with struct declaration like in details. 2. Press ctrl+space after . in struct bar definition.
Created attachment 200493 [details] screenshot of situation
Added testcase and fix.
*** cdt git genie on behalf of Markus Schorn *** Bug 353281: Content assist for designated initializers [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=fea0a6163a194903940d0a90424449c60ed1b006
*** cdt git genie on behalf of Markus Schorn *** Bug 353281: Follow up. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ea5c5cf0d90a3529d98c4f533de5ea9230cf9c96
Content assist works for global designated initializers, but not for initializers within a function. See example struct foo { int x; int y; int z; }; struct foo bar = { .x = 0, .y = 1, /* content assist works here */ }; int main() { struct foo bar2 = { . /* no default proposal */ }; return 0; }
This is a different issue, I currently don't have the time to look into it.
I made a clean install of Eclipse Indigo on Windows with CDT 8.0.2 and it seems that content assist for designated initializers does not work again. Tried also in Juno and situation is the same.
Patch to fix the case in Comment 5 https://git.eclipse.org/r/20094/
The patch was applied to master (8.3).