Skip to content

Conversation

N1ebieski
Copy link
Contributor

@N1ebieski N1ebieski commented Mar 20, 2025

From laravel/vs-code-php-parser-cli#13:

This PR adds support for parser for blade component attributes. Every attribute with a function supported by the extension has a link to the target file.

Before:

before

After:

after

Works with and without blade prefix/suffix statements.

Most of the logic is in the laravel/vs-code-php-parser-cli#13 but for proper display of values in hover, we need to change the calculation of linkRange to exclude double quote from the attribute:

<x-my-component
    attribute-for-label-with-prefix="{{ trans('example.label') }}"

linkRange should return range of:

'example.label'

not:

"{{ trans('example.label') }}"

This PR adds an additional negative lookbehind for the regex to fix this issue.

Fixes #370, #452

…nto Support-for-parser-for-blade-component-attributes-#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Translation Linting is not greedy enough
1 participant