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

= is sometimes wrongly formatted as <- #282

Open
kv9898 opened this issue Mar 10, 2025 · 7 comments
Open

= is sometimes wrongly formatted as <- #282

kv9898 opened this issue Mar 10, 2025 · 7 comments

Comments

@kv9898
Copy link

kv9898 commented Mar 10, 2025

My code was meant to be:

datasummary(
  (`Profit (% of GDP)` = profit_ppgdp) +
    (`Liabilities (% of GDP)` = liabilities_ppgdp) +
    (`Interest rate` = ir) +
    (`Publicly traded` = traded) +
    (`Euro Area` = Eurozone) +
    (`Governor reappointability` = reappointable) ~
    Mean + SD + Min + (Q1 = P25) + Median + (Q3 = P75) + Max + N,
  data = empdata,
  output = "kableExtra"
) |>
  kable_styling(latex_options = "scale_down")

and it was wrongly formatted by Air to:

datasummary(
  (`Profit (% of GDP)` <- profit_ppgdp) +
    (`Liabilities (% of GDP)` <- liabilities_ppgdp) +
    (`Interest rate` <- ir) +
    (`Publicly traded` <- traded) +
    (`Euro Area` <- Eurozone) +
    (`Governor reappointability` <- reappointable) ~
    Mean + SD + Min + (Q1 <- P25) + Median + (Q3 <- P75) + Max + N,
  data = empdata,
  output = "kableExtra"
)

I guess we should especially be careful with = inside functions?

@DavisVaughan
Copy link
Collaborator

Air didn't do that, I'm pretty sure that was styler in Positron

@kv9898
Copy link
Author

kv9898 commented Mar 10, 2025

Ohh sorry. The culprit turned out to be Quarto. When I formatted it in a separate R document it was fine. Do you happen to know which repo is responsible for this, I assume it's https://github.com/quarto-dev/quarto ?

@DavisVaughan
Copy link
Collaborator

I think you are running into this then #77, and we are tracking it here in Air. It will get resolved when we remove styler from Positron itself in favor of just installing air

@kv9898
Copy link
Author

kv9898 commented Mar 10, 2025

I turned off my Air extension and the problem persisted. Is that good news for Air and bad for Quarto?

@DavisVaughan
Copy link
Collaborator

DavisVaughan commented Mar 10, 2025

It's not Air. It is Positron's styler integration being invoked on your behalf by Quarto.

Air with Quarto documents does not work right now in Positron, we will try to fix it soon. It does work in VS Code though, if you want to write in that IDE for now.

@kv9898
Copy link
Author

kv9898 commented Mar 10, 2025

LMFAO! Sounds like a sibling fighting situation within the Posit family. Thx for the detailed explanation, though.

@juliasilge
Copy link
Contributor

We are tracking pulling out the styler-based formatter in posit-dev/positron#6462; we could do that right away but folks would need to know to install air somehow and there isn't a super easy fix to prompt people in product. We are planning to do the work required for bundling air and ruff next milestone (next month), but it's arguable the situation now is worse than having Positron ship with no formatter.

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

3 participants