summaryrefslogtreecommitdiff
path: root/lisp/web.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/web.el')
-rw-r--r--lisp/web.el23
1 files changed, 5 insertions, 18 deletions
diff --git a/lisp/web.el b/lisp/web.el
index b29d58f..655dd03 100644
--- a/lisp/web.el
+++ b/lisp/web.el
@@ -32,34 +32,21 @@
(setq js2-highlight-level 3)
(setq js2-idle-timer-delay 0.1)
-;; JS2-Refactor
-(use-package js2-refactor)
-(add-hook 'js2-mode-hook #'js2-refactor-mode)
-(defun js2-refactor-keybind-setup()
- "Set up the keybinds."
- (local-set-key [f2] 'js2r-rename-var)
-)
-(add-hook 'js2-mode-hook 'js2-refactor-keybind-setup)
-
-
;; Tide for refactoring
-(defun setup-tide-mode()
- (tide-setup)
- (local-set-key [f2] 'tide-rename-symbol)
- (tide-hl-identifier-mode +1)
+(defun setup-typescript()
(setq typescript-indent-level 2)
(company-mode t)
(company-quickhelp-mode t)
(smartparens-mode 1)
)
-(add-hook 'typescript-mode-hook #'setup-tide-mode)
+(add-hook 'typescript-mode-hook #'setup-typescript)
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
(add-hook 'web-mode-hook
(lambda ()
(when (string-equal "tsx" (file-name-extension buffer-file-name))
- (setup-tide-mode))))
+ (setup-typescript))))
;; enable typescript-tslint checker
(flycheck-add-mode 'typescript-tslint 'web-mode)
@@ -70,9 +57,9 @@
:ensure t
:defer 3
:hook
- ((js2-mode) . eglot-ensure))
+ ((js2-mode typescript-mode) . eglot-ensure))
:config
- (cl-pushnew '((js-mode typescript-mode typescriptreact-mode) . ("typescript-language-server" "--stdio"))
+ (cl-pushnew '((js-mode typescript-mode) . ("typescript-language-server" "--stdio"))
eglot-server-programs
:test #'equal)