Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Find & Replace: option to scope search to prose or code blocks in `.qmd` files

Aperta
#1,034 1 commento 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
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript, vscode

Direzione di ricerca

Start by locating the Quarto extension's existing document-structure parsing used for cell execution, folding, and diagnostics, along with the in-editor find implementation. Determine how scoped ranges could support .qmd prose, code, and all modes; done means the in-editor Find/Replace behavior matches the three specified scopes, with workspace-wide search treated as secondary.

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

Descrizione

enhancement vscode

Enhancement Request Summary

Add filter options to the editor Find & Replace panel that let users restrict matches to either prose regions or code-block regions in .qmd documents.

Context

I noticed this gap while using Find & Replace in Positron. However, since the feature would require awareness of Quarto document structure — distinguishing prose regions from fenced code blocks — I'm filing it here on the assumption that it belongs in the Quarto extension rather than in Positron itself. Happy to be redirected if that reasoning is wrong.

Motivation

In mixed-format documents like .qmd, many terms appear in both prose and code with intentionally different formatting. For example:

  • The desired markdown formatting for a book title like Great Expectations might be italics in prose but unformatted in code (e.g., str_detect(title, "Great Expectations")
  • A function name like filter may need to be renamed in code without touching narrative references to "filtering"

The current find/replace is document-wide, making these edits either manual or reliant on complex regular expressions that approximate zone detection.

Proposed behaviour

Add a new toggle or dropdown to the in-editor Find/Replace widget and/or the global search panel when the active file is a .qmd, with three modes:

Mode Behaviour
All (default) Current behaviour — search entire document
Prose only Match only outside fenced code blocks (```{r}, ```{python}, etc.) and inline code spans
Code only Match only inside fenced code blocks and inline code spans

Implementation notes

The Quarto extension already parses the document structure to support cell execution, folding, and diagnostics, so the zone boundaries are available. The find/replace scope could be implemented by:

  1. Restricting the set of ranges passed to the editor's find implementation, or
  2. Post-filtering results to exclude ranges that fall in the wrong zone. This could be delivered initially for the in-editor Cmd/Ctrl+F widget; workspace-wide search (sidebar) is a secondary concern.

Related

Source editor priorities for 2026: #897
VS Code does not support this natively; this would be a Quarto-extension-level feature

Lingua principale
TypeScript
Stelle
652
Fork
64
Merge medio
8h 45m
PR unite (30g)
36

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 quarto-dev/quarto

Tutte le issue di quarto-dev/quarto

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.