]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve function signature font-lock rust-ts-mode (bug#70465)
authorNoah Peart <noah.v.peart@gmail.com>
Fri, 19 Apr 2024 01:52:06 +0000 (18:52 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 22 Apr 2024 18:36:40 +0000 (20:36 +0200)
* 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'.

(cherry picked from commit 91cad6df73e5d64ae5621baa8e01a295433e1e55)

lisp/progmodes/rust-ts-mode.el

index 7112ceced5704a3dcfd9dffcb2b3ec7f832917d9..92978db64af14aec615880e0c2fd783740d54c13 100644 (file)
@@ -129,7 +129,7 @@ to be checked as its standard input."
   "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 @@ to be checked as its standard input."
    :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)