diff options
author | Juri Linkov <juri@linkov.net> | 2025-03-03 20:38:40 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2025-03-03 20:38:40 +0200 |
commit | dbc0e5a52d855773a495e0ca89b738f8f2246df9 (patch) | |
tree | 54fd0d304e1e4ca470d1c17d7a6c375e8e4c0a1a /lisp/emacs-lisp/regexp-opt.el | |
parent | 10abb87f0519b3d53d6b7078703d3a0120e3aaa8 (diff) | |
download | emacs-dbc0e5a52d855773a495e0ca89b738f8f2246df9.tar.gz emacs-dbc0e5a52d855773a495e0ca89b738f8f2246df9.tar.bz2 emacs-dbc0e5a52d855773a495e0ca89b738f8f2246df9.zip |
Improve treesit settings for js-ts-mode (bug#73404)
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Add 'class' alongside 'class_declaration'.
(js--treesit-defun-name): Add "variable_declaration"
alongside "lexical_declaration".
(js--treesit-valid-imenu-entry): Add "variable_declaration"
and provide the predicate to 'treesit-node-top-level'.
(js--treesit-sentence-nodes): Add "jsx_attribute" like in html-ts-mode
instead of jsx elements matched in 'js--treesit-list-nodes'.
(js--treesit-list-nodes): Add "jsx_element" and "jsx_self_closing_element"
instead of "_jsx_string".
(js--treesit-simple-imenu-settings): Move "method_definition" to separate
section "Method" from the "Class" section. Add "variable_declaration"
to the "Variable" section.
(js-ts-mode--outline-predicate): New variable.
(js--treesit-defun-type-regexp): Add bos/eos.
(js--treesit-jsdoc-comment-regexp): Add bos/eos.
(js-ts-mode): Set treesit-outline-predicate to
'js-ts-mode--outline-predicate'.
* lisp/textmodes/mhtml-ts-mode.el (mhtml-ts-mode--html-defun-name):
Remove unused function.
(mhtml-ts-mode): Use 'js-ts-mode--outline-predicate' in
'treesit-aggregated-outline-predicate'.
* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--outline-predicate):
Use 'treesit-node-top-level' instead of 'treesit-parent-until'.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
0 files changed, 0 insertions, 0 deletions