File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3665,6 +3665,11 @@ in that particular folder."
3665
3665
(add-hook 'xref-backend-functions #'lsp--xref-backend nil t))
3666
3666
3667
3667
(lsp-configure-buffer)
3668
+
3669
+ ;; make sure we turn off lsp-mode in case major mode changes, because major
3670
+ ;; mode change will wipe the buffer locals.
3671
+ (add-hook 'change-major-mode-hook #'lsp-disconnect nil t)
3672
+
3668
3673
(let ((buffer (lsp-current-buffer)))
3669
3674
(run-with-idle-timer
3670
3675
0.0 nil
@@ -3699,7 +3704,8 @@ in that particular folder."
3699
3704
(lsp--remove-overlays 'lsp-highlight)
3700
3705
(lsp--remove-overlays 'lsp-links)
3701
3706
3702
- (remove-hook 'xref-backend-functions #'lsp--xref-backend t))))
3707
+ (remove-hook 'xref-backend-functions #'lsp--xref-backend t)
3708
+ (remove-hook 'change-major-mode-hook #'lsp-disconnect t))))
3703
3709
3704
3710
(defun lsp-configure-buffer ()
3705
3711
"Configure LSP features for current buffer."
You can’t perform that action at this time.
0 commit comments