-
Notifications
You must be signed in to change notification settings - Fork 160
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
company object completion not working on remotes #1047
Comments
This is from #1044. I'll have to look how ESS works with Tramp. I'm surprised it can work at all without an ESSR environment. We also need to think about some Tramp tests. |
I see that we use a different loading approach for remote connections. Instead of calling A cleaner approach might be to transfer all the ESSR files into a temp directory and then call |
I would be willing to take a stab at implementing the approach the @lionel- proposed above as long as I wouldn't be getting in anyone's way by doing so. |
I already did some work on that but haven't had time to finish yet. Also I'm not sure the approach will work out in the end. I was looking into sending text data directly to remote files using this trick: lines <- readLines(stdin())
writeLines(text = lines, file('lines.txt')) With an EOF to signal end of transfer. If you'd like to work on a simpler approach you're very welcome @dapritchard! |
We can also just source into an environment and attach. The end result just like on local machiens. |
Greetings @vspinu, I'm afraid it's not clear to me what the specifics are for your suggestion. Currently, what you've written above is what's done in the local process case: each of the files in The question for the remote process case then is how to get that source code from the local machine to the remote process. Currently what's implemented in the WIP #1107 patch is that the source files are first copied over from the local machine to a temporary directory on the remote machine, and then the sourcing + attaching occurs the same as for the local process case. As an aside, I suppose now is as good a time as any to offer my deepest thanks to you both for your contributions to ESS and other R/Emacs projects that I use on a daily basis. |
@dapritchard I was addressing @lionel-'s concern regarding sourcing of ESSR files into the R global env on M-x ess-remote. I would suggest we first dig what is the route of your problem. There is a reason why ESSR is not loaded on your remote machine. Current implementation is supper efficient and simple. The only drawback is that it needs an internet connection to github. One can also copy the ESSR.rds manually in rare cases when github is not accessible. |
@dapritchard you should be seeing an error message |
@vspinu How do you source into a remote? I couldn't find a way so I started working on sending the files through the process connection (super experimental approach, I'm not saying we should pursue it). Regarding adding an ESSR environment also on remotes, I think it's necessary not only to make remotes and local connections consistent, but also I would like to add |
In case some general clarification is helpful, there are three cases in the current implementation.
I believe that @vspinu may be referring to case (2). I'm trying to address the inconsistency that occurs in case (3) where there is no ESSR environment created in the remote R process. |
Autocompletion does not work properly with remote process over TRAMP either. I am not sure if this is related, but I guess it is. Sorry for not being too specific about these errors but I cannot figure out when they appear and when they do not. These are some of the errors I get when typing some functions:
|
Have you updated ESS to the latest version? |
Never mind these errors, I cannot reproduce them now. However, here is a problem with autocompletion that I see even after installing the latest version (20210204.856). This does not happen when I run a local R process.
my_df <- iris
my_other_df <- iris[1:10,]
Completion messages show up in the minibuffer after the first few characters that I type: Forming completions for .GlobalEnv...done
Forming completions for package:stats...done
Forming completions for package:graphics...done
Forming completions for package:grDevices...done
Forming completions for package:utils...done
Forming completions for package:datasets...done
Forming completions for package:methods...done
Forming completions for Autoloads...done
Forming completions for package:base...done
Autocompletion shows up as I type but only
What could be the problem? Is it related to the original issue? |
The relevant logic is here. I don't know why
The reason why we have a different approach for remotes is because sourcing files through process stdin does not work reliably. I worked on it myself, and a few years back someone else tried (we have an issues somewhere but I cannot find it). The best understanding so far is that Emacs sends new lines for long input which break the code which we sent. But in my experience it's even more than that, some parts of code can be missing. This is why I was proposing to send RDS by chunks, reconstruct on the other side and eval into ESSR environment. Anyways, let's make |
Just a heads up, but on my machine the ESSR fetch from GitHub is failing for me with the following error message.
|
Yes, same error for me:
|
Fixed. There was a missing ESSR tag on github. Could you please try again? @solmos I can reproduce your error. Something is not quite right with completion on remotes indeed. Renaming the topic. |
Now when I start a remote R process Emacs hangs for a few seconds and then the following error message appears:
|
I think there's a problem with |
I think I am mistaken in my previous comment about However, I am getting the same error as @salmos, and it seems to occur due to a failure in |
@dapritchard All the loading code is running behind
@solmos The timeout should be 30 seconds now. Do you see any improvement if you bump the timeout to infinity with |
@dapritchard If there are any errors during the loading of the ESSR, those should be displayed in the minibuffer with the errors. The timeout error means that you are using a week-old emacs. |
@vspinu You are correct, after catching my branch up to master
This explanation is very helpful, thank you. I hadn't dug deeply enough to understand the mechanism by which that was working. |
While runing R on a remote server using TRAMP the following error appears in a new help[R] buffer every time I try to open the help file on some function:
The problem just started after updating to ESS 20200905.822 and only when using TRAMP.
The error appears whether I type
?function_name
or I calless-display-help-on-object
with my keybinding.I am using Spacemacs.
The text was updated successfully, but these errors were encountered: