Find & Replace: option to scope search to prose or code blocks in `.qmd` files
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript, vscode
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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:
- Restricting the set of ranges passed to the editor's find implementation, or
- 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
- 主要语言
- TypeScript
- 星标
- 655
- 派生
- 64
- 平均合并
- 20 小时 53 分钟
- 30 天内合并 PR
- 46
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto#1211 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto#1139 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 90/100
quarto-dev/quarto#1138 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
quarto-dev/quarto#1137 ·
维护者通常 1 天内回复
-
Add dependabot?可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
quarto-dev/quarto#1135 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto 的全部 Issue
相似的 Issue
-
a10y a10y-audit ai-driven-qa claude
难度 2/5 1-3 小时 新手友好度 86/100
linagora/twake-directory-manager#219 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
0️⃣ phase/new
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Pulse v7: buildPreferencesFromTelos() bypasses telosSectionOrFile(), renders empty on unified-TELOS installs可能已有人在做 @zephyr91 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2393 ·
维护者通常 4 天内回复