desdic/agrolens.nvim

Rust callings does not find functions called in macros

desdic opened this issue · 1 comments

queries/rust/agrolens.callings.scm does not get the callings in macros like

println!("{} or {}", get_num(42), p.get_age());

the treesitter node looks like

    expression_statement [23, 4] - [23, 51]
      macro_invocation [23, 4] - [23, 50]
        macro: identifier [23, 4] - [23, 11]
        token_tree [23, 12] - [23, 50]
          expression_statement [23, 12] - [23, 50]
            tuple_expression [23, 12] - [23, 50]
              string_literal [23, 13] - [23, 23]
              call_expression [23, 25] - [23, 36]
                function: identifier [23, 25] - [23, 32]
                arguments: arguments [23, 32] - [23, 36]
                  integer_literal [23, 33] - [23, 35]
              call_expression [23, 38] - [23, 49]
                function: field_expression [23, 38] - [23, 47]
                  value: identifier [23, 38] - [23, 39]
                  field: field_identifier [23, 40] - [23, 47]
                arguments: arguments [23, 47] - [23, 49]

it matches as far as
(expression_statement(macro_invocation(token_tree))) @agrolens.scope
but not

(expression_statement(macro_invocation(token_tree(expression_statement)))) @agrolens.scope

Documented and will be fixed when I have a solution