all repos — archive/dotfiles @ 07c32a38ef4e8e99afcd4cbc96cb47c28515539c

Superseded by nixfiles

Emacs: enable lsp in javascript-mode
Alan Pearce alan@alanpearce.eu
Wed, 03 Jul 2019 12:03:25 +0200
commit

07c32a38ef4e8e99afcd4cbc96cb47c28515539c

parent

9d9573982dd2d3c0fd24d87465802045794546d1

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -506,10 +506,14 @@ :custom ((flymake-error-bitmap '(left-vertical-bar compilation-error))            (flymake-warning-bitmap '(left-vertical-bar compilation-warning))))
 
 (use-package lsp-mode
-  :ghook ('typescript-mode-hook #'lsp)
+  :ghook ('(typescript-mode-hook
+            javascript-mode-hook)
+          #'lsp)
   :custom ((lsp-auto-guess-root t)
            (lsp-prefer-flymake t)
-           (lsp-enable-symbol-highlighting nil)))
+           (lsp-enable-symbol-highlighting nil))
+  :init (progn
+          (add-to-list 'lsp-language-id-configuration '(javascript-mode . "javascript"))))
 
 (use-package lsp-ui
   :after lsp-mode