diff --git a/lsp-bridge.el b/lsp-bridge.el index 13a3157208..1b44e66654 100644 --- a/lsp-bridge.el +++ b/lsp-bridge.el @@ -2425,17 +2425,6 @@ Default is `bottom-right', you can choose other value: `top-left', `top-right', (add-hook 'post-command-hook #'lsp-bridge-start-process) - (when lsp-bridge-disable-electric-indent - ;; NOTE: - ;; Don't enable `electric-indent-mode' in lsp-bridge, `electric-indent-post-self-insert-function' - ;; - ;; It will try adjust line indentation *AFTER* user insert character, - ;; this additional indent action send excessive `change_file' request to lsp server. - ;; LSP server will confused those indent action and return wrong completion candidates. - ;; - ;; Example, when you enable `electric-indent-mode', when you type `std::', you will got wrong completion candidates from LSP server. - (electric-indent-local-mode -1)) - ;; Don't enable lsp-bridge when current buffer is acm buffer. (unless (or (equal (buffer-name (current-buffer)) acm-buffer) (equal (buffer-name (current-buffer)) acm-doc-buffer)) @@ -3054,20 +3043,6 @@ then BODY is executed within that buffer." (lsp-bridge-call-async "message_hostnames")) -(defcustom lsp-bridge-disable-electric-indent t - "`electric-indent-post-self-insert-function' will cause return wrong completion candidates from LSP server, such as type `std::' in C++. - -Please turn this option on if you want fix `std::' completion candidates, at same time, `electric-indent-mode' will disable by lsp-bridge. - -Please keep this option off if you need `electric-indent-mode' feature more. - -It's a bug of `electric-indent-mode' that it will try adjust line indentation *AFTER* user insert character, -this additional indent action send excessive `change_file' request to lsp server. -LSP server will confused those indent action and return wrong completion candidates. - -I haven't idea how to make lsp-bridge works with `electric-indent-mode', PR are welcome.") - - (defun lsp-bridge-sync-tramp-remote (force) (interactive) (let* ((file-name (lsp-bridge-get-buffer-file-name-text))