From f7b3546c8ee630bae6ae326d46847f4dcac58835 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Mon, 16 Jan 2023 08:36:49 +0100 Subject: [PATCH] Rename variables from last change * lisp/progmodes/js.el (js--treesit-sentence-nodes): Rename variable from 'js--treesit-sentence-type-regexp'. (js-ts-mode): Refer to it. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--sentence-nodes): Rename variable from 'typescript-ts-mode--sentence-type-regexp'. (typescript-ts-base-mode, tsx-ts-mode): Refer to it. --- lisp/progmodes/js.el | 4 ++-- lisp/progmodes/typescript-ts-mode.el | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index f6103d43eea..fa3b4687ef2 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3789,7 +3789,7 @@ Currently there are `js-mode' and `js-ts-mode'." ;;(syntax-propertize (point-max)) ) -(defvar js--treesit-sentence-type-regexp +(defvar js--treesit-sentence-nodes '("import_statement" "debugger_statement" "expression_statement" @@ -3855,7 +3855,7 @@ See `treesit-sentence-type-regexp' for more information.") (setq-local treesit-defun-name-function #'js--treesit-defun-name) (setq-local treesit-sentence-type-regexp - (regexp-opt js--treesit-sentence-type-regexp)) + (regexp-opt js--treesit-sentence-nodes)) ;; Fontification. (setq-local treesit-font-lock-settings js--treesit-font-lock-settings) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index be84caa7b26..cd631d048ea 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -312,7 +312,7 @@ Argument LANGUAGE is either `typescript' or `tsx'." :override t '((escape_sequence) @font-lock-escape-face))) -(defvar typescript-ts-mode--sentence-type-regexp +(defvar typescript-ts-mode--sentence-nodes '("import_statement" "debugger_statement" "expression_statement" @@ -369,7 +369,7 @@ See `treesit-sentence-type-regexp' for more information.") (setq-local treesit-defun-name-function #'js--treesit-defun-name) (setq-local treesit-sentence-type-regexp - (regexp-opt typescript-ts-mode--sentence-type-regexp)) + (regexp-opt typescript-ts-mode--sentence-nodes)) ;; Imenu (same as in `js-ts-mode'). (setq-local treesit-simple-imenu-settings @@ -432,7 +432,7 @@ See `treesit-sentence-type-regexp' for more information.") ;; Navigation (setq-local treesit-sentence-type-regexp (regexp-opt (append - typescript-ts-mode--sentence-type-regexp + typescript-ts-mode--sentence-nodes '("jsx_element" "jsx_self_closing_element")))) -- 2.39.5