src/SignatureHelpProvider.php
public function getSignatureHelp(PhpDocument $doc, Position $position): Promise
    {
        return coroutine(function () use ($doc, $position) {
            // Find the node under the cursor
            $node = $doc->getNodeAtPosition($position);

            // Find the definition of the item being called
            list($def, $argumentExpressionList) = yield $this->getCallingInfo($node);

            if (!$def || !$def->signatureInformation) {
                return new SignatureHelp();
            }

            // Find the active parameter
            $activeParam = $argumentExpressionList
                ? $this->findActiveParameter($argumentExpressionList, $position, $doc)
                : 0;

            return new SignatureHelp([$def->signatureInformation], 0, $activeParam);
        });
    }
public function getSignatureHelp(PhpDocument $doc, Position $position): Promise
    {
        return coroutine(function () use ($doc, $position) {
            // Find the node under the cursor
            $node = $doc->getNodeAtPosition($position);

            // Find the definition of the item being called
            list($def, $argumentExpressionList) = yield $this->getCallingInfo($node);

            if (!$def || !$def->signatureInformation) {
                return new SignatureHelp();
            }

            // Find the active parameter
            $activeParam = $argumentExpressionList
                ? $this->findActiveParameter($argumentExpressionList, $position, $doc)
                : 0;

            return new SignatureHelp([$def->signatureInformation], 0, $activeParam);
        });
    }
public function getSignatureHelp ( PhpDocument $ doc , Position $ position ) : Promise { return coroutine ( function ( ) use ( $ doc , $ position ) { // Find the node under the cursor $ node = $ doc -> getNodeAtPosition ( $ position ) ; // Find the definition of the item being called list ( $ def , $ argumentExpressionList ) = yield $ this -> getCallingInfo ( $ node ) ; if ( ! $ def || ! $ def -> signatureInformation ) { return new SignatureHelp ( ) ; } // Find the active parameter $ activeParam = $ argumentExpressionList ? $ this -> findActiveParameter ( $ argumentExpressionList , $ position , $ doc ) : 0 ; return new SignatureHelp ( [ $ def -> signatureInformation ] , 0 , $ activeParam ) ; } ) ; }
Finds signature help for a callable position

@param PhpDocument $doc      The document the position belongs to
@param Position    $position The position to detect a call from

@return Promise <SignatureHelp>
Finds signature help for a callable position