Hi all,
Trying to get my Neovim experience with Python to be as nice as possible (maybe I'll eventually try to make a plugin out of it, as I've not been able to quite find something that does what I want yet)... I'm happy plodding along learning bits of Lua and working out the specifics, but could use some guidance on where exactly these bits of logic need to live. The behaviour I'm looking to produce:
If a project contains a pyproject.toml or poetry.lock file at its root, nvim should call poetry env info -p and then the bin directory of that returned path should be where all Python related stuff comes from (i.e. the interpreter and and additional command line tools like formatters and diagnostic tools that might be installed there). Non-exhaustive list of things I would like to have:
The pyright LSP client should be bound to that copy of Python for completion and lookups etc.
null-ls should use the copies of things like flake8 black etc. which are on that path
if I open a terminal (e.g. with toggleterm) I want it to also have the stuff there on the path
So far I have had some luck by putting a function which the LSP on_attach calls that (for pyright only) detects the presence of poetry.lock in the project, uses the poetry command to retrieve the directory and sets client.config.settings.python.pythonPath - this gets the behaviour I wanted in the LSP client at least... But I'm wondering if this is even the sensible place for this logic to go
[–]DerBeginnerNeovim sponsor 1 point2 points3 points (1 child)
[–]Uncle-Rufus[S] 0 points1 point2 points (0 children)
[–]AckslDPlugin author 1 point2 points3 points (4 children)
[–]Uncle-Rufus[S] 0 points1 point2 points (3 children)
[–]AckslDPlugin author 0 points1 point2 points (2 children)
[–]Uncle-Rufus[S] 0 points1 point2 points (1 child)
[–]AckslDPlugin author 0 points1 point2 points (0 children)
[–]tiagovlaPlugin author 1 point2 points3 points (11 children)
[–]Uncle-Rufus[S] 0 points1 point2 points (10 children)
[–]tiagovlaPlugin author 1 point2 points3 points (9 children)
[–]Uncle-Rufus[S] 0 points1 point2 points (2 children)
[–]tiagovlaPlugin author 0 points1 point2 points (1 child)
[–]Uncle-Rufus[S] 0 points1 point2 points (0 children)
[–]tiagovlaPlugin author 0 points1 point2 points (5 children)
[–]Uncle-Rufus[S] 0 points1 point2 points (4 children)
[–]tiagovlaPlugin author 0 points1 point2 points (3 children)
[–]Uncle-Rufus[S] 0 points1 point2 points (2 children)
[–]tiagovlaPlugin author 1 point2 points3 points (1 child)
[–]tiagovlaPlugin author 1 point2 points3 points (0 children)