javaLover
javaLover

Reputation: 6425

autocompletion of parameter : list static fields without typing a ClassName::

How to make auto-completion list all (static) fields of a certain class that has appropriate variable-type when ctrl+space at a slot of parameter in a certain function?

Example

I tried to ctrl+space in the below code :-

enter image description here

(Code as text is here.)

Question: How to make it show E_1 E_2 E_3?
I don't mind another plugin if I really need one.

It currently works but only for enum :-

enter image description here

My workaround

In practice, to get smart clue, I have to type more (PrototypeList::) :-

enter image description here

Bounty Reason

Here is the result of the current answer (citizenmatt's):-

enter image description here

It is different, but still not show E_1 E_2 E_3.

Upvotes: 2

Views: 187

Answers (2)

Igor Akhmetov
Igor Akhmetov

Reputation: 1930

In fact, ReSharper does help you here. All of E_1, E_2 and E_3 are in the completion list, but not on the top of it - they are assigned lower scores because they need an additional qualifier. That said, looks like there is still an issue with scoring: enter image description here

E_2 and E_3 are in the list too, but they are not shown alongside E_1. We'll investigate this (RSCPP-19501).

Upvotes: 1

citizenmatt
citizenmatt

Reputation: 18583

Have you tried Smart Completion? This feature will only show completion items that are valid for the current context. I think it works in C++, too.

Upvotes: 2

Related Questions