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 highlighting keyword #10

Merged
merged 1 commit into from
May 22, 2023
Merged

Fix highlighting keyword #10

merged 1 commit into from
May 22, 2023

Conversation

zonuexe
Copy link
Member

@zonuexe zonuexe commented May 22, 2023

Quick fix #9

Words not defined as keywords cause highlighting errors:

スクリーンショット 2023-05-22 22 31 54
Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 473 "[\"abstract\" \"as\" \"break\" \"case\" \"catch\" \"class\" \"const\" \"continue\" \"declare\" \"default\" \"do\" \"echo\" \"else\" \"elseif\" \"enddeclare\" \"endforeach\" \"endif\" \"endswitch\" \"endwhile\" \"enum\" \"extends\" \"final\" \"finally\" \"for\" \"foreach\" \"fn\" \"function\" \"global\" \"if\" \"implements\" \"include_once\" \"include\" \"insteadof\" \"interface\" \"namespace\" \"new\" \"private\" \"protected\" \"public\" \"readonly\" \"require_once\" \"require\" \"return\" \"static\" \"switch\" \"throw\" \"trait\" \"try\" \"use\" \"while\" \"yield\" \"yield from\"] @font-lock-keyword-face" "Debug the query with `treesit-query-validate'")

@@ -76,10 +76,10 @@
"elseif" "enddeclare" "endforeach" "endif" "endswitch"
"endwhile" "enum" "extends" "final" "finally" "for" "foreach"
"fn" "function" "global" "if" "implements" "include_once"
"include" "insteadof" "interface" "namespace" "never" "new"
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

We should move never to type then

"private" "protected" "public" "readonly" "require_once" "require"
"return" "static" "switch" "throw" "trait" "try" "use"
"while" "yield" "yield from")
Copy link
Member Author

Choose a reason for hiding this comment

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

yield and from are declared as independent tokens and must be displayed in some other way. Let's work on it later as TODO.

https://github.com/tree-sitter/tree-sitter-php/blob/1a40581b7a899201d7c2b4684ee34490bc306bd6/grammar.js#L1395C1-L1398

@zonuexe zonuexe merged commit b6f20d4 into master May 22, 2023
@zonuexe zonuexe deleted the fix/highlighting-keyword branch May 22, 2023 13:42
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.

2 participants