Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could the 'Quarto: Format Cell' command work for Observable? #500

Open
jack-davison opened this issue Jul 31, 2024 · 1 comment
Open

Could the 'Quarto: Format Cell' command work for Observable? #500

jack-davison opened this issue Jul 31, 2024 · 1 comment

Comments

@jack-davison
Copy link

I understand that the VSCode/Positron extension can style Py/R code, but not OJS. It'd be really helpful if it could do OJS too! e.g., turn

```{ojs}
Plot.plot({
marks: [
        Plot.dot(transpose(iris), {x: "Sepal.Length", y: "Petal.Width"})
        ]
})
```

into

```{ojs}
Plot.plot({
    marks: [
        Plot.dot(transpose(iris), {x: "Sepal.Length", y: "Petal.Width"})
    ]
})
```

Directed from posit-dev/positron#4196. Original message on the Positron repo from Julia Silge:

The solution to this will need to come from the Quarto extension, since it provides formatting for .qmd files. They have a command to format a cell:

Screenshot 2024-07-31 at 12 42 07 PM

Unfortunately though, that does not yet work for Observable chunks (it does work for R and Python). Can you open an issue on the repo for the Quarto extension that you would like the "Quarto: Format Cell" command to work for Observable? https://github.com/quarto-dev/quarto/issues

Cheers,
Jack

@cscheid
Copy link
Contributor

cscheid commented Aug 16, 2024

This will be a bit hard for us to do, because there's no standard formatter for the OJS syntax, afaict. OJS is not JS (see, eg, the mutable keyword), and so we'd have to wait for other developers to create appropriate tooling first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants