python-language-server
python-language-server copied to clipboard
Generate method
It would be nice, for Test-Driven Development, if we could right-click on a method name in a test, for a method that does not yet exist, and generate a new method for the referenced class via the context menu.
In TDD you write a test, and immediately run it and it fails. And then you make the changes to support the test passing, and then run the test again. Then the test passes. It would be nice to be able to write the test, including a reference to the undefined method, right-click on the method reference in the test to generate it in the associated instance's class (assuming loading the menu could check for a definition and if not, enable that menu option while disabling the "Go to Definition" and "Go to Reference" options). Clicking it could generate a basic method that would at least fail a test, but include the essential arguments noted in the reference to the undefined method.
I suppose this could be an additional extension, but it feels like it would be nice to have this directly in vscode-python.
Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.