posit-dev / positron

Positron, a next-generation data science IDE
Other
1.53k stars 43 forks source link

Quarto extension and preferred language for code cells #1376

Open jthomasmock opened 9 months ago

jthomasmock commented 9 months ago

Positron Version: Positron Version: 2023.09.0 (Universal) build 203 Code - OSS Version: 1.79.0 Commit: 519fbc791a60d21275cb20c3b8214202b99605a2 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 commented 2 months ago

X-posting with: https://github.com/quarto-dev/quarto/issues/425

EllaKaye commented 1 week ago

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.