Android Studio 3.0 parameter hints information not always visible?

前端 未结 4 1009
梦谈多话
梦谈多话 2021-02-07 09:57

Sorry, I don\'t know how this new functionality is called exactly, please look at screenshot:

So, parameter name is visible in method call. This is cool, but as you can

相关标签:
4条回答
  • 2021-02-07 10:00

    You can enable it by doing the following:

    1. Go to File > Settings > Editor > General > Appearance > Show parameter name hints
    2. Click Configure
    3. Language: -> Java
    4. Options -> Check Show hints even when type of expression is clear

    As you can see below, it is visible for all parameters regardless of type:

    EDIT

    It looks like this setting was removed in Android Studio 4.0

    There are however new Inlay Hints options:

    1. Go to File > Settings > Editor > Inlay Hints > Java > Parameter hints
    2. Check Show parameter hints for:

    0 讨论(0)
  • 2021-02-07 10:10

    Only the primitive and some complex types show hints. You can disable it by right clicking on hint and then "Disable Hints".

    For example:

    public void myFunction(int a, boolean b, MyClass myClass)
        //do something
    }
    

    If you call:

    myFunction(10, true, new MyClass()); 
    

    Only the first two will show hints...

    0 讨论(0)
  • 2021-02-07 10:12

    1.

    Press Alt-Enter on your method and select doesn't show hints for the current method. Then you can see a dialog in the bottom right of the android studio. select Show Parameters Hint Setting, now you can customize this functionality. and finally, select undo in the dialog.

    2.

    File -> Setting -> Editor -> General -> Appearaance-> show parameters hint configure

    0 讨论(0)
  • 2021-02-07 10:24

    In 2020

    For Webstorm & PhpStorm

    If variable calling not shows the parameter hints, you can enable it by going to

    File => Setting => Editor => Inlay Hints => (preferred language) => parameter hints => For non-literal arguments

    0 讨论(0)
提交回复
热议问题