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

@phpstan doc tags cause syntax highlighting isues #8

Open
jfn4th opened this issue Jan 17, 2025 · 0 comments
Open

@phpstan doc tags cause syntax highlighting isues #8

jfn4th opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@jfn4th
Copy link

jfn4th commented Jan 17, 2025

Voltage version

1.3.0

VSCode version

1.96.4

Laravel version

11.29.0

Livewire version

3.5.12

What happened?

Using @phpstan tags cause everything after said tag to highlight incorrectly, presumably due to collision with the @php blade directive. Tried adding an @endphp in a comment after my phpstan comment, but that didn't help at all.

Here's some example code:

public function getRouteKeyName(): string
{
    // @phpstan-ignore-next-line
    if (request()->is('admin/*') || request()->is('livewire/*')) {
        return 'id';
    } else {
        return 'slug';
    }
}

/**
 * The attributes that are mass assignable.
 *
 * @var array<int, string>
 */
protected $fillable = [
    'name',
    'slug',
    'start_datetime',
    'end_datetime',
    'location',
    'divisions',
    'stage',
    'type',
];

Screenshot of how it looks in editor with @phpstan tag removed

Image

Screenshot with @phpstan tag added.

Image

@jfn4th jfn4th added the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant