c-ts-mode: Highlight name in parameter declarations
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Uncomment parameter declaration highlighting (bug#61275). (c-ts-mode--fontify-declarator): Check that identifier was found. Some declarations can miss identifier name.
This commit is contained in:
parent
89b550eac2
commit
69380a88e9
1 changed files with 7 additions and 7 deletions
|
@ -440,11 +440,10 @@ MODE is either `c' or `cpp'."
|
|||
declarator: (_) @c-ts-mode--fontify-declarator)
|
||||
|
||||
(function_definition
|
||||
declarator: (_) @c-ts-mode--fontify-declarator))
|
||||
declarator: (_) @c-ts-mode--fontify-declarator)
|
||||
|
||||
;; Should we highlight identifiers in the parameter list?
|
||||
;; (parameter_declaration
|
||||
;; declarator: (_) @c-ts-mode--fontify-declarator))
|
||||
(parameter_declaration
|
||||
declarator: (_) @c-ts-mode--fontify-declarator))
|
||||
|
||||
:language mode
|
||||
:feature 'assignment
|
||||
|
@ -552,9 +551,10 @@ For NODE, OVERRIDE, START, END, and ARGS, see
|
|||
identifier)))
|
||||
("function_declarator" 'font-lock-function-name-face)
|
||||
(_ 'font-lock-variable-name-face))))
|
||||
(treesit-fontify-with-override
|
||||
(treesit-node-start identifier) (treesit-node-end identifier)
|
||||
face override start end)))
|
||||
(when identifier
|
||||
(treesit-fontify-with-override
|
||||
(treesit-node-start identifier) (treesit-node-end identifier)
|
||||
face override start end))))
|
||||
|
||||
(defun c-ts-mode--fontify-variable (node override start end &rest _)
|
||||
"Fontify an identifier node if it is a variable.
|
||||
|
|
Loading…
Add table
Reference in a new issue