Java code completion - hide inaccessible members?

Is there a way to setup IntelliJ code completion in Java so the inaccessible class members would not be displayed in the suggestions list?
For example, if I am in the context where protected members of the class cannot be accessed, these members would not be shown in the suggestions list?

Thanks in advance,
- Nikolay

Comment actions Permalink

There is no need to set it up; it always works this way.

Comment actions Permalink

Please see the attached screenshot.
You could notice that the first three elements in suggestions list showed with a small "key", which gives a hint that these are not public.
And if I choose one of those, for sure, IDEA and Java compiler won't take them as accessible.

I use IntelliJ IDEA 11.1.1 Build #IU-117.117

IntelliJ - suggestions list.jpg
Comment actions Permalink

Looks like you have pressed the code completion shortcut twice. The second completion extends the choice of variants available for completion, among others by adding inaccessible members.

Comment actions Permalink

I just pressed a dot (.) right after testService variable - is there a setting that might affect the content of suggestions list that pops up in this situation?
I also noticed that Ctrl+SPACE gives the same list.
However, Ctrl+Shift+SPACE gives the list without inaccessible members - exactly what I would expect after pressing a dot (.) right after testService.

Comment actions Permalink

There are no settings for this. You will also get private members in the completion list if you're in the context of the TestService class (in its inner class, for example).
Do you have any third-party plugins installed?

Comment actions Permalink

I attached the list of plugins I have enabled (please disregard "true" in the first column - it's just a sideeffect of copy+paste from Settings/Plugins grid in IDEA):
Do you know if any of these could affect the suggestions list?

true Ant Support
true Commander
true Copyright
true Coverage
true CSS Support
true Database Support
true DSM Analysis
true Eclipse Integration
true Flash/Flex Support
true GenerateToString
true HTML Tools
true I18n for Java
true Inspection Gadgets
true Inspection-JS
true IntelliLang
true Intention Power Pack
true JarFinder
true Java EE Integration
true Java Server Pages Integration
true JavaScript Debugger
true JavaScript Intention Power Pack
true JavaScript Support
true JUnit
true LESS support
true Maven Integration
true Maven Integration Extension
true Perforce Integration
true Persistence Frameworks Support
true Plugin DevKit
true Properties Support
true QuirksMode
true Refactor-X
true SASS support
true Structural Search
true Task Management
true TestNG-J
true Tomcat Integration
true Type Migration
true UML Support
true W3C Validators
true XPathView + XSLT Support
true XSLT-Debugger
true ZKM-Unscramble

Please sign in to leave a comment.