X Tutup
Skip to content

Skip incomplete lines in on-type-formatting#615

Merged
renkun-ken merged 4 commits intomasterfrom
binary-opts-formatting
Apr 24, 2023
Merged

Skip incomplete lines in on-type-formatting#615
renkun-ken merged 4 commits intomasterfrom
binary-opts-formatting

Conversation

@renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Apr 23, 2023

Closes #607

This PR skips incomplete lines in the backward parsing in on-type-formatting so that if the previous line ends with a binary operator or comma (as incomplete, thanks to #613), the parsing will include the line.

The on-type-formatting should work properly with the following case:

df |>
  mutate(a = b) |>
  mutate() |> # typing enter
df |>
  mutate(a = b) |>
  mutate() |>
  fun() # typing ) or enter

@renkun-ken renkun-ken requested a review from randy3k April 23, 2023 14:57
Copy link
Member

@randy3k randy3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments, otherwise LGTM.

@renkun-ken renkun-ken merged commit 1e71561 into master Apr 24, 2023
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 this pull request may close these issues.

On-type formatter adds extra indentations after pipes

2 participants

X Tutup