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

Investigate a VS Code-native REPL experience #22674

Closed
anthonykim1 opened this issue Dec 18, 2023 · 4 comments
Closed

Investigate a VS Code-native REPL experience #22674

anthonykim1 opened this issue Dec 18, 2023 · 4 comments
Assignees
Labels
area-repl feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.

Comments

@anthonykim1
Copy link

anthonykim1 commented Dec 18, 2023

Investigate a VS Code-native REPL experience.
Listen to community feedback, discussion, studies, along with other mentioned IDEs tools to improve and implement VS Code native REPL experience!

Essential Requirements that needs to happen(Subject to Change):

  1. Prompt that is able to provide user with input prompt such as >>>
  2. Process input prompt, store commandline for history purposes.
  3. Provide user with correct return value, output results depending on success or failure,error,exception.

Potentially useful & requested REPL features from issue board, discussion, user studies, etc (Subject to Change):

  • Autocomplete (Can this be done by connecting native REPL to Pylance?)
  • Runtime environment access, potentially automatically importing user's library module listed in currently opened Python file.
  • Syntax Highlighting (Can this be done by connecting native REPL to Pylance?)
  • Easy access to history by typing "magic command" such as history
  • Variable panel with live updates to variable execution that happens via REPL
  • Dedicated or embedded area in REPL for visualization such as plot or graph.
  • Advanced autocomplete/ghost text using Copilot, adding on top of autocomplete.
@anthonykim1
Copy link
Author

Question that needs research: How does Python's default interactive interpreter, know the "completeness" when user types their command next to >>> and press enter?
For example, how is it that it is smart enough to figure out to run the code when user types print('Hello World') but not when user types my_multi = {
Is it by AST? Is it by inspecting whether or not user is intending to run is a valid type or object in AST?

@blubberdiblub
Copy link

Question that needs research: How does Python's default interactive interpreter, know the "completeness" when user types their command next to >>> and press enter? For example, how is it that it is smart enough to figure out to run the code when user types print('Hello World') but not when user types my_multi = { Is it by AST? Is it by inspecting whether or not user is intending to run is a valid type or object in AST?

You may additionally want to research how iPython does it, because I suspect it might use a different or augmented approach given that it introduces additional syntactical elements that need to be differentiated from the existing pure Python syntax and might even be in conflict with it in rare edge cases.

@anthonykim1
Copy link
Author

Tangible product/spike can be visible here: #23029

@anthonykim1
Copy link
Author

Should also think about experiences in Web when we decide on UI/UX on native REPL. Editor view (whether via already existing editor type) vs. Terminal view. Also should keep web experience in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.
Projects
None yet
Development

No branches or pull requests

3 participants