Skip to content

Quarto metadata autcompletion doesn't work in untitled .qmd file #13804

Open

Description

@andrewheiss

System details

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:

image

Expected behavior in chunk options:

image

Actual behavior in YAML front matter in untitled, unsaved file (from 2023.12.0-daily+170):

image

Actual behavior in chunk options in untitled, unsaved file (from 2023.12.0-daily+170):

image
  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Oct 16, 2023
  2. added
    autocompletion
    and removed
    new
    on Oct 17, 2023
  3. jgutman commented on Oct 17, 2023

    @jgutman
    Contributor

    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 ?

    image
  4. added
    info needed
    and removed on Oct 17, 2023
  5. andrewheiss commented on Oct 17, 2023

    @andrewheiss
    Author

    I'm using Quarto 1.4.424 (from GitHub yesterday-ish, so not the bundled one), and autocompletion is enabled

    image

    It only happens in never-saved untitled files—as soon as it's saved somewhere, things work as expected

    Untitled.mov
  6. jgutman commented on Oct 17, 2023

    @jgutman
    Contributor

    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

    image
  7. andrewheiss commented on Oct 17, 2023

    @andrewheiss
    Author

    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.

    image
  8. added this to the Later milestone on Oct 17, 2023
  9. removed
    info needed
    on Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autocompletionbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions