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

Functions not being properly recognized in 2.6.1 #301

Open
lukakoning opened this issue Mar 10, 2025 · 3 comments
Open

Functions not being properly recognized in 2.6.1 #301

lukakoning opened this issue Mar 10, 2025 · 3 comments

Comments

@lukakoning
Copy link

lukakoning commented Mar 10, 2025

In version 2.6.1, functions are not properly recognized when accessing via '$' sign. This means you can no longer see it is a function, you don't get the automatic '()' when accessing it, and you also aren't shown the arguments of the function.

For illustration, this is how they used to show in 2.5.1:

Image

Now in 2.6.1:

Image

I am on:

R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

(RSTudio 2024.09.0 Build 375)

@wch
Copy link
Member

wch commented Mar 10, 2025

Does it exhibit that behavior with this code?

library(R6)
AC <- R6Class("AC",
    public = list(
        x = 1
    )
)

a <- AC$new()

# Press <tab> below
a$

And if not, can you provide a reproducible example?

@lukakoning
Copy link
Author

lukakoning commented Mar 11, 2025

@wch With this I can reproduce it:

AC <- R6::R6Class(
  "AC",
  public = list(
    x = 1,
    y = function(some_argument = "default") {
      print(some_argument)
    }
  )
)

a <- AC$new()

So then under 2.6.1 you see 'y' as a regular (purple) field and not as a function (blue):

Image

This is how it should be (correct under 2.5.1 and also 2.6.0):

Image

So then it seems related to the change made in 2.6.1 regarding ".DollarNames.R6(), avoid use of NextMethod()" (#298).

I was not able to reproduce on my personal PC where I was using R 4.4.2 and also R 4.1.3, but with a newer build of RStudio. So it may be related to the RStudio IDE most likely, as the change made in 2.6.1 was also made for an issue with the RStudio IDE. To recall, this bug occurs under RSTudio 2024.09.0 Build 375.

@kevinushey
Copy link

Does the issue persist with the latest daily builds of RStudio? https://dailies.rstudio.com

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

No branches or pull requests

3 participants