diff options
| author | Kai Ma | 2022-12-04 06:15:42 +0800 |
|---|---|---|
| committer | Yuan Fu | 2022-12-13 18:05:48 -0800 |
| commit | fafcf02c856ef8fd712ff75e8999dfb0f6d97f07 (patch) | |
| tree | e8b4dd4f38f96f66586e53d9da905225b77b738b | |
| parent | 91b8d9b7db47f242cf33f0e99d787c235d761d4b (diff) | |
| download | emacs-fafcf02c856ef8fd712ff75e8999dfb0f6d97f07.tar.gz emacs-fafcf02c856ef8fd712ff75e8999dfb0f6d97f07.zip | |
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
| -rw-r--r-- | lisp/progmodes/js.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 1de0f3442f0..02990813ef4 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -686,7 +686,7 @@ This variable is like `sgml-attribute-offset'." | |||
| 686 | (modify-syntax-entry ?$ "_" table) | 686 | (modify-syntax-entry ?$ "_" table) |
| 687 | (modify-syntax-entry ?` "\"" table) | 687 | (modify-syntax-entry ?` "\"" table) |
| 688 | table) | 688 | table) |
| 689 | "Syntax table for `js-mode'.") | 689 | "Syntax table for `js-mode' and `js-ts-mode'.") |
| 690 | 690 | ||
| 691 | (defvar-local js--quick-match-re nil | 691 | (defvar-local js--quick-match-re nil |
| 692 | "Autogenerated regexp used by `js-mode' to match buffer constructs.") | 692 | "Autogenerated regexp used by `js-mode' to match buffer constructs.") |
| @@ -3843,6 +3843,7 @@ Currently there are `js-mode' and `js-ts-mode'." | |||
| 3843 | 3843 | ||
| 3844 | \\<js-ts-mode-map>" | 3844 | \\<js-ts-mode-map>" |
| 3845 | :group 'js | 3845 | :group 'js |
| 3846 | :syntax-table js-mode-syntax-table | ||
| 3846 | (when (treesit-ready-p 'javascript) | 3847 | (when (treesit-ready-p 'javascript) |
| 3847 | ;; Borrowed from `js-mode'. | 3848 | ;; Borrowed from `js-mode'. |
| 3848 | (setq-local prettify-symbols-alist js--prettify-symbols-alist) | 3849 | (setq-local prettify-symbols-alist js--prettify-symbols-alist) |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0e0898ffe28..ee05862550d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -6619,6 +6619,7 @@ implementations: `python-mode' and `python-ts-mode'." | |||
| 6619 | "Major mode for editing Python files, using tree-sitter library. | 6619 | "Major mode for editing Python files, using tree-sitter library. |
| 6620 | 6620 | ||
| 6621 | \\{python-ts-mode-map}" | 6621 | \\{python-ts-mode-map}" |
| 6622 | :syntax-table python-mode-syntax-table | ||
| 6622 | (when (treesit-ready-p 'python) | 6623 | (when (treesit-ready-p 'python) |
| 6623 | (treesit-parser-create 'python) | 6624 | (treesit-parser-create 'python) |
| 6624 | (setq-local treesit-font-lock-feature-list | 6625 | (setq-local treesit-font-lock-feature-list |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e170d18afeb..76e8d5b0748 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1611,6 +1611,7 @@ with your script for an edit-interpret-debug cycle." | |||
| 1611 | "Major mode for editing Bash shell scripts. | 1611 | "Major mode for editing Bash shell scripts. |
| 1612 | This mode automatically falls back to `sh-mode' if the buffer is | 1612 | This mode automatically falls back to `sh-mode' if the buffer is |
| 1613 | not written in Bash or sh." | 1613 | not written in Bash or sh." |
| 1614 | :syntax-table sh-mode-syntax-table | ||
| 1614 | (when (treesit-ready-p 'bash) | 1615 | (when (treesit-ready-p 'bash) |
| 1615 | (setq-local treesit-font-lock-feature-list | 1616 | (setq-local treesit-font-lock-feature-list |
| 1616 | '(( comment function) | 1617 | '(( comment function) |