From dc8a0287420ed56cf807552628d3aa173073f805 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Thu, 22 Jul 2021 20:26:49 +0200 Subject: [PATCH] Use pyright as language server when `lsp-pyright` is available Also ignore the .cache directory, as that's the one `lsp-pyright' is installing it's local copy of `pyright` into. --- .gitignore | 1 + init.el | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 0d95466..13ee5cf 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ /flycheck_init.el /projects /.lsp-session-v1 +/.cache/ diff --git a/init.el b/init.el index 1def795..51ff0bb 100644 --- a/init.el +++ b/init.el @@ -3020,6 +3020,9 @@ With given ARG, display files in `db/important-document-path’." (use-package python :config (progn + (unless (require 'lsp-pyright nil :no-error) + (message "`lsp-pyright' not available, using defaults from `lsp'")) + (add-hook 'python-mode-hook #'highlight-indentation-mode) (add-hook 'python-mode-hook #'company-mode) (add-hook 'python-mode-hook #'lsp)))