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

can't send to Native Python REPL with ⇧&⏎ like send to Jupyter #23988

Closed
geoqiao opened this issue Aug 25, 2024 · 11 comments
Closed

can't send to Native Python REPL with ⇧&⏎ like send to Jupyter #23988

geoqiao opened this issue Aug 25, 2024 · 11 comments
Assignees
Labels
area-repl bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@geoqiao
Copy link

geoqiao commented Aug 25, 2024

I can't send to Native Python REPL with ⇧&⏎ like send to Jupyter

When I select a piece of code and press the shortcut key ⇧ & ⏎, this piece of code is executed in the repl interface of the terminal instead of Native Python REPL.
image

What I expect is that this code can be executed in Native Python REPL when I press the shortcut key.

Here is my setting.json config, thanks for help me:

{
  // editor basics

  "editor.accessibilitySupport": "on",

  "editor.fontFamily": "JetBrains Mono NL, MesloLGS NF", //字体部分需要下载相关字体

  "editor.cursorBlinking": "solid",

  "editor.defaultFormatter": "charliermarsh.ruff", // ruff插件的配置项

  "editor.mouseWheelScrollSensitivity": 1,

  "editor.mouseWheelZoom": true,

  "editor.semanticHighlighting.enabled": true, //语义高亮

  "editor.wordWrap": "off",

  "editor.autoClosingBrackets": "languageDefined",

  // python

  "[python]": {
    "editor.formatOnSave": true,

    "editor.codeActionsOnSave": {
      "source.fixAll": "explicit",

      "source.organizeImports": "explicit"
    },

    "editor.defaultFormatter": "charliermarsh.ruff"
  },

  "python.languageServer": "Pylance",

  "python.analysis.typeCheckingMode": "basic", //类型检查

  "python.REPL.sendToNativeREPL": true,

  "interactiveWindow.executeWithShiftEnter": false,

  // theme

  "workbench.colorTheme": "Best Themes - Xcode Catalina Bold",

  "workbench.iconTheme": "material-icon-theme",

  "debug.console.fontSize": 15,

  "editor.fontSize": 15,

  "window.zoomLevel": 1,
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "accessibility.signalOptions.volume": 10
}
@geoqiao geoqiao added the feature-request Request for new features or functionality label Aug 25, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 25, 2024
@anthonykim1
Copy link

anthonykim1 commented Aug 28, 2024

Hi @geoqiao Thank you for filing this issue. This is bit weird as I see "python.REPL.sendToNativeREPL" in your settings.json

Can you head over to the settings UI and see you have checked the setting for send To Native REPL to be true?
Screenshot 2024-08-28 at 3 53 46 PM

Check both user and workspace setting and see if toggling both makes a difference. Thanks!

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

It does look like workspace setting will effectively overwrite your user setting: https://code.visualstudio.com/docs/getstarted/settings#:~:text=Workspace%20settings%20are%20specific%20to,root%20in%20a%20.vscode%20folder

Can you make sure you have the setting checked for workspace and see if that changes anything?

@anthonykim1 anthonykim1 added area-repl bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team labels Aug 28, 2024
@geoqiao
Copy link
Author

geoqiao commented Aug 31, 2024

Thanks for your help, I checked the user and Workspace settings separately and it seems like nothing is wrong:

image image

@anthonykim1
Copy link

anthonykim1 commented Sep 3, 2024

@geoqiao Thanks for these screenshot. Yes they do look super-fine.

That being said, are you able to see start Native REPL command when you launch the command palette? Or do you only see the launch Terminal REPL command
(cmd or ctrl + shift + p)
Screenshot 2024-09-03 at 2 37 49 PM

@geoqiao
Copy link
Author

geoqiao commented Sep 4, 2024

I couldn't find the 'Start Python REPL' command in the command palette; I only saw the 'Terminal REPL' command.image

@geoqiao
Copy link
Author

geoqiao commented Sep 7, 2024

@anthonykim1 update:today I update vscode to version 1.93.0 and start Native REPL command can be found in the command palette. But I still can't use ⇧ + ⏎ to send code to native python repl.

image

@anthonykim1
Copy link

Hi @geoqiao Thanks for the update. Can you try updating the Python extension to the latest version and see if that does anything?

@geoqiao
Copy link
Author

geoqiao commented Sep 17, 2024

⇧&⏎ Still send code to terminal REPL.
And the Native REPL command doesn't work too, it just open the native repl interface without running code
image

@anthonykim1
Copy link

@geoqiao Thanks for the screenshot. I really can't repro this.
When you launch the Python Native REPL with that command palette, are you able to type code in the input box and have it run?

@geoqiao
Copy link
Author

geoqiao commented Oct 1, 2024

Thank you for your help, I have now solved the problem: by completely uninstalling VSCode and its configuration files, and reinstalling and setting all settings through the UI interface instead of the settings.json file (by synchronizing the settings.json file, this bug will still be repeated) , so I guess there may be a problem with my settings.json

anyway,it's fine now !Thanks again!

Copy link

Hey @anthonykim1, this issue might need further attention.

@geoqiao, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@geoqiao geoqiao closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants