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

Support attributes in PHP lexer #1915

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

tancnle
Copy link
Collaborator

@tancnle tancnle commented Jan 17, 2023

This PR adds highlight for PHP Attributes.

Screenshot 2023-01-18 at 12 14 32 am

Resolves #1759

@tancnle tancnle merged commit a4ed658 into rouge-ruby:master Jan 24, 2023
@tancnle tancnle deleted the feature.php-attributes branch January 24, 2023 23:25
@d9beuD
Copy link

d9beuD commented Apr 17, 2024

Hey @tancnle, nice work you did here! Wouldn't be great to have syntax highlight inside PHP attributes like VSCode does?

By the way, if an attribute is multiline (see example bellow), it identifies the attribute class name as a function name.

#[ApiResource(
    operations: [
        new GetCollection(),
        new Post(processor: UserPasswordHasher::class, validationContext: ['groups' => ['Default', 'user:create']]),
        new Get(
            uriTemplate: '/users/me',
            security: "is_granted('ROLE_USER') and object == user",
            provider: CurrentUserProvider::class,
            openapi: new Operation(
                summary: 'Retrieves the current user',
            )
        ),
    ],
)]

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.

Support PHP8 attributes
2 participants