General refactor & cleanup

This commit is contained in:
Henrik Lissner 2017-06-19 00:30:41 +02:00
parent bc3aee2a4f
commit 392c58ea47
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
10 changed files with 51 additions and 46 deletions

View file

@ -17,15 +17,6 @@
;; '(tide-documentation-at-point "current type documentation")
;; '(tide-restart-server "restart tide server"))
(defun +typescript|tide-setup ()
(when (or (eq major-mode 'typescript-mode)
(and (eq major-mode 'web-mode)
buffer-file-name
(string= (file-name-extension buffer-file-name) "tsx")))
(tide-setup)
(flycheck-mode +1)
(eldoc-mode +1)))
(add-hook! (typescript-mode web-mode) #'+typescript|tide-setup)
(map! :localleader
:m "fh" #'tide-documentation-at-point))
@ -43,5 +34,15 @@
'(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t
:placeOpenBraceOnNewLineForFunctions nil))
(defun +typescript|init-tide ()
(when (or (eq major-mode 'typescript-mode)
(and (eq major-mode 'web-mode)
buffer-file-name
(equal (file-name-extension buffer-file-name) "tsx")))
(tide-setup)
(flycheck-mode +1)
(eldoc-mode +1)))
(add-hook! (typescript-mode web-mode) #'+typescript|init-tide)
(advice-add #'tide-project-root :override #'doom*project-root))