summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2022-12-12 20:25:53 -0800
committerYuan Fu <casouri@gmail.com>2022-12-12 21:17:40 -0800
commit03ad1a92a2dae107277805f5b24ce1dab3479059 (patch)
treecf9d0543e8b62f6969f85e840caee4361afb0719 /test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el
parenta5272e2a7cc77f17efa144c5482dcfcb62d563d3 (diff)
downloademacs-03ad1a92a2dae107277805f5b24ce1dab3479059.tar.gz
emacs-03ad1a92a2dae107277805f5b24ce1dab3479059.tar.bz2
emacs-03ad1a92a2dae107277805f5b24ce1dab3479059.zip
Add improved tree-sitter navigation
This new set of functions (and tests) should eliminate defun-navigation bugs and limitations we currently have. This commit doesn't change any existing bahavior: treesit-beginning/end-of-defun and friends are unchanged. The plan is to later switch gear and replace the current functions with the new ones introduced in this change. This is a relatively big change, but I've setup a comprehensive test, and it should fix current bugs, so I think it's ok to put it on the release branch. The gist of the new navigation is to use treesit--defuns-around to find the previous sibling defun, next sibling defun, and the parent defun, then use this information to move to previous/next beginning/end of defun in treesit--navigate-defun. I also added comprehensive testing that tests all four possible operations (prev-beg, next-beg, prev-end, next-end) starting at all possible positions (between two sibling defuns, inside a sibling defun, etc). * lisp/treesit.el (treesit-defun-type-regexp): Expand definition to allow (REGEXP . FILTER). Old functions don't support this, but it should be fine since we are soon replacing them. (treesit-defun-tactic) (treesit-defun-skipper): New variables. (treesit-default-defun-skipper) (treesit--defuns-around) (treesit--top-level-defun) (treesit--navigate-defun): New functions. * test/src/treesit-tests.el (treesit--ert-insert-and-parse-marker) (treesit--ert-collect-positions) (treesit--ert-test-defun-navigation): New helper functions. (treesit--ert-defun-navigation-python-program) (treesit--ert-defun-navigation-js-program) (treesit--ert-defun-navigation-bash-program) (treesit--ert-defun-navigation-nested-master): New variables. (treesit-defun-navigation-nested-1) (treesit-defun-navigation-nested-2) (treesit-defun-navigation-nested-3) (treesit-defun-navigation-top-level): New tests.
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el')
0 files changed, 0 insertions, 0 deletions