Vscode-intelephense: Code Completion incomplete (phpunit)

Created on 3 Jan 2018  路  2Comments  路  Source: bmewburn/vscode-intelephense

Hi,
first of all, thank you for this great extension.
It seems, I have encountered a bug where intelephense is not properly able to parse through the php files to create a solid autocompletion.

See for yourself: In netbeans 8.2, all assert methods are hinted.

asserts-netbeans82

In VS Code, sadly, all assert methods are missing.

asserts-vscode-intelephense

The screenshots were taken from the same PHP file, opened in the two IDEs.

Basically, my script is just a standard phpunit testcase:

<?php

use GuzzleHttp\Client;
use PHPUnit\Framework\TestCase;




class ApiTest extends TestCase
{
 // code here

}

I am absolutely willing to provide additional infos if needed.

bug

Most helpful comment

Thanks, @madflow , I did not know this. I also learned just now that PHP allows static methods to be called on instances via the -> operator. Currently static methods are filtered out in such cases so I'll fix this in the next release.

All 2 comments

The assert* methods are static. See: https://phpunit.de/manual/current/en/appendixes.assertions.html

The plugin will find them when you use the self:: keyword.

But - $this->assert* does also work in PHPunit and most people seem to use it that way. I do not known, why Netbeans and PHPStorm will find the autocompletion in this case.

Thanks, @madflow , I did not know this. I also learned just now that PHP allows static methods to be called on instances via the -> operator. Currently static methods are filtered out in such cases so I'll fix this in the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

superadmini picture superadmini  路  4Comments

swashata picture swashata  路  3Comments

aleksandervines picture aleksandervines  路  3Comments

9brada6 picture 9brada6  路  3Comments

ghost picture ghost  路  3Comments