question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Magrittr pipes trigger indent on newline

See original GitHub issue

Not sure if this is the right place for this request, please delete if not !

Would it be possible to get magrittr’s pipes %>% to be treated akin to brackets where an automatic indent happens if you press enter on a line whose last symbol is the pipes?

i.e. having

iris %>% mutate(...)

and pressing enter after the %>% but before the mutate(...) would result in

iris %>%
    mutate(...)

At the moment when I do this it just comes out as:

iris %>%
mutate(...)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
renkun-kencommented, May 12, 2020

@gowerc https://github.com/REditorSupport/languageserver/pull/209 implements on-type-formatting on user input at expression-level based on a backward parsing strategy. With editor.formatOnType = true and vscode-r-lsp and languageserver installed, the formatting is exactly what you want.

1reaction
renkun-kencommented, May 24, 2020

I’m curious about how the text edits are handled if editor.formatOnType is enabled and languageserver also performs on-type-formatting and indention, and vscode-R also makes some indention?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Magrittr pipes trigger indent on newline · Issue #321 - GitHub
Would it be possible to get magrittr's pipes %>% to be treated akin to brackets where an automatic indent happens if you press...
Read more >
Pipe - magrittr
Pipe an object forward into a function or call expression. ... It is possible to force evaluation of rhs before the piping of...
Read more >
How to implement the piping operator %>% in ESS mode?
I need to implement this so that it will print that operator %>% and then jumps to a new indented line.
Read more >
How can I make vim indent dplyr code with the pipe ...
I'm using the Vim-R-Plugin, the related issue is here. r · vim · indentation · dplyr · magrittr.
Read more >
vscode-R - Bountysource
Would it be possible to get magrittr's pipes %>% to be treated akin to brackets where an automatic indent happens if you press...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found