summaryrefslogtreecommitdiffstats
path: root/lisp/ravi-init-lsp.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ravi-init-lsp.el')
-rw-r--r--lisp/ravi-init-lsp.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/ravi-init-lsp.el b/lisp/ravi-init-lsp.el
index dc41f98..2bf105a 100644
--- a/lisp/ravi-init-lsp.el
+++ b/lisp/ravi-init-lsp.el
@@ -30,9 +30,12 @@
(use-package lsp-mode
:init
(setq lsp-keymap-prefix "H-l")
- :hook ((c-mode-hook . lsp-deferred)
- (c++-mode-hook . lsp-deferred)
- ;; (python-mode . lsp-deferred)
+ (defun ravi/add-lsp-with-local-variables ()
+ ;; The t at the end is to make hack-local-variables-hook buffer-local
+ (add-hook 'hack-local-variables-hook 'lsp-deferred 0 t))
+ :hook ((c-mode-hook . ravi/add-lsp-with-local-variables)
+ (c++-mode-hook . ravi/add-lsp-with-local-variables)
+ ;; (python-mode . ravi/add-lsp-with-local-variables)
(lsp-mode-hook . lsp-enable-which-key-integration))
:commands (lsp lsp-deferred)
:bind (:map lsp-mode-map