tree-sitter-cpp icon indicating copy to clipboard operation
tree-sitter-cpp copied to clipboard

conversion function fails to highlight

Open ville-h opened this issue 2 years ago • 0 comments

A class with a conversion function fails to highlight the conversion function name.

struct aa {
    // conversion function
    operator int() {
        return 0;
    }
};


auto main() -> int {
    return 0;
}

I would have expected the "operator int" part to be highlighted same as other member functions. I was able to get a partially successful hack by adding:

(field_declaration_list (function_definition (operator_cast) @function))

in emacs. It highlights the "operator" part, doesn't highlight "int" and then also highlights the "()". I wasn't able to device a correct matcher that would just highlight "operator int".

Still unclear to me what repository is correct for what kind of bug reports. Is this due to the emacs related tree-sitter packages and should be reported there instead?

ville-h avatar May 22 '22 12:05 ville-h