Skip to content

tibbe::tribble() from {datapasta} should be recognized as aligned #753

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

Open
lorenzwalthert opened this issue Mar 19, 2021 · 0 comments
Open

Comments

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Mar 19, 2021

Quite a number of #styler: off is used in conjunction with tibble::tribble(): https://github.com/search?l=R&p=5&q=%22styler%3A+off%22&type=Code, and it's not recognized:

``` r
code <- 'tibble::tribble(
  ~fjadsfkj,     ~`1`,
       "fd",    "223",
  "Here  3", "23203i"
  )
'
styler::style_text(code)
#> tibble::tribble(
#>   ~fjadsfkj, ~`1`,
#>   "fd", "223",
#>   "Here  3", "23203i"
#> )

Created on 2021-03-20 by the reprex package (v1.0.0)```

Created on 2021-03-19 by the reprex package (v1.0.0)

Detecting this would involve checking all comma alignements, not just the first + not checking indention. In addition, there must be a way to specify for which tokens use_raw_indention is TRUE and for which ones it should be FALSE, and set this in current_env instead of globally.

Related: #258.

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

No branches or pull requests

1 participant