Latest RStudio update has changed autocomplete behavior. Seeking help understanding.

I just updated RStudio on my Mac to version 2023.03.0+386, and certain autocomplete functionality I used to use extensively seems to have changed. Specifically, I'll look to select columns for a join in the middle of a pipe stream. Previously, the autocomplete was fairly intelligent and context-aware and would draw from the names of the table I was trying to join from. Now, attempting to autocomplete generates the error: Error in context[[1L]] : subscript out of bounds. Out of habit, I'll provide a reprex, although since that fails to reproduce the error, I will attach a screenshot as well.

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

set.seed(42)
df1 <- data.frame(
  id = 1:10,
  x = runif(10),
  y = sample(letters[1:10])
)

df2 <- data.frame(
  id = 3:7,
  z = rnorm(5)
)

df2 %>% 
  left_join({ # With cursor in these curly brackest, hit tab to autocomplete.
    df1 %>% 
      select(id, x)
  })
#> Joining, by = "id"
#>   id          z         x
#> 1  3  2.2866454 0.2861395
#> 2  4 -1.3888607 0.8304476
#> 3  5 -0.2787888 0.6417455
#> 4  6 -0.1333213 0.5190959
#> 5  7  0.6359504 0.7365883

Created on 2023-03-22 with reprex v2.0.2

image

What is happening now that wasn't previously?

More importantly (to me), can I either

  • change some setting to revert to the previous behavior? or
  • use some fancy new join function I haven't learned about yet which will yield behavior similarly useful to the previous?

I'm grateful for any explanation or help available.

4 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.