settings: Add venvDir setting#47
Open
malthejorgensen wants to merge 2 commits intosublimelsp:mainfrom
Open
Conversation
This setting allows specifying where the venv can be found.
rchl
reviewed
Mar 31, 2026
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": "", |
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Using this new
venvDirsetting, I can setvenvDir: "backend/.venvinexample.sublime-projectand nowLSP-tywill detect my Python dependencies correctly when I'm opening files in this project.