IntelliJ not showing private or public icon aka visibility icon for methods aka

Mustafa Olomi :

IntelliJ is not showing the padlock telling me whether or not a method is private or public. A course I am taking has it being shown but I do not see this padlock in my IntelliJ.

I already tried clicking settings and made sure Visibility Icons is checked, however this only shows whether or not a Project is public or private not methods.

FYI I am using a PC and the course video is using a Mac

Picture of the courses IntelliJ showing the padlock visibility icon by the method

Picture of my IntelliJ not showing padlock visibility icon by method

Proof that I do have "Show Visibility Icon" checked in my IntelliJ

Eduardo Yáñez Parareda :

The configuration you have shown of Show Visibility Icons is for the left side panel (Project/packages, etc), not for the editor panel.

enter image description here

There's a bug open for 2019.2 version of IntelliJ for this feature: Structure view no longer displays method/field visibility padlock icons.

On the other hand IntelliJ only suggests visible attributes/methods in the autocompletion feature, I mean visible in the context they are.

For example, in a class, all of its own attributes and methods will be suggested, because they belong to that class, but those private attributes, in the context of another class won't be suggested.

So it doesn't matter if they are private or public or protected, because if in the context they are visible, you can use them.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=126686&siteId=1