mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-04 11:00:45 -08:00
Fix syntax tables of tree-sitter modes (bug#59807)
Tree-sitter modes should use the same syntax table as the non-tree-sitter ones. * lisp/progmodes/js.el (js-mode-syntax-table) (js-ts-mode) * lisp/progmodes/python.el (python-ts-mode) * lisp/progmodes/sh-script.el (bash-ts-mode) Copyright-paperwork-exempt: yes xx
This commit is contained in:
parent
91b8d9b7db
commit
fafcf02c85
3 changed files with 4 additions and 1 deletions
|
|
@ -686,7 +686,7 @@ This variable is like `sgml-attribute-offset'."
|
||||||
(modify-syntax-entry ?$ "_" table)
|
(modify-syntax-entry ?$ "_" table)
|
||||||
(modify-syntax-entry ?` "\"" table)
|
(modify-syntax-entry ?` "\"" table)
|
||||||
table)
|
table)
|
||||||
"Syntax table for `js-mode'.")
|
"Syntax table for `js-mode' and `js-ts-mode'.")
|
||||||
|
|
||||||
(defvar-local js--quick-match-re nil
|
(defvar-local js--quick-match-re nil
|
||||||
"Autogenerated regexp used by `js-mode' to match buffer constructs.")
|
"Autogenerated regexp used by `js-mode' to match buffer constructs.")
|
||||||
|
|
@ -3843,6 +3843,7 @@ Currently there are `js-mode' and `js-ts-mode'."
|
||||||
|
|
||||||
\\<js-ts-mode-map>"
|
\\<js-ts-mode-map>"
|
||||||
:group 'js
|
:group 'js
|
||||||
|
:syntax-table js-mode-syntax-table
|
||||||
(when (treesit-ready-p 'javascript)
|
(when (treesit-ready-p 'javascript)
|
||||||
;; Borrowed from `js-mode'.
|
;; Borrowed from `js-mode'.
|
||||||
(setq-local prettify-symbols-alist js--prettify-symbols-alist)
|
(setq-local prettify-symbols-alist js--prettify-symbols-alist)
|
||||||
|
|
|
||||||
|
|
@ -6619,6 +6619,7 @@ implementations: `python-mode' and `python-ts-mode'."
|
||||||
"Major mode for editing Python files, using tree-sitter library.
|
"Major mode for editing Python files, using tree-sitter library.
|
||||||
|
|
||||||
\\{python-ts-mode-map}"
|
\\{python-ts-mode-map}"
|
||||||
|
:syntax-table python-mode-syntax-table
|
||||||
(when (treesit-ready-p 'python)
|
(when (treesit-ready-p 'python)
|
||||||
(treesit-parser-create 'python)
|
(treesit-parser-create 'python)
|
||||||
(setq-local treesit-font-lock-feature-list
|
(setq-local treesit-font-lock-feature-list
|
||||||
|
|
|
||||||
|
|
@ -1611,6 +1611,7 @@ with your script for an edit-interpret-debug cycle."
|
||||||
"Major mode for editing Bash shell scripts.
|
"Major mode for editing Bash shell scripts.
|
||||||
This mode automatically falls back to `sh-mode' if the buffer is
|
This mode automatically falls back to `sh-mode' if the buffer is
|
||||||
not written in Bash or sh."
|
not written in Bash or sh."
|
||||||
|
:syntax-table sh-mode-syntax-table
|
||||||
(when (treesit-ready-p 'bash)
|
(when (treesit-ready-p 'bash)
|
||||||
(setq-local treesit-font-lock-feature-list
|
(setq-local treesit-font-lock-feature-list
|
||||||
'(( comment function)
|
'(( comment function)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue