From 1cce696ed89abe9fc3be5ea77b83c38e55c8a714 Mon Sep 17 00:00:00 2001 From: Noah Peart Date: Thu, 18 Apr 2024 18:52:06 -0700 Subject: [PATCH] Add font-locking rule for Rust function signatures * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): Add font-lock rule for Rust function signatures and missing function modifier keyword 'default'. --- lisp/progmodes/rust-ts-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 7112ceced57..92978db64af 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -129,7 +129,7 @@ rust-ts-mode--builtin-macros "Rust built-in macros for tree-sitter font-locking.") (defvar rust-ts-mode--keywords - '("as" "async" "await" "break" "const" "continue" "dyn" "else" + '("as" "async" "await" "break" "const" "continue" "default" "dyn" "else" "enum" "extern" "fn" "for" "if" "impl" "in" "let" "loop" "match" "mod" "move" "pub" "ref" "return" "static" "struct" "trait" "type" "union" "unsafe" "use" "where" "while" (crate) (self) (super) @@ -176,6 +176,7 @@ rust-ts-mode--font-lock-settings :language 'rust :feature 'definition '((function_item name: (identifier) @font-lock-function-name-face) + (function_signature_item name: (identifier) @font-lock-function-name-face) (macro_definition "macro_rules!" @font-lock-constant-face) (macro_definition (identifier) @font-lock-preprocessor-face) (field_declaration name: (field_identifier) @font-lock-property-name-face) -- 2.34.1