Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code completion for fields with single line var doc #6359 #6364

Conversation

junichi11
Copy link
Member

// example
class X {
    public function testX(): void {}
}

class Y {
    public function testY(): void {}
}

class GH6359 {

    /** @var X $testX */
    protected $testX;
    /** @var X|Y $testXorY */
    protected $testXorY;
    /** @var X&Y $testXandY */
    protected $testXandY;

    public function test(): void {
        $this->testX->testX();
        $this->testXorY->testX();
        $this->testXandY->testX();
    }
}

- apache#6359
- `/** @var Type $field */` is recognized as not `PHPDocBlock` but `PHPVarComment`, so, check it
```php
// example
class X {
    public function testX(): void {}
}

class Y {
    public function testY(): void {}
}

class GH6359 {

    /** @var X $testX */
    protected $testX;
    /** @var X|Y $testXorY */
    protected $testXorY;
    /** @var X&Y $testXandY */
    protected $testXandY;

    public function test(): void {
        $this->testX->testX();
        $this->testXorY->testX();
        $this->testXandY->testX();
    }
}
```
@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label Aug 21, 2023
@junichi11 junichi11 added this to the NB20 milestone Aug 21, 2023
@junichi11 junichi11 requested a review from tmysik August 21, 2023 14:04
Copy link
Member

@tmysik tmysik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks! 👍

@junichi11 junichi11 merged commit c473ac3 into apache:master Aug 30, 2023
@junichi11 junichi11 deleted the php-gh-6359-field-cc-with-single-line-vardoc branch August 30, 2023 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PHP] Cases of auto-completion not matching with single-line DocComments
2 participants