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

Native Notebooks - Add Code Cell #108464

Closed
claudiaregio opened this issue Oct 10, 2020 · 10 comments
Closed

Native Notebooks - Add Code Cell #108464

claudiaregio opened this issue Oct 10, 2020 · 10 comments
Assignees
Labels
feature-request Request for new features or functionality notebook
Milestone

Comments

@claudiaregio
Copy link

  • VSCode Version: 1.51.0 Insider

Steps to Reproduce:

  1. Opened Python notebook
  2. Ran all cells
  3. Click add code cell
  4. Plain text cell is added, not python code cell

Add Code Plain Text

@vscodebot
Copy link

vscodebot bot commented Oct 10, 2020

@claudiaregio
Copy link
Author

Closing as this is no longer happening

@claudiaregio
Copy link
Author

Reopening as I figured out the pattern. This only happens if the previous cell is a markdown cell.

Add Code Broken

@claudiaregio claudiaregio reopened this Nov 17, 2020
@rebornix
Copy link
Member

@DonJayamanne we had discussions about this before and we might need some way to indicate what's the preferred language to use when creating new code cells.

@DonJayamanne
Copy link
Contributor

@rebornix
I think providing an API asking from the extension for the preferred language is a better way.
Here are some scenarios we need to consider:

  • Most kernels in Jupyter only support a single language
    • Thus when using such kernels, the default language of the cell is same as the kernel langauge
  • Some kernels support multiple languages
    • In such cases, the language will be determined by the user
    • We don't know the languages a kernel supports out of the box

Suggestion

  • For new cells use the language of the previous code cell
    • I.e. walk backwards from current cell, & look for the first code cell
  • If there are no code cells
    • Then optionally provide an extensibility point for extension to provide the default language
    • E.g. at a property on NotebookMetadata for the default cell language.

@rebornix
Copy link
Member

@DonJayamanne agree on the suggestions. I pushed a change to find nearest code cell and use its language.

Then optionally provide an extensibility point for extension to provide the default language

I'll think about the API together with kernel language support.

@miguelsolorio
Copy link
Contributor

@claudiaregio are you still seeing this? Was testing this today and didn't reproduce so I think it's fixed @rebornix?

@claudiaregio
Copy link
Author

No I am no longer seeing this! looks fixed! :)

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality notebook
Projects
None yet
Development

No branches or pull requests

5 participants
@rebornix @DonJayamanne @claudiaregio @miguelsolorio and others