quarto-dev / quarto-dev/quarto
Support for `onTypeFormatting` in chunks
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
The regexp-based indentation rules of VS Code are quite limited in what they can achieve so some language extensions have resorted to correcting indentation from their LSP, via the onTypeFormatting request for \n characters. That's the case with python for instance where the heavy lifting of indentation is done from pylance.
This currently doesn't work in quarto chunks, I believe (from a cursory look) because the quarto extension needs to:
- Enable
"editor.formatOnType" - Register an
OnTypeFormattingEditProvider - Forward formatting requests to the corresponding virtual document (if supported?)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the Quarto extension handles chunks and virtual documents, then inspect where editor.formatOnType and OnTypeFormattingEditProvider would be registered. Verify whether formatting requests can be forwarded to the corresponding virtual document, and confirm that on-type indentation works for Python in Quarto chunks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100