quarto-dev / quarto-dev/quarto

Support for `onTypeFormatting` in chunks

Open
#432 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

vscode
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.