mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(javascript): incorrect lsp formatting for tsx
lsp-mode doesn't detect the correct indentation, since it treats the derived tsx-mode as a web-mode. This change modifies the lsp-mode internal alist to recognize tsx-mode correctly. Ideally lsp-mode would have a better way to modify its known mode lists but I couldn't see it. Ref: emacs-lsp/lsp-mode#3308
This commit is contained in:
@ -122,7 +122,10 @@
|
||||
'jsx-tide)))))
|
||||
:config
|
||||
(when (fboundp 'web-mode)
|
||||
(define-derived-mode typescript-tsx-mode web-mode "TypeScript-TSX"))
|
||||
(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)))))
|
||||
|
||||
(set-docsets! '(typescript-mode typescript-tsx-mode)
|
||||
:add "TypeScript" "AngularTS")
|
||||
|
Reference in New Issue
Block a user