Skip to content

Fix php hightlight - #3317

Merged
the-mikedavis merged 5 commits into
helix-editor:masterfrom
erasin:php-highlight
Aug 5, 2022
Merged

Fix php hightlight#3317
the-mikedavis merged 5 commits into
helix-editor:masterfrom
erasin:php-highlight

Conversation

@erasin

@erasin erasin commented Aug 3, 2022

Copy link
Copy Markdown
Contributor

namespace
fucntion
a
b

namespace
fucntion
Comment thread runtime/queries/php/highlights.scm Outdated
Comment thread runtime/queries/php/highlights.scm Outdated
Comment thread runtime/queries/php/highlights.scm Outdated
Comment thread runtime/queries/php/highlights.scm Outdated
Comment on lines +15 to +17
(subscript_expression
(variable_name(name) @constant.builtin)
)

Copy link
Copy Markdown
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

@erasin erasin Aug 5, 2022

Copy link
Copy Markdown
Contributor Author

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

@the-mikedavis the-mikedavis left a comment

Copy link
Copy Markdown
Member

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