-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Smart send is sending too much code, and executing incorrect lines #23696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
dup: #23697 |
for this one too it send the whole function when my hover was on line w/
|
I think description I provided for smart send can be misleading in this type of "nested" or simple as inside the function or class scenario. For smart send, we send minimum executable code (as provided by Python Abstract Syntax Tree after parsing your Python file) in a non-nested scenario (expression/statement outside of any higher level code block). In "nested" scenario, we would send the highest top-level block of code. This allows users to quickly shift+enter throughout their file to run the maximum amount of executable code with the least amount of effort, which is the biggest reasoning behind this smart send and cursor move feature. So it would be actually as expected to send the entire function,class or other higher level of code block as its a "nested" scenario where block of print statement is effectively living under the higher block of function, and we send the highest level of code block we can find in this nested scenario case as provided by AST. If users decide to run a very specific part/line of code, they can just highlight/explicitly select part of the Python file they want to execute and smart send will not interfere at all. In the future with: #22558 should make it much more clear what we are sending to smart send via notification/warning of some sort.
I will have to investigate on this @eleanorjboyd |
Screen.Recording.2024-06-27.at.12.59.21.PM.movFor me I'm able to get complete function sent when I shift+enter on the return statement. @eleanorjboyd |
Great that makes sense thank you! Good explanation and that made it very clear |
Testing #23676
The text was updated successfully, but these errors were encountered: