Skip to content

Commit

Permalink
remove eglot support
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho committed Aug 30, 2023
1 parent 4909015 commit 8d06043
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions pet.el
Original file line number Diff line number Diff line change
Expand Up @@ -711,35 +711,6 @@ default otherwise."



;;;###autoload
(defun pet-eglot-setup ()
"Setup all `eglot' Python language server configuration."
(with-eval-after-load 'eglot
(declare-function eglot-alternatives 'eglot)
(setq-local eglot-server-programs
(cons
`((python-mode python-ts-mode)
. ,(eglot-alternatives
(mapcar
(lambda (server)
(if (string-suffix-p "pyright-langserver" server)
`(,server "--stdio")
server))
(mapcar (lambda (server)
(pet-executable-find server))
'("pylsp"
"pyls"
"pyright"
"jedi-language-server")))))
eglot-server-programs))))

;;;###autoload
(defun pet-eglot-teardown ()
"Reset all `eglot' Python language server configuration to default."
(kill-local-variable 'eglot-server-programs))



(defvar lsp-jedi-executable-command)
(defvar lsp-pyls-plugins-jedi-environment)
(defvar lsp-pylsp-plugins-jedi-environment)
Expand All @@ -761,7 +732,6 @@ buffer local values."
(setq-local python-shell-virtualenv-root (pet-virtualenv-root))

(pet-flycheck-setup)
(pet-eglot-setup)

(setq-local lsp-jedi-executable-command
(pet-executable-find "jedi-language-server"))
Expand All @@ -783,7 +753,6 @@ buffer local values."
(kill-local-variable 'python-shell-virtualenv-root)

(pet-flycheck-teardown)
(pet-eglot-teardown)

(kill-local-variable 'lsp-jedi-executable-command)
(kill-local-variable 'lsp-pyls-plugins-jedi-environment)
Expand Down Expand Up @@ -846,19 +815,6 @@ has assigned to."
(insert (format "%s" value))
(insert "\n"))
kvp)
(insert (propertize (format "%-40s" (concat (symbol-name 'eglot-server-programs) " (Python part only):"))
'face 'font-lock-variable-name-face) "\n")
(if (null (featurep 'eglot))
(insert "(not available because eglot is not loaded now)\n")
(defvar eglot-server-programs)
(let* ((matcher (lambda (modes mode)
(apply #'provided-mode-derived-p
mode
(if (consp modes) modes (list modes)))))
(matched (alist-get 'python-mode eglot-server-programs
nil nil matcher))
(langservers (funcall matched)))
(mapc (lambda (langserver) (insert (abbreviate-file-name (format "%s" langserver)) "\n")) langservers)))
(insert (propertize (format "%-40s" (concat (symbol-name 'exec-path) ":")) 'face 'font-lock-variable-name-face) "\n")
(mapc (lambda (dir) (insert (abbreviate-file-name (format "%s" dir)) "\n")) exec-path)
(special-mode))))
Expand Down

0 comments on commit 8d06043

Please sign in to comment.