File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 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."
36653665 (add-hook 'xref-backend-functions #'lsp--xref-backend nil t ))
36663666
36673667 (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+
36683673 (let ((buffer (lsp-current-buffer)))
36693674 (run-with-idle-timer
36703675 0.0 nil
@@ -3699,7 +3704,8 @@ in that particular folder."
36993704 (lsp--remove-overlays 'lsp-highlight )
37003705 (lsp--remove-overlays 'lsp-links )
37013706
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 ))))
37033709
37043710(defun lsp-configure-buffer ()
37053711 " Configure LSP features for current buffer."
You can’t perform that action at this time.
0 commit comments