0

In order to have lsp-pyright load after pipenv I need pyright to load after direnv. However, appending after: direnv results in an error[0]

How can I have pyright starting the workspace after direnv? Currently I M-x lsp-workspace-restart after opening any python file (direnv loads pipenv automatically)

dotspacemacs-configuration-layers
'(
 (python :variables
         python-backend 'lsp
         python-lsp-server 'pyright
         python-test-runner 'pytest
         python-enable-yapf-format-on-save t
         after: direnv
         )
        )
  (use-package direnv
    :demand t
    :config
    (direnv-mode)
    (setq direnv-always-show-summary nil)
    :hook
    ((prog-mode) . direnv-update-environment))

[0] An error occurred while setting layer variable after: (error: (void-variable direnv)). Be sure to quote the value if needed.

2
  • Are you enabling direnv-mode on startup Emacs? Commented Mar 18, 2022 at 12:54
  • @TianshuWang Yes, added init.el excerpt Commented Mar 19, 2022 at 8:31

1 Answer 1

0

try to direnv-update-environment before lsp-initialize

(use-package direnv
  :demand t
  :hook
  ((after-init . direnv-mode)
   (lsp-before-initialize-hook . direnv-update-environment))
  :config
  (setq direnv-always-show-summary nil))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.