Do you plan to have a dedicated Quarto parser to handle R code chunks?

Aperta
#1,441 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
8/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
markdown, r, rust
Ambito
devtools

Direzione di ricerca

This is a design question rather than a code change, and the payload names no files to edit. Start by reading the linked pull request #1440 to see how Ark currently detects earlier library() calls in Quarto chunks, then check how the #| eval: false case from the issue would be handled. Done means a maintainer answers whether a dedicated Quarto/R Markdown chunk parser is planned, before anyone writes code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi, I'm not sure this is the right place to ask but I have a question regarding how Ark handles Quarto documents, which might influence how Jarl does it.

Currently, Jarl can check Quarto and R Markdown documents but this support is a bit brittle because it uses the following process:

  • parse the text of the file
  • extract the code chunks and code options with regex
  • concatenate chunks (possibly after excluding chunks that we know are never evaluated)
  • check the code as a single file
  • remap diagnostics to their original location

The two weak parts are 1) the extraction of code chunks based on regex, and 2) determining the list of chunk options for each chunk (in particular, Jarl doesn't handle chunk options defined in the YAML frontmatter, for now).

I suspect this is (or will be) a challenge encountered by Ark as well when it needs to report diagnostics in Quarto files. For instance, https://github.com/posit-dev/ark/pull/1440 adds support to detect earlier library() calls, but I think a library() call shouldn't be considered as populating the namespace if it is in a chunk with #| eval: false and, AFAICT, this case isn't handled by the linked PR.

If this is indeed an issue for Ark too, I suppose a more robust solution would be to have a dedicated Quarto parser that gathers chunks and their options, and that resolves options defined in the frontmatter and those defined in the chunks themselves. Although Quarto 2 is developed in Rust, it might be overkill since I wouldn't need all the extra stuff about Markdown syntax. Is my understanding correct? Is this something that you plan to develop? If so, would it also handle R Markdown files? I'm asking simply to avoid duplicated work if this is on the roadmap for the near future.

Lingua principale
Rust
Stelle
342
Fork
31
Merge medio
1g 11h
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/ark

Tutte le issue di posit-dev/ark

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.