((or "function_declarator" "array_declarator" "init_declarator")
(c-ts-mode--declarator-identifier
(treesit-node-child-by-field-name node "declarator")))
+ ("qualified_identifier"
+ (c-ts-mode--declarator-identifier
+ (treesit-node-child-by-field-name node "name")))
;; Terminal case.
((or "identifier" "field_identifier")
node)))
For NODE, OVERRIDE, START, END, and ARGS, see
`treesit-font-lock-rules'."
(let* ((identifier (c-ts-mode--declarator-identifier node))
- (face (pcase (treesit-node-type (treesit-node-parent identifier))
+ (qualified-root
+ (treesit-parent-while (treesit-node-parent identifier)
+ (lambda (node)
+ (equal (treesit-node-type node)
+ "qualified_identifier"))))
+ (face (pcase (treesit-node-type (treesit-node-parent
+ (or qualified-root
+ identifier)))
("function_declarator" 'font-lock-function-name-face)
(_ 'font-lock-variable-name-face))))
(treesit-fontify-with-override