Skip to content

Commit

Permalink
Fix #48 return nil when eglot is using a network process
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho committed Nov 27, 2024
1 parent 9d0d1b9 commit 444b5eb
Showing 1 changed file with 49 additions and 48 deletions.
97 changes: 49 additions & 48 deletions pet.el
Original file line number Diff line number Diff line change
Expand Up @@ -803,54 +803,55 @@ FN is `eglot--executable-find', ARGS is the arguments to
"Return LSP initializationOptions for Eglot.
COMMAND is the name of the Python language server command."
(cond ((string-match-p "pylsp" command)
`(:pylsp
(:plugins
(:jedi
(:environment
,(pet-virtualenv-root))
:ruff
(:executable
,(pet-executable-find "ruff"))
:pylsp_mypy
(:overrides
["--python-executable" ,(pet-executable-find "python") t])
:flake8
(:executable
,(pet-executable-find "flake8"))
:pylint
(:executable
,(pet-executable-find "pylint"))))))
((string-match-p "pyls" command)
`(:pyls
(:plugins
(:jedi
(:environment
,(pet-virtualenv-root))
:pylint
(:executable
,(pet-executable-find "pylint"))))))
((string-match-p "pyright-langserver" command)
`(:python
(:pythonPath
,(pet-executable-find "python")
:venvPath
,(pet-virtualenv-root))))
((string-match-p "jedi-language-server" command)
`(:jedi
(:executable
(:command
,(pet-executable-find "jedi-language-server"))
:workspace
(:environmentPath
,(pet-executable-find "python")))))
((string-match-p "ruff-lsp" command)
`(:settings
(:interpreter
,(pet-executable-find "python")
:path
,(pet-executable-find "ruff"))))
(t nil)))
(pcase command
((rx "pylsp")
`(:pylsp
(:plugins
(:jedi
(:environment
,(pet-virtualenv-root))
:ruff
(:executable
,(pet-executable-find "ruff"))
:pylsp_mypy
(:overrides
["--python-executable" ,(pet-executable-find "python") t])
:flake8
(:executable
,(pet-executable-find "flake8"))
:pylint
(:executable
,(pet-executable-find "pylint"))))))
((rx "pyls")
`(:pyls
(:plugins
(:jedi
(:environment
,(pet-virtualenv-root))
:pylint
(:executable
,(pet-executable-find "pylint"))))))
((rx "pyright-langserver")
`(:python
(:pythonPath
,(pet-executable-find "python")
:venvPath
,(pet-virtualenv-root))))
((rx "jedi-language-server")
`(:jedi
(:executable
(:command
,(pet-executable-find "jedi-language-server"))
:workspace
(:environmentPath
,(pet-executable-find "python")))))
((rx "ruff-lsp")
`(:settings
(:interpreter
,(pet-executable-find "python")
:path
,(pet-executable-find "ruff"))))
(t nil)))

(defalias 'pet--proper-list-p 'proper-list-p)
(eval-when-compile
Expand Down

0 comments on commit 444b5eb

Please sign in to comment.