emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/typescript-mode 7f4bf6cad9 075/222: Highlight function nam


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode 7f4bf6cad9 075/222: Highlight function name for exported or declared functions.
Date: Sun, 6 Feb 2022 16:59:19 -0500 (EST)

branch: elpa/typescript-mode
commit 7f4bf6cad90be52f6c443f9e28145087d2e93c33
Author: Jack Williams <jw@jackw.io>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Highlight function name for exported or declared functions.
---
 typescript-mode.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/typescript-mode.el b/typescript-mode.el
index a2150a7a4c..a7f5970d2f 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -104,6 +104,10 @@ and group 3 is the 'function' keyword.")
   "Regexp matching a typescript explicit prototype \"class\" declaration.
 An example of this is \"Class.prototype = { method1: ...}\".")
 
+(defconst typescript--module-declaration-re
+  "^\\s-*\\(?:declare\\|\\(?:export\\(?:\\s-+default\\)?\\)\\)?"
+  "Regexp matching ambient declaration modifier or export declaration")
+
 ;; var NewClass = BaseClass.extend(
 (defconst typescript--mp-class-decl-re
   (concat "^\\s-*var\\s-+"
@@ -249,7 +253,8 @@ name as matched contains
 
 (defconst typescript--function-heading-1-re
   (concat
-   "^\\s-*function\\s-+\\(" typescript--name-re "\\)")
+   typescript--module-declaration-re
+   "\\s-*function\\s-+\\(" typescript--name-re "\\)")
   "Regexp matching the start of a typescript function header.
 Match group 1 is the name of the function.")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]