diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 40e3008..474c4db 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -27,11 +27,16 @@ (require 'lsp-mode) +(global-flycheck-mode 1) +(with-eval-after-load 'flycheck + (add-hook 'flycheck-mode-hook #'flycheck-pycheckers-setup) + ) + (add-to-list 'lsp-language-id-configuration '(po-mode . "gettext")) (lsp-register-client (make-lsp-client - :new-connection (lsp-stdio-connection "po-langage-server") + :new-connection (lsp-stdio-connection "po-language-server") :activation-fn (lsp-activate-on "gettext" "plaintext") :priority -1 :server-id 'po @@ -164,14 +169,18 @@ (add-hook 'python-mode-hook 'blacken-mode) (add-hook 'python-mode-hook #'lsp) +(defvar-local lsp-jedi-pylsp-extra-paths []) + (use-package lsp-ui) +(defvar-local jedi-config "/home/mdk/.emacs.d/jedi.json") (use-package lsp-jedi :ensure t :config - (with-eval-after-load "lsp-mode" - (add-to-list 'lsp-disabled-clients 'pyls) + (with-eval-after-load "lsp-mode" + (add-to-list 'lsp-disabled-clients 'pyls) )) + (add-hook 'php-mode-hook '(lambda () (auto-complete-mode t) (require 'ac-php) @@ -215,8 +224,10 @@ '(c-basic-offset 4) '(frame-background-mode 'dark) '(lsp-ui-sideline-show-code-actions nil) + '(lsp-ui-sideline-show-diagnostics nil) ;; See https://github.com/emacs-lsp/lsp-ui/issues/304 + '(lsp-ui-sideline-show-hover nil) '(package-selected-packages - '(company yasnippet-snippets lsp-ui use-package lsp-jedi lsp-mode zenburn-theme markdown-mode org po-mode blacken yaml-mode))) + '(flycheck-pycheckers company yasnippet-snippets use-package lsp-jedi lsp-mode zenburn-theme markdown-mode org po-mode blacken yaml-mode))) (load-theme 'zenburn t) (set-face-attribute 'lsp-face-highlight-textual nil @@ -228,3 +239,17 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) + + +(defvar-local my/flycheck-local-cache nil) + +(defun my/flycheck-checker-get (fn checker property) + (or (alist-get property (alist-get checker my/flycheck-local-cache)) + (funcall fn checker property))) + +(advice-add 'flycheck-checker-get :around 'my/flycheck-checker-get) + +(add-hook 'lsp-managed-mode-hook + (lambda () + (when (derived-mode-p 'python-mode) + (setq my/flycheck-local-cache '((lsp . ((next-checkers . (python-flake8)))))))))