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

Support R session requests by hosting a tcp server #1394

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

Tal500
Copy link
Contributor

@Tal500 Tal500 commented Jul 17, 2023

Closes #1359
Fixes #1391

Features:

  • TCP R connection
  • Visual&logical attaching/detaching from the TCP server (since 4bae0a7)
  • Correct loading init.R after R session init (and connect by it on pressing the status icon when opening a new terminal): Connect on already active R session via source("~/.vscode-R/init_late.R"); .vsc.attach(host="YOUR_HOST", port = YOUR_PORT);. (since 873af37)
  • Namespaces and global environment view
  • View data
  • Plots (since 0d7f44f)
  • Man pages
  • Web server is working
  • Make TCP listening configurable
  • Add .vsc.detach to API
  • Default viewers when not detached (since 860c8d5)
  • Detach button in VSCode UI (since b45db8d)
  • Webview display of file path as one that goes trough TCP and not by local path - including the HTML "lib" dir dependencies, when detected. (since db53c60)

Not Planned:

  • Portforwarding of 127.0.0.1 of URL based webview.

@Tal500 Tal500 changed the title wip: start working on connection to the requests by a tcp server. Support R session requests by hosting a tcp server Jul 17, 2023
@Tal500 Tal500 marked this pull request as ready for review July 24, 2023 17:03
@Tal500 Tal500 force-pushed the tcp-incoming-request-server branch from 2cc2504 to 6f6199d Compare August 3, 2023 13:39
R/session/vsc.R Outdated
cat(get_timestamp(), file = plot_lock_file)
if (!is.na(request_tcp_connection)) {
tryCatch({
plot_file_content <- readr::read_file_raw(plot_file)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does readr::read_file_raw() behave differently from readBin(file, file.size(file))?

Copy link
Member

@renkun-ken renkun-ken Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe readBin(file, file.size(file)) is good enough so that we don't have to introduce readr as a new dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe readBin(file, file.size(file)) is good enough so that we don't have to introduce readr as a new dependency.

You need to specify the correct encoding parameters, and I'm unable to make this work with jsonlite::base54_enc function with readBin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants