emacs-diffs
[Top][All Lists]
Advanced

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

feature/tree-sitter f9f9b43df5 02/14: Minor change to tree-sitter imenu


From: Yuan Fu
Subject: feature/tree-sitter f9f9b43df5 02/14: Minor change to tree-sitter imenu function of js-mode
Date: Fri, 4 Nov 2022 13:19:09 -0400 (EDT)

branch: feature/tree-sitter
commit f9f9b43df5bdadb54a1ba14e1624aa254d9f092d
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Minor change to tree-sitter imenu function of js-mode
    
    If someone don’t like the labels, they can set them to empty strings.
    
    * lisp/progmodes/js.el (js--treesit-imenu-type-alist): Add space.
    (js--treesit-imenu-label): Remove space.
---
 lisp/progmodes/js.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index c77c0fb90b..92a8599d7f 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3620,10 +3620,10 @@ This function can be used as a value in 
`which-func-functions'"
 
 ;; Keep this private since we might later change it or generalize it.
 (defvar js--treesit-imenu-type-alist
-  '((variable . "V")
-    (function . "F")
-    (class . "C")
-    (method . "M"))
+  '((variable . "V ")
+    (function . "F ")
+    (class . "C ")
+    (method . "M "))
   "Maps imenu label types to their \"symbol\".
 Symbols are prefixed to each label in imenu (see
 `js--treesit-imenu-label').")
@@ -3632,7 +3632,7 @@ Symbols are prefixed to each label in imenu (see
   "Format label for imenu.
 TYPE can be `variable', `function', `class', `method'.
 NAME is a string."
-  (format "%s %s" (alist-get type js--treesit-imenu-type-alist)
+  (format "%s%s" (alist-get type js--treesit-imenu-type-alist)
           name))
 
 (defun js--treesit-imenu-1 (node)



reply via email to

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