Skip to content

Error after a tree-sitter-qmljs update #2

@scondratev

Description

@scondratev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions