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

On-type formatter adds extra indentations after pipes #607

Closed
Darxor opened this issue Mar 23, 2023 · 2 comments · Fixed by #615
Closed

On-type formatter adds extra indentations after pipes #607

Darxor opened this issue Mar 23, 2023 · 2 comments · Fixed by #615

Comments

@Darxor
Copy link

Darxor commented Mar 23, 2023

When using "editor.formatOnType": true in VSCode pipes with multi-line function calls cause extra indentations to appear.

This example will keep correct indentation on line 4 after pressing Enter

df |>
  mutate(a = b) |>
  mutate() |>

However, this example will cause indentation on line 6 to double up:

df |>
  mutate(
    a = b
  ) |>
  mutate() |>
Here's a config I use for styler inside languageserver:
options(languageserver.formatting_style = function(options) {
  styler::tidyverse_style(
    scope = "tokens",
    strict = TRUE,
    start_comments_with_one_space = FALSE,
    indent_by = options$tabSize
  )
})
@renkun-ken
Copy link
Member

@Darxor Would you like to try remotes::install_github("REditorSupport/languageserver#615") and see if it works for you?

@Darxor
Copy link
Author

Darxor commented Apr 25, 2023

Yes, it does seem to work properly for me now. Thanks for the fix!

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

Successfully merging a pull request may close this issue.

2 participants