emacs-diffs
[Top][All Lists]
Advanced

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

feature/tree-sitter c352392420 07/10: Add tree-sitter navigation support


From: Yuan Fu
Subject: feature/tree-sitter c352392420 07/10: Add tree-sitter navigation support to python-mode
Date: Wed, 26 Oct 2022 21:42:00 -0400 (EDT)

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

    Add tree-sitter navigation support to python-mode
    
    * lisp/progmodes/python.el (python-mode): Set
    treesit-defun-type-regexp.
---
 lisp/progmodes/python.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 2c0c35174c..9783936635 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -6473,6 +6473,10 @@ Add import for undefined name `%s' (empty to skip): "
     (setq-local treesit-font-lock-settings python--treesit-settings)
     (setq-local imenu-create-index-function
                 #'python-imenu-treesit-create-index)
+    (setq-local treesit-defun-type-regexp (rx bol
+                                              (or "function" "class")
+                                              "_definition"
+                                              eol))
     (treesit-major-mode-setup))
    ;; Elisp.
    (t



reply via email to

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