Format selection does not work as expected

Open
#656 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia, jupyter, python
Domain
tooling

Research direction

Start by reproducing the issue with the supplied Quarto document and compare Format selection behavior for the knitr, Jupyter, and Julia engines. Trace the existing Format selection entry point and its engine-specific handling; done means only the selected code is formatted rather than the whole cell.

Written by the indexing model from the issue text.

Description

vscode

The "Format selection" does not work for all engines (knitr/Jupyter/Julia).
It actually formats the whole code cell.

Take:

---
title: "Reproducible Quarto Document"
format: html
engine: jupyter
---

```{python}
#| label: test
#here is a bad comment
import matplotlib.pyplot as plt

x = [1,2,3,4,5]
y = [1,4,9, 16,25]

#poorly formatted code

plt.plot(x,y)
plt.show()
```

https://github.com/user-attachments/assets/e5b12160-5338-4529-bb3f-4206a04475a4

Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

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.

More from quarto-dev/quarto

All issues in quarto-dev/quarto

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.