fslaborg / RProvider

Access R packages from F#
http://fslab.org/RProvider/
Other
235 stars 69 forks source link

R outputs to standard out, which breaks FsAutoComplete #160

Open rneatherway opened 8 years ago

rneatherway commented 8 years ago

Ref: https://github.com/fsharp/emacs-fsharp-mode/issues/33

The R output on standard out is interleaved with the JSON messages being sent to the editors. I'd like to explore whether we can prevent these spurious messages from being printed here.

rneatherway commented 8 years ago

Example of output:

[[425]]
[[425]]$name
[1] "findPackageEnv"

[[425]]$type
[1] "closure"

[[425]]$params
[[425]]$params[[1]]
[1] "info"
tpetricek commented 8 years ago

This is mysterious - we must just be accidentally printing this somewhere - e.g. a leftover of some debugging attempts!

As documented here, the R provider starts a separate process (see here) that actually runs R and so I don't see how output from R could accidentally get into the output of the console that is calling the main type provider library.

jmp75 commented 8 years ago

Let me know if I can do something with the AutoPrint behavior. It's been unfortunately an occasional practical stumbling block for users on different fronts whether it defaults to true or false.

ghost commented 8 years ago

@tpetricek The issue is solved.
R sometimes could still break autocomplete by sendng warning messages but it's easy to suppress those warning from R. Thanks for helps.

tpetricek commented 8 years ago

@jmp75 I think the AutoPrint behavior is fine as it is - the fact that we can enable/disable it when creating the engine is really all we need in R provider :-).

ghost commented 8 years ago

It happens again. I have no idea where the output comes from so I can't suppress it: Error: F# completion process produced malformed JSON (Loading required package: spd). Loading any packages causes this. I tried several R packages: Rcpp, spatial, spd.

tpetricek commented 8 years ago

Reopening. Is there a good way of getting a log of what gets sent to the FsAutoComplete so that I can more easily reproduce this?

rneatherway commented 8 years ago

@tpetricek the easiest way I found to reproduce it was with FsAutoComplete standalone, see this comment: https://github.com/fsharp/emacs-fsharp-mode/issues/33#issuecomment-156422321

I am really interested to know if there is some way FsAutoComplete can just suppress subprocesses from outputting, as otherwise this could keep happening.