[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Eglot, project.el, and python virtual environments
From: |
Stephen Leake |
Subject: |
Re: Eglot, project.el, and python virtual environments |
Date: |
Sat, 19 Nov 2022 14:36:20 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> Basic project structure
> looks like:
>
> project_root
> ├── .git
> ├── src
> │ └── python
> │ ├── VeryImportantLambda
> │ │ └── .venv
> │ ├── MoreImportance
> │ │ └── .venv
> │ ├── RunInCaseOfEmergency
> │ │ └── .venv
>
>
> Now I'm trying to move to Eglot, and there is tighter integration
> between Eglot and project.el. Turning on Eglot in one lambda starts the
> server for all Python libraries in the whole project, not just the
> current environment. I looked into constructing my own version of the
> call to `eglot', but it is tightly tied to a project, all the way down.
>
> Is anyone else handling this situation? Any suggestions how to make it
> work?
Declare a project.el project for each directory that has a .venv.
I'm guessing you are currently using vc-project, so there is only one,
rooted where the .git directory is.
You do this by writing your own function for project-find-functions;
something like:
(defun my-projects (dir)
(list 'transient (locate-dominating-file ".venv")))
(add-to-list 'project-find-functions #'my-projects)
You might have to delete vc projects from project-find-functions, or
make it buffer-local; there are lots of choices.
--
-- Stephe
- Re: Eglot, project.el, and python virtual environments, (continued)
- Re: Eglot, project.el, and python virtual environments, Dmitry Gutov, 2022/11/18
- Re: Eglot, project.el, and python virtual environments, João Távora, 2022/11/18
- Re: Eglot, project.el, and python virtual environments, Dmitry Gutov, 2022/11/19
- Re: Eglot, project.el, and python virtual environments, Danny Freeman, 2022/11/19
- Re: Eglot, project.el, and python virtual environments, Dmitry Gutov, 2022/11/19
- Re: Eglot, project.el, and python virtual environments, Danny Freeman, 2022/11/19
Re: Eglot, project.el, and python virtual environments, Philip Kaludercic, 2022/11/16
Re: Eglot, project.el, and python virtual environments, North Year, 2022/11/17
Re: Eglot, project.el, and python virtual environments,
Stephen Leake <=