Skip to content

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

@lorenzwalthert

Description

@lorenzwalthert

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions