Improvements for LSP mode

This commit is contained in:
Wojciech Kozlowski 2021-08-23 23:45:51 +02:00
parent 86a951effa
commit 79719eeb2b
4 changed files with 26 additions and 16 deletions

View File

@ -153,7 +153,13 @@
(add-hook 'minibuffer-setup-hook (lambda () (setq gc-cons-threshold most-positive-fixnum)))
(add-hook 'minibuffer-exit-hook (lambda () (setq gc-cons-threshold 800000)))
(add-hook 'minibuffer-exit-hook (lambda () (setq gc-cons-threshold 100000000)))
;; -----------------------------------------------------------------------------------------------
;; Increase the amount of data which Emacs reads from the process.
;; -----------------------------------------------------------------------------------------------
(setq read-process-output-max (* 1024 1024)) ;; 1 MB
;; -----------------------------------------------------------------------------------------------
;; Additional key-bindings.

View File

@ -134,7 +134,9 @@
;; -----------------------------------------------------------------------------------------------
(use-package helm-lsp
:after (helm lsp-mode))
:after (helm lsp-mode)
:config
(define-key lsp-mode-map [remap xref-find-apropos] #'helm-lsp-workspace-symbol))
;; ---------------------------------------------------------------------------------------------
;; `helm-projectile'

View File

@ -34,8 +34,9 @@
;; Protobuf
protobuf-mode
;; Python
pyvenv
cython-mode
lsp-pyright
pyvenv
py-autopep8
;; Rust
cargo
@ -159,9 +160,14 @@
(make-local-variable 'lsp-enable-snippet)
(setq lsp-enable-snippet nil))
:hook
(python-mode . lsp)
(python-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))
(python-mode . x-lsp-disable-snippet))
(use-package lsp-pyright
:defer t)
(use-package py-autopep8
;; Note that this package require autopep8 to be installed.
:bind (("C-c C-f" . py-autopep8-buffer)))

View File

@ -179,12 +179,12 @@
("C-p" . company-select-previous))
:config
(setq company-idle-delay 0
company-minimum-prefix-length 3
company-minimum-prefix-length 1
company-tooltip-align-annotations t)
;; For this to correctly complete headers, need to add all include paths to
;; `company-c-headers-path-system'.
(add-to-list 'company-backends 'company-c-headers)
(setq company-backends (delete 'company-clang company-backends))
;; (setq company-backends (delete 'company-clang company-backends))
(setq company-backends (delete 'company-dabbrev company-backends))
(setq company-backends (delete 'company-capf company-backends)))
@ -294,21 +294,17 @@
:commands lsp
:init
(setq lsp-diagnostics-provider :flycheck
lsp-signature-auto-activate t
lsp-signature-doc-lines 1
lsp-enable-indentation nil
lsp-file-watch-threshold 10000))
lsp-file-watch-threshold 25000)
:hook ((lsp-mode . lsp-enable-which-key-integration)))
(use-package lsp-ui
:commands lsp-ui-mode
:init
(setq lsp-ui-doc-enable nil
lsp-ui-sideline-enable nil)
:bind
(("M-#" . lsp-ui-doc-focus-frame))
:config
(define-key lsp-ui-mode-map
[remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
(define-key lsp-ui-mode-map
[remap xref-find-references] #'lsp-ui-peek-find-references))
(define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references))
;; -----------------------------------------------------------------------------------------------
;; `semantic'