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:
parent
ec67a6fb2b
commit
8746da61c3
1 changed files with 4 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue