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

Error after a tree-sitter-qmljs update #2

Open
scondratev opened this issue Jan 17, 2025 · 0 comments
Open

Error after a tree-sitter-qmljs update #2

scondratev opened this issue Jan 17, 2025 · 0 comments

Comments

@scondratev
Copy link

scondratev commented Jan 17, 2025

When I installed the latest treesitter module, I started getting the error:

treesit-font-lock-fontify-region: Query pattern is malformed: "Node type error at", 223, "(function_declaration name: (identifier) @font-lock-function-name-face) (variable_declarator name: (identifier) @font-lock-variable-name-face) (variable_declarator name: (identifier) @font-lock-function-name-face value: [(function) (arrow_function)]) (variable_declarator name: (array_pattern (identifier) (identifier) @font-lock-function-name-face) value: (array (number) (function))) (import_clause (identifier) @font-lock-variable-name-face) (import_clause (named_imports (import_specifier (identifier)) @font-lock-variable-name-face)) (required_parameter (identifier) @font-lock-variable-name-face) (optional_parameter (identifier) @font-lock-variable-name-face) (ui_signal name: (identifier) @font-lock-function-name-face) (ui_binding name: [(identifier) @font-lock-variable-name-face (nested_identifier) @font-lock-variable-name-face])", "Debug the query with `treesit-query-validate'"

I've solved this problem by replacing

     (variable_declarator
      name: (identifier) @font-lock-function-name-face
      value: [(function) (arrow_function)])

     (variable_declarator
      name: (array_pattern
             (identifier)
             (identifier)
             @font-lock-function-name-face)
      value: (array (number) (function)))

with expressions from the typescript-ts mode:

     (variable_declarator
      name: (identifier) @font-lock-function-name-face
      value: [(function_expression) (arrow_function)])

     (variable_declarator
      name: (array_pattern
             (identifier)
             (identifier)
             @font-lock-function-name-face)
      value: (array (number) (function_expression)))

Please, fix it in the master branch.

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

No branches or pull requests

1 participant