Skip to content

Setting pylsp.plugins.jedi.environment dynamically in workspace function failing #1030

Answered by aricodes-oss
aricodes-oss asked this question in Q&A
Discussion options

You must be logged in to vote

Solved by @joaotavora in the comments section here! #1030 (reply in thread)

I'm reposting the solution here so that Github will show it as the top accepted answer.

(setq-default eglot-workspace-configuration
  (lambda (&rest args)
    (let ((venv-directory (locate-venv default-directory)))
      (message "Located venv: %s" venv-directory)
      `((:pylsp .
          (:plugins
            (:jedi_completion (:fuzzy t)
             :jedi (:environment ,venv-directory)
             :pydocstyle (:enabled nil)
             :pycodestyle (:enabled nil)
             :mccabe (:enabled nil)
             :pyflakes (:enabled nil)
             :flake8 (:enabled t)
             :black (:enabled t))))))))

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@aricodes-oss
Comment options

@joaotavora
Comment options

@aricodes-oss
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by aricodes-oss
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants