feat(tree-sitter): support typescript-tsx-mode
This commit is contained in:
parent
e3b5798a58
commit
e9f98001c1
1 changed files with 12 additions and 1 deletions
|
@ -127,7 +127,17 @@
|
|||
(define-derived-mode typescript-tsx-mode web-mode "TypeScript-TSX")
|
||||
(when (featurep! +lsp)
|
||||
(after! lsp-mode
|
||||
(add-to-list 'lsp--formatting-indent-alist '(typescript-tsx-mode . typescript-indent-level)))))
|
||||
(add-to-list 'lsp--formatting-indent-alist '(typescript-tsx-mode . typescript-indent-level))))
|
||||
(when (featurep! +tree-sitter)
|
||||
(after! tree-sitter
|
||||
(pushnew! tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))
|
||||
(pushnew! evil-textobj-tree-sitter-major-mode-language-alist '(typescript-tsx-mode . "tsx"))
|
||||
|
||||
;; HACK: the tsx grammer doesn't work with the hightlighting provided by
|
||||
;; font-lock-keywords.
|
||||
;; https://github.com/emacs-tree-sitter/tree-sitter-langs/issues/23
|
||||
(setq-hook! 'typescript-tsx-mode-hook
|
||||
tree-sitter-hl-use-font-lock-keywords nil))))
|
||||
|
||||
(set-docsets! '(typescript-mode typescript-tsx-mode)
|
||||
:add "TypeScript" "AngularTS")
|
||||
|
@ -319,6 +329,7 @@ to tide."
|
|||
js2-mode-hook
|
||||
js3-mode-hook
|
||||
typescript-mode-hook
|
||||
typescript-tsx-mode-hook
|
||||
rjsx-mode)
|
||||
#'turn-on-tree-sitter-mode
|
||||
#'+tree-sitter-keys-mode))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue