1

Add TypeScript mode

This commit is contained in:
Jessie Hildebrandt 2020-10-17 18:12:33 -04:00
parent 77f47cbcdb
commit 83bd4881fc

15
init.el
View File

@ -445,8 +445,7 @@
;; Load Web Mode ;; Load Web Mode
;; (Associated files: .php, .html) ;; (Associated files: .php, .html)
;; (In js-mode: .ts) ;; (In js-jsx-mode: .jsx)
;; (In js-jsx-mode: .jsx, .tsx)
(use-package web-mode (use-package web-mode
:custom :custom
(web-mode-markup-indent-offset 2) (web-mode-markup-indent-offset 2)
@ -454,8 +453,13 @@
:mode :mode
(("\\.php\\'" . web-mode) (("\\.php\\'" . web-mode)
("\\.html\\'" . web-mode) ("\\.html\\'" . web-mode)
("\\.ts\\'" . js-mode) ("\\.jsx\\'" . js-jsx-mode)))
("\\.[jt]sx\\'" . js-jsx-mode)))
;; Load TypeScript mode
;; (Associated files: .ts, .tsx)
(use-package typescript-mode
:mode
(("\\.tsx?\\'" . typescript-mode)))
;; Load JSON Mode ;; Load JSON Mode
;; (Associated files: .json) ;; (Associated files: .json)
@ -505,11 +509,12 @@
;;==================== ;;====================
;; Load LSP Mode ;; Load LSP Mode
;; Associated languages: HTML, JavaScript, JSON, GDScript, Rust ;; Associated languages: HTML, JavaScript, TypeScript, CSS, JSON, GDScript, Rust
(use-package lsp-mode (use-package lsp-mode
:hook :hook
(web-mode . lsp-deferred) (web-mode . lsp-deferred)
(js-mode . lsp-deferred) (js-mode . lsp-deferred)
(typescript-mode . lsp-deferred)
(css-mode . lsp-deferred) (css-mode . lsp-deferred)
(json-mode . lsp-deferred) (json-mode . lsp-deferred)
(gdscript-mode . lsp-deferred) (gdscript-mode . lsp-deferred)