by teo_zero · 2y ago · 0 comments
Can you mention one editor which does that?
/* given foo.c */
int main() {
int a, *b;
a = 5 * 10;
b = &a;
printf("a is %d\n", *b);
}
and then M-x c-ts-mode followed by navigating to each * and invoking M-x treesit-inspect-node-at-point in turn produces, respectively: (declaration declarator: (pointer_declarator "*"))
right: (binary_expression operator: "*")
arguments: (argument_list (pointer_expression operator: "*"))
1: https://www.emacswiki.org/emacs/Tree-sitter return (A)*(B);
which depends on A being a type or a variable.