From 8429f163b2f694655f75da8cdcd1640da0c8cd07 Mon Sep 17 00:00:00 2001 From: soblin Date: Mon, 11 May 2026 12:20:33 +0900 Subject: [PATCH] check for pyright Signed-off-by: soblin --- .emacs.d/init.el | 1 + .emacs.d/modes/99_python.el | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .emacs.d/modes/99_python.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 7c14b6e..76b1663 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -31,6 +31,7 @@ (require '99_yaml) (require '99_docker) (require '99_c_cpp) +(require '99_python) (setq custom-file (expand-file-name "emacs-custom.el" user-emacs-directory)) (load-file (expand-file-name "emacs-custom.el" user-emacs-directory)) diff --git a/.emacs.d/modes/99_python.el b/.emacs.d/modes/99_python.el new file mode 100644 index 0000000..125688c --- /dev/null +++ b/.emacs.d/modes/99_python.el @@ -0,0 +1,28 @@ +;;; 99_python.el --- -*- lexical-binding: t; -*- + +;;; Commentary: + +;;; Code: + +;;; Emacsをvenv内から立ち上げる方針が楽 + +;; ruff serverは微妙 +;; textDocument/definitionがサポートされておらず,ruff-lspを起動するよう上書きをしてもエラーが出た +;; (with-eval-after-load 'lsp-ruff +;; (setq lsp-ruff-server-command '("ruff-lsp"))) +;; pyrightを入れるのが楽 +(use-package lsp-mode + :hook (python-mode . lsp) + :config + ) + +(use-package lsp-pyright + :if (executable-find "pyright") + :hook (python-mode . (lambda () + (require 'lsp-pyright) + (lsp)))) + +;; docker連携はTODO + +(provide '99_python) +;;; 99_python.el ends here