You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks I created a small POC of an LSP that parses container.py files and is able to serve "Go to implementation" requests.
Let me know your thoughts as this is something I could invest more time on if folks see some value. I did it using another DI lib but I could improve it so that it works with multiple providers. Is this something you would be interested in?
You can also see a pretty good example for this in the fastapi template.
Thus, in my average case, getting to the implementation is just 2 "go to implementation" (for example Ctrl + B in Pycharm) away (without having multiple options to select from).
Now that_depends technically supports resolution by name using Container.resolve() in which case your tool would be more useful.
In general, in the current state of the project, I am not sure if a tool like you suggests would be too useful, but I can see it being more relevant as the project grows. Currently, the resolution framework of that_depends is just pretty simple and thus easy to follow.
This is my personal opinion, it is likely someone else has a different one.
Activity
xelandernt commentedon Jan 15, 2025
Hi @felippemr, thank you for sharing this!
Currently,
that_dependssupports injection primarily through an IOC container.This means that in my average case, my code looks something like this:
Thus, I specify explicitly the provider that then injects the dependency.
And finally, the functions/classes that actually generate the dependencies:
You can also see a pretty good example for this in the fastapi template.
Thus, in my average case, getting to the implementation is just 2 "go to implementation" (for example Ctrl + B in Pycharm) away (without having multiple options to select from).
Now
that_dependstechnically supports resolution by name usingContainer.resolve()in which case your tool would be more useful.In general, in the current state of the project, I am not sure if a tool like you suggests would be too useful, but I can see it being more relevant as the project grows. Currently, the resolution framework of
that_dependsis just pretty simple and thus easy to follow.This is my personal opinion, it is likely someone else has a different one.