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

雨燕双飞 提交于 2019-12-13 16:09:05

问题


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 :-

(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 :-

My workaround

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

Bounty Reason

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

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


回答1:


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:

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




回答2:


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.



来源:https://stackoverflow.com/questions/43164856/autocompletion-of-parameter-list-static-fields-without-typing-a-classname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!