Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion of anonymous structures and unions inside designated initializers #836

Closed
aganm opened this issue Aug 5, 2021 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@aganm
Copy link

aganm commented Aug 5, 2021

(this issue is a continuation of #142)

Completion of nested initializers now works as of clangd version 13.0.0.
(Debian clangd version 13.0.0-++20210619101720+e1adf90826a5-1~exp1)

Unfortunately, it does not seem to support anonymous structures and unions inside designated initializers.

// main.c

struct test {
	struct {
		int x;
		struct {
			int y;
		} nested;
	} nested;

	struct {
		int z,w;
	}; // anonymous struct
};

int main()
{
	struct test t = {
		.nested = { .x = 3, .nested = { .y = 6 }, }, // full completion for named nested members
		. // no completion for anonymous struct members z,w in designated initializer
	};

 	return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants