randy3k / R-Box

R package for Sublime Text 3
MIT License
171 stars 27 forks source link

a couple of enhancements for auto-complete #109

Open faridcher opened 7 years ago

faridcher commented 7 years ago

In our terminology an object could be:

workspace required (active r session)

workspace not required

randy3k commented 7 years ago

Thanks for the suggestions. I just want to reply for first point now.

auto-complete of list objects by typing $. for example alist$ pops up a context menu suggesting available components of the list

It is unfortunately not very possible because Sublime Text is not attached with any R console, it is just a pure editor without knowledge about an R instance.

The other points are quite valid, I'll consider them.

faridcher commented 7 years ago

The list components suggestion could work conditioning on the presence of a R console. Right now, you can send commands using SendCode; Is the reverse not possible? i.e. getting a response from the console. As you may be aware, getting possible list components is just a call to names function. I am transitioning from Rstudio to totally rely on ST3 (+packages) and am wondering to what extent I can rely on it. thanks

randy3k commented 7 years ago

Sending code to R console is very different from loading the workspace from it though.

faridcher commented 7 years ago

We don't have to load the workspace. I haven't done any development in sublime using python but the question is whether there is a way to get a textual response from the R console in a sublime python session? Assuming its feasibility, one can send ls() to the R-console and load the response character vector in sublime as the auto-complete suggestion.

I am note sure but maybe something like this!

randy3k commented 7 years ago

It is possible to connect a R session to a text editor by mean of socket connections. Nvim-R has done a great job with this idea. However, it is not an easy task also some how limited. For instance, the R session needs to be launched by the text editor and tie with a particular file.

faridcher commented 7 years ago

In any case, If this becomes feasible, it opens a new door for R-Box, potentially enabling a wide range of new features.