Skip to content

refactor(references.lua): move pipe chain column resolution logic before target definition check#596

Merged
jalvesaq merged 1 commit into
mainfrom
fix/rename-in-pipe
Jun 23, 2026
Merged

refactor(references.lua): move pipe chain column resolution logic before target definition check#596
jalvesaq merged 1 commit into
mainfrom
fix/rename-in-pipe

Conversation

@PMassicotte

@PMassicotte PMassicotte commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Small bug fix when using renaming symbol in a pipe expression.

summarise_mtcars <- function(data = mtcars) {
  data |>
    as_tibble(rownames = "model") |>
    mutate(power_to_weight = hp / wt) |>
    summarise(
      mean_mpg = mean(mpg),
      mean_p2w = mean(power_to_weight),
      .by = cyl
    )
}

Place the cursor on power_to_weight in the mutate() function. Try to rename, and only the power_to_weight in the summarise() gets renamed. This PR make sure that both are renamed.

@PMassicotte PMassicotte marked this pull request as ready for review June 23, 2026 20:26
@jalvesaq

Copy link
Copy Markdown
Member

Thank you! I confirm the bug and that the pull request fixes it!

@jalvesaq jalvesaq merged commit 102ef60 into main Jun 23, 2026
13 checks passed
@jalvesaq jalvesaq deleted the fix/rename-in-pipe branch June 23, 2026 21:15
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.

2 participants