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

Code completion with fsttable interface in RStudio #10

Open
MarcusKlik opened this issue Mar 26, 2018 · 1 comment
Open

Code completion with fsttable interface in RStudio #10

MarcusKlik opened this issue Mar 26, 2018 · 1 comment
Assignees
Milestone

Comments

@MarcusKlik
Copy link
Collaborator

In RStudio, list and data.frame objects have code completion, when you do:

image

you get a nice popup showing the list element names.
However, when you select a name from the menu, the following happens:

image

so we get brackets around the column name, as you would expect for a list or data.frame.

If we want to get auto-completion on a fsttable object the data.table-way, that object should have a data.table class and a fsttable class name:

# create a print generic
print.myclass <- function(dt){
  print("This is an override")
}

# define a data.table object
dt <- data.table::data.table(ColA = 1:100, ColBB = LETTERS)

# add a myclass class to the list of class names (at position 1)
class(dt) <- c("myclass", class(dt))

# check that custom print method is called
print(dt)
#> [1] "This is an override"

the auto-completion will now work as intended.

It would be nice to use the data.table class name in the fsttable object. That would require that overrides exist in the fsttable package for every possible generic that is defined in the data.table package. Otherwise, the data.table generic would be called for that particular method...

@MarcusKlik MarcusKlik self-assigned this Mar 26, 2018
@MarcusKlik MarcusKlik added this to the `data.table` interface milestone Mar 26, 2018
@MarcusKlik
Copy link
Collaborator Author

To keep good performance, there should be a limit to the number of columns simulated in the fsttable object. Perhaps 50 columns to start with.

@MarcusKlik MarcusKlik changed the title Code completion with fsttable interface in RStudio Code completion with fsttable interface in RStudio Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant