-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Smart send often doesn't work when file contain Python2 code #22318
Comments
This happens with and without:
|
@Tyriar What python version are you using? |
@Tyriar The reason why this didn't work(for the file provided in slack specifically) is because the test file (one mentioned in Slack) that were being used to test smart send feature: https://github.com/microsoft/vscode/blob/3d7ff4a237b5eccf6bedc9902d75a0e228cc742d/extensions/vscode-colorize-tests/test/colorize-fixtures/test.py#L51, contained code block:
which is only valid in Python2. Minimum official support we have is Python3.8 and above, and end_lineno attribute from the AST module is only supported on Python3.8 and above. So it make sense why shift+enter did not "do" anything when the file contained the mentioned code segment. Smart Send would error out on Python2 code above. I think Python2 is no longer supported as of January 1st, 2020, hence make sense AST doesn't pickup Python2 code properly and manages to messed up parsing of the other contents of the given Python file as well. When you shift+enter on the any part of the Python file (some other Python3 code block that were in the file), the smart send logic and Python standard library module AST has to parse through the file in order to collect, and hence allow me to perform smart selection logic, and in that process it errors out. It also make sense that normal explicit highlighting selection will work because we don't have to parse through Python file like we have to for Smart Send (and hence smart selection) logic. Commenting out the Python2 code should allow you to use Smart Send without this issue! Edit: Incoming message/warning/notification + user setting in regards to smart send on file with outdated Python code and toggling smart send on/off. |
Ideally we would fallback to something like sending just the line. Alternatively we could show some error notification, but I think just sending the line would be better. |
Testing #22287
Most of the time I try to run the shift+enter command without a selection it results in this runtime error:
버전: 1.84.0-insider (user setup)
커밋: 7dff07893ac160244db210e574eccc05f1cba2cb
날짜: 2023-10-24T05:33:54.929Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621
The text was updated successfully, but these errors were encountered: