Skip to content
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

disabling python.REPL.enableREPLSmartSend doesn't work #23998

Closed
DetachHead opened this issue Aug 27, 2024 · 7 comments
Closed

disabling python.REPL.enableREPLSmartSend doesn't work #23998

DetachHead opened this issue Aug 27, 2024 · 7 comments
Assignees
Labels
area-repl info-needed Issue requires more information from poster

Comments

@DetachHead
Copy link

DetachHead commented Aug 27, 2024

Type: Bug

Behaviour

disabling python.REPL.enableREPLSmartSend in settings.json doesn't work. the Shift+Enter keyboard shortcut still activates it

Steps to reproduce:

  1. set python.REPL.enableREPLSmartSend to false in .vscode/settings.json
  2. create a python file with an expression in it, eg:
    1
  3. put the cursor at the end of the line and hit shift+enter

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2024-08-27 17:03:39.959 [info] Send text to terminal: 1

Extension version: 2024.12.3
VS Code version: Code 1.92.2 (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z)
OS version: Windows_NT x64 10.0.22621
Modes:

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 27, 2024
@anthonykim1
Copy link

@DetachHead Thanks for filing this issue. Can you check the settings UI and see you turned off the setting for both user and workspace setting?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Aug 28, 2024
@anthonykim1
Copy link

Screenshot 2024-08-28 at 3 14 14 PM Also wondering if switching to and from the native REPL changes anything. Let me know how this goes. - Thanks

@DetachHead
Copy link
Author

@DetachHead Thanks for filing this issue. Can you check the settings UI and see you turned off the setting for both user and workspace setting?

yep i disabled it in both:

image
image

Also wondering if switching to and from the native REPL changes anything. Let me know how this goes. - Thanks

enabling that does cause it to send it to the native repl instead of the terminal, but it still ignores my python.REPL.enableREPLSmartSend setting

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Aug 28, 2024
@anthonykim1
Copy link

Interesting.. @DetachHead
For me shift+enter in a Python file with the line that contains exactly "1" lets me send 1.

Are you saying you don't want us to send that 1?

@anthonykim1 anthonykim1 added area-repl and removed triage-needed Needs assignment to the proper sub-team labels Sep 3, 2024
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Sep 3, 2024
@DetachHead
Copy link
Author

unless i'm misunderstanding what python.REPL.enableREPLSmartSend does, i would expect that functionality to be disabled when it's set to false

@anthonykim1
Copy link

Shift+enter (without smart send enabled) is meant to send that exact line (and only that line) of code in your Python file, where your cursor is, into a REPL.

For example, shift+enter in Python file with '1' will send 1 to the REPL, just like how official Python REPL (IDLE) will execute '1' when you type 1 and press enter.
Screenshot 2024-09-07 at 10 29 06 PM

Smart send will detect minimum viable executable code (which may extend outside of your cursor), and will send those code to repl.

For example:

line1:  my_dictionary = {
line2:                                'hi': 'hello'
line3:                                'line3': 'hello2'
line4:  }

shift+enter (with smart send enabled) on any of line 1-4 will go ahead and "smartly" run all 4 lines of code (whole dictionary).

@DetachHead
Copy link
Author

ah i see, thanks for the clarification.

i wanted to disable the Shift+Enter shortcut entirely because i find it really annoying and find myself accidentally hitting it all the time. though i guess i can accomplish that by just disabling the keybindings, so i guess this issue can be closed

@DetachHead DetachHead closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants
@DetachHead @anthonykim1 and others