r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
407 stars 56 forks source link

Default arguments in R6 class methods are not shown #79

Closed olegshirokikh closed 7 years ago

olegshirokikh commented 8 years ago

Say one has the f-n like this:

func <- function(enum = c("b", "d", "c")) {
  arg <- switch(match.arg(enum), a = 1L, b = 2L, c = 3L)
}

Then the function signature and default args will pop up suggesting the use of the function: image

Same thing but in R6 class method:

EnumClass <- R6Class("EnumClass",
   portable = FALSE,
   public = list(
     func = function(enum = c("b", "d", "c")) {
       arg <- switch(match.arg(enum), a = 1L, b = 2L, c = 3L)
     }
   ))

image

Is there any way to address this? Thanks

wch commented 8 years ago

I think this would require some modifications to the RStudio IDE. cc: @kevinushey

hadley commented 7 years ago

This is a bug in RStudio.