Skip to content

Add advanced completion for custom methods/functions via meta php #26

@King2500

Description

@King2500

.phpstorm.meta.php:

<?php
namespace PHPSTORM_META {
    xAdvancedCompletion(\My\Stuff\Example::formatDate(), 1, 'date_format');
}

User code:

$x = new Example();
$x->formatDate($val, '<caret>');

Plugin's built-in .phpstorm.meta.php:

<?php
namespace PHPSTORM_META {
    function xAdvancedCompletion($functionReference, $argumentIndex, $completionList) {
        return "xAdvancedCompletion " . $functionReference . " at " . $argumentIndex . ": " . $completionList;
    }

    registerArgumentsSet('x_advanced_completion_lists', 'date_format', 'strftime_format' /*...*/);
    expectedArguments(\PHPSTORM_META\xAdvancedCompletion(), 2, argumentsSet('x_advanced_completion_lists');
}

Solves #19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions