Skip to content

settings: Add venvDir setting#47

Open
malthejorgensen wants to merge 2 commits intosublimelsp:mainfrom
malthejorgensen:add-venvdir-setting
Open

settings: Add venvDir setting#47
malthejorgensen wants to merge 2 commits intosublimelsp:mainfrom
malthejorgensen:add-venvdir-setting

Conversation

@malthejorgensen
Copy link
Copy Markdown

Unclear if this is helpful to anyone but me.

This setting allows specifying where the virtual environment (venv) can be found.

The issue that this solves for me is that I use the following project structure:

<project_root>/example.sublime-project
<project_root>/backend/.venv <-- Python virtual env that I care about
<project_root>/frontend/
<all the rest of the files...>

Using this new venvDir setting, I can set venvDir: "backend/.venv in example.sublime-project and now LSP-ty will detect my Python dependencies correctly when I'm opening files in this project.

Comment thread LSP-ty.sublime-settings
Comment on lines +16 to +18
// Path to a virtual environment directory. Can be absolute or relative to the workspace folder.
// When set, the Python interpreter from this venv is passed to the ty server.
"ty.venvDir": "",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really worth adding new setting which is just a proxy for a setting that can be set already? One can just set env.VIRTUAL_ENV directly.

Also the logic seems to be specific to one particular venv system and disregards other ones.

Probably better to just have a env section in default settings with commented out and documented VIRTUAL_ENV env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants