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

Quarto extension and preferred language for code cells #1376

Closed
Tracked by #4858
jthomasmock opened this issue Sep 22, 2023 · 6 comments
Closed
Tracked by #4858

Quarto extension and preferred language for code cells #1376

jthomasmock opened this issue Sep 22, 2023 · 6 comments
Labels
area: quarto Issues related to Quarto category.

Comments

@jthomasmock
Copy link
Contributor

Positron Version: Positron Version: 2023.09.0 (Universal) build 203
Code - OSS Version: 1.79.0
Commit: 519fbc7
Date: 2023-09-22T02:37:21.484Z
Electron: 22.3.10
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.6.0

Steps to reproduce the issue:

  1. Create a new Quarto document with an R interpreter selected.
  2. Insert a new code cell with the shortcut or command palette. It will give an interactive selector for the language, with Python as the first option. Choose Python.
  3. Insert a new code cell with the shortcut or command palette. It will give an interactive selector for the language. Choose Python.
  4. Every subsequent code cell will require selecting the language again and again, when most of the time it will be static. The default Quarto behavior is to prefer the language of the previous chunk, by putting it at the top of the list. However, it still makes you select a language each time and doesn't seem to follow the indicated interpreter.

What did you expect to happen?

I would expect that the Positron selected interpreter (R/Python) would indicate the default language of a code cell so I don't have to specify it every time.

Were there any error messages in the output or Developer Tools console?

@jthomasmock jthomasmock added this to the Future milestone Feb 23, 2024
@wesm wesm added the area: quarto Issues related to Quarto category. label Feb 29, 2024
@jthomasmock
Copy link
Contributor Author

X-posting with: quarto-dev/quarto#425

@EllaKaye
Copy link

It would also be really nice if the first option for the first chunk in a Quarto document automatically matched the selected interpreter. I think it would be reasonable to assume that if a user has the R interpreter selected, they are most likely to want an R code chunk (not the default first option of Python). It's only a small detail, but, I can see it's something that would frustrate me quite quickly if I need to scroll down to select r for the first chunk of every Quarto doc I write.

I'm not sure if this is sufficiently different from @jthomasmock's issue to warrant a separate issue. Happy to re-post if so.

@isabelizimm
Copy link
Contributor

I believe this is solved in the Quarto extension as of quarto-dev/quarto#540

@DavisVaughan
Copy link
Contributor

I would expect that the Positron selected interpreter (R/Python) would indicate the default language of a code cell so I don't have to specify it every time.

We don't quite do this, but I think it is much much less painful now. You explicitly select the language once for the first cell, and then every cell after that auto inherits that language until you manually change it.

@juliasilge
Copy link
Contributor

If you are interested @EllaKaye you could add your idea of connecting the default language of a code cell to the active interpreter to quarto-dev/quarto#405 or as a new issue on that Quarto repo.

In Positron with v1.114.0 of the Quarto extension, I see the correct behavior for the default language choice for each code cell:

code-chunk-language.mov

You do have to hit Enter to select the default choice, so we could improve this a bit further in the future.

@DavisVaughan
Copy link
Contributor

@juliasilge with a newer version of Quarto, you don't have to hit enter. That's quarto-dev/quarto#540

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: quarto Issues related to Quarto category.
Projects
None yet
Development

No branches or pull requests

6 participants