RProvider icon indicating copy to clipboard operation
RProvider copied to clipboard

R outputs to standard out, which breaks FsAutoComplete

Open rneatherway opened this issue 9 years ago • 8 comments

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 avatar Nov 13 '15 14:11 rneatherway

Example of output:

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

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

[[425]]$params
[[425]]$params[[1]]
[1] "info"

rneatherway avatar Nov 13 '15 15:11 rneatherway

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.

tpetricek avatar Nov 13 '15 15:11 tpetricek

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.

jmp75 avatar Nov 14 '15 23:11 jmp75

@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.

ghost avatar Nov 16 '15 17:11 ghost

@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 :-).

tpetricek avatar Nov 16 '15 21:11 tpetricek

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.

ghost avatar Dec 10 '15 06:12 ghost

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?

tpetricek avatar Dec 10 '15 10:12 tpetricek

@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.

rneatherway avatar Dec 10 '15 10:12 rneatherway