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 php hightlight #3317

Merged
merged 5 commits into from
Aug 5, 2022
Merged

Fix php hightlight #3317

merged 5 commits into from
Aug 5, 2022

Conversation

erasin
Copy link
Contributor

@erasin erasin commented Aug 3, 2022

namespace
fucntion
a
b

namespace
fucntion
Comment on lines 15 to 17
(subscript_expression
(variable_name(name) @constant.builtin)
)
Copy link
Member

Choose a reason for hiding this comment

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

for code like

$array = ['One', 'Two', 'Three'];
echo $array[0]; // => "One"

This now highlights arrays in L2 as constant.builtin but I think the variable capture from before was more accurate

Copy link
Contributor Author

@erasin erasin Aug 5, 2022

Choose a reason for hiding this comment

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

(subscript_expression
  (variable_name(name) @constant.builtin
    (#match? @constant.builtin "^_?[A-Z][A-Z\\d_]+$")))

it‘s seem ok

erasin and others added 2 commits August 5, 2022 12:08
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@the-mikedavis the-mikedavis merged commit bf6f704 into helix-editor:master Aug 5, 2022
@erasin erasin deleted the php-highlight branch August 5, 2022 13:07
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
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.

3 participants