Incorrect order of suggestions

I have class with 2 methods:

convertIntegerToDecimal
convertDecimalToInteger

When I type

$class->convertI

I expect that default suggestion will be  convertIntegerToDecimal, but PhpStorm uses alphabetic order, and I have to act in order to get proper code.
Using PhpStorm 2018.3 RC2

Is this a bug or feature request? Or some hidden setting can make it working correctly?

Thanks

4 comments

Could you please check if you have "Sort suggestions alphabetically" checkbox enabled in "Settings | Editor | General | Code Completion" settings window?

0

Thanks for support, this checkbox is 'off'.

I've updated to 2018.3.2, issue is still in place.

Now the order of functions in the list corresponds to order in the class. Still not suggesting automatically the closest match.

0

With this code:

<?php

class Foo
{
public function convertIntegerToDecimal()
{
}

public function convertDecimalToInteger()
{
}
}

$class = new Foo();
$class->convert

.. I get these suggestions:

convertDecimalToInteger (selected)
convertIntegerToDecimal

But as soon as I type i they get reversed. I have the factory settings:

P.S. With these settings you can also type $class->ci and get a match.

0

Thanks for the example. You can add this info as a comment at https://youtrack.jetbrains.com/issue/WI-42330

I've also checked the "weight" of completion results and they are pretty much the same:


weights:
convertDecimalToInteger frozen=true, sorter=1, stats=0, proximity=[openedInEditor=true, phpScope=0, phpNamespace=40, phpSameFile=true, sameDirectory=true, sameLogicalRoot=false, sameModule=2, inResolveScope=false, sdkOrLibrary=false]
convertIntegerToDecimal frozen=true, sorter=1, stats=0, proximity=[openedInEditor=true, phpScope=0, phpNamespace=40, phpSameFile=true, sameDirectory=true, sameLogicalRoot=false, sameModule=2, inResolveScope=false, sdkOrLibrary=false] 
0

Please sign in to leave a comment.