You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quarto metadata autcompletion doesn't work in untitled .qmd file #13804
RStudio Edition : Desktop
RStudio Version : 2023.12.0-daily+170
OS Version : macOS Sonoma 14.0
R Version : 4.3.1
Steps to reproduce the problem
When working on a new, unsaved Quarto file (i.e. creating a new blank document and changing the language to "Quarto"), YAML key autocomplete doesn't work.
In the YAML section of an untitled, unsaved Quarto file, start typing the name of a valid key from Quarto's schema and an autocomplete menu ordinarily appears (or type "tab" to force it to appear)
In RStudio 2023.12.0-daily+170, this doesn't happen anymore. No autocomplete menu appears, and tab only adds an indentation.
Describe the problem in detail
This happens in both the YAML front matter and in chunk options.
Describe the behavior you expected
Expected behavior in YAML front matter:
Expected behavior in chunk options:
Actual behavior in YAML front matter in untitled, unsaved file (from 2023.12.0-daily+170):
Actual behavior in chunk options in untitled, unsaved file (from 2023.12.0-daily+170):
I'm not able to reproduce this in RStudio Desktop 2023.12.0-daily+170 using Quarto 1.3.450 on Mac. Trying out the example you provided, I am able to tab complete in the YAML front matter, and in the R chunk in-chunk options. @andrewheiss Do you have any more information about your environment? Are you using the Quarto that comes pre-bundled with RStudio, or have you installed Quarto separately? What are your autocomplete settings in Global Options > Code > Completions ?
Ah I see now. You're creating the Quarto file differently than I am -- you're first creating a new blank file as an Rscript, and then in the lower right corner, updating its format manually to Quarto. I am creating a new Quarto file via File > New File > Quarto Document and then hitting Create Empty Document.
When I do that, Quarto autocomplete works fine. When it's created as an Rscript, and then you change the format to Quarto, it doesn't actually register as a Quarto document until you save, so the Quarto autocomplete doesn't work via this method. This doesn't appear to be a regression though, I've looked at older versions of RStudio and this doesn't appear to ever have worked.
We can consider this issue, but I think it's unlikely to be fixed soon since you can either 1) create the file via New Quarto Document or 2) save the file first, and once you've done either of those things, Quarto autocomplete is available
Ok cool, that makes sense. It also works fine with the "New Blank File" button in the Files panel. Switching untitled file languages is likely just an edge case.
Activity
jgutman commentedon Oct 17, 2023
I'm not able to reproduce this in RStudio Desktop 2023.12.0-daily+170 using Quarto 1.3.450 on Mac. Trying out the example you provided, I am able to tab complete in the YAML front matter, and in the R chunk in-chunk options. @andrewheiss Do you have any more information about your environment? Are you using the Quarto that comes pre-bundled with RStudio, or have you installed Quarto separately? What are your autocomplete settings in Global Options > Code > Completions ?
andrewheiss commentedon Oct 17, 2023
I'm using Quarto 1.4.424 (from GitHub yesterday-ish, so not the bundled one), and autocompletion is enabled
It only happens in never-saved untitled files—as soon as it's saved somewhere, things work as expected
Untitled.mov
jgutman commentedon Oct 17, 2023
Ah I see now. You're creating the Quarto file differently than I am -- you're first creating a new blank file as an Rscript, and then in the lower right corner, updating its format manually to Quarto. I am creating a new Quarto file via File > New File > Quarto Document and then hitting Create Empty Document.
When I do that, Quarto autocomplete works fine. When it's created as an Rscript, and then you change the format to Quarto, it doesn't actually register as a Quarto document until you save, so the Quarto autocomplete doesn't work via this method. This doesn't appear to be a regression though, I've looked at older versions of RStudio and this doesn't appear to ever have worked.
We can consider this issue, but I think it's unlikely to be fixed soon since you can either 1) create the file via New Quarto Document or 2) save the file first, and once you've done either of those things, Quarto autocomplete is available
andrewheiss commentedon Oct 17, 2023
Ok cool, that makes sense. It also works fine with the "New Blank File" button in the Files panel. Switching untitled file languages is likely just an edge case.