Repository navigation
Conversation
a4e988b to
f5f38f2
Compare
4ea0953 to
b13558e
Compare
9cd3d26 to
979897b
Compare
Introduce the 'sess' R package for WebSocket IPC, implement terminal orchestration, and modernize the session watcher architecture for improved reliability and performance.
485bcbd to
1a247cc
Compare
|
Thanks for the good work! I'm wondering how to make it work with self-managed R sessions, e.g. a radian console started in a tmux window? |
|
I'm also wondering if the dependencies of |
If you run sess::sess_app("ws://......")(at the moment of writing, it may be more convenient to copy the whoe command with Theorietically, we could replace websocket with base R socketConnect but it is not very efficient. I beleive most users will also install languageserver, I guess it is also possible to absorb the package into langugeserver which is kind of bloated already. |
|
Yes, that's true. languageserver has many dependencies already. One difference is that languageserver is not loaded in the user session while sess is. For me, less packages loaded in user session could be cleaner :) |
Sorry for the late reply.
I think minimally we will need |
49fb1f1 to
d20d532
Compare
Add end-to-end integration tests for the session watcher and terminal, refactor existing unit tests, and update GitHub Action workflows for improved CI reliability.
Apply session watcher stability fixes, swap R IPC client/server roles for reliability, perform final linting, and bump the version to 3.0.0-rc.0.
Ported changes from PR #1693 to dev branch. Prepend params command when running selection or chunks from Rmd files with params in YAML frontmatter. Co-authored-by: tomtom <[email protected]>
- Added tests for getRmdParamsCommand in rmdParams.test.ts - Exported getRmdParamsCommand in rTerminal.ts for testing - Renamed sesson.test.ts to workspaceViewer.test.ts to fix typo - Deleted duplicate workspace.ts file
- Added version comparison between bundled and installed sess package. - Added unit tests in sessInstall.test.ts. - Used exports workaround in util.ts to enable stubbing of local functions in tests.
… hooks for sess compatibility
|
I have spent sometime to make live share to work without success, finally realized that we need to whitelite our publisher id: #1218 But It seems that microsoft is not being very active there, we might have to drop the Live share functionality here. |
d905392 to
16675e1
Compare
Close #1845 The development build already requires sess IPC protocol 2 and is incompatible with past releases. Use this compatibility break to remove the old R API compatibility layer and helpers whose roles have ended. - **`use_httpgd`, `use_jgd`, and their compatibility helpers:** `use_httpgd` was introduced in #1684, and `use_jgd` in #1706. #1817 replaced them with `plot_backend`, retaining the old arguments through `.warn_deprecated_plot_args()` and `.legacy_plot_backend()`. Extension callers already use `plot_backend`; removing the old arguments now also removes the need for these helpers. - **`register_hooks()`:** Introduced in #1684 for standalone hook registration and re-registration. It now delegates to `runtime_start()`, which `connect()` already calls directly, and has no extension callers. Re-registering also resets runtime-owned devices and viewer state without updating reconnect options, so this wrapper no longer provides a coherent independent configuration API. Keep the internal runtime lifecycle and use `connect()` as the public integration entry point. - **`rebind()`:** Introduced in #1684. #1739 migrated all callers to `.runtime_rebind()`, which records bindings for restoration when the runtime stops. Only the unused old definition remained. - **`json_rpc_response()` and `json_rpc_error()`:** Included in [#1684](#1684), but the upstream `sess` branch history shows they served the earlier HTTP `/rpc` implementation. [The WebSocket conversion](41b298a) removed their callers before sess reached main. Delete these unused HTTP response builders; the active `"json_rpc_error"` condition class remains. Update documentation, installer export checks, and test fixtures to match. Backend selection, fallback, and reconnect behavior remain unchanged, and the IPC protocol stays at version 2. Breaking API change: `connect()` no longer accepts `use_httpgd` or `use_jgd`, and `register_hooks()` is no longer exported. Use `plot_backend` and `connect()` instead.
The sess package is now bundled with the VSCode extension, we might move it to its own repository in the future.
Everything below this sentence was generated automatically.
🚀 Feature: Migrate Session Watcher to WebSockets & JSON-RPC 2.0
📝 Overview
This PR introduces a major architectural upgrade to vscode-R by replacing the legacy, file-based session watcher with a high-performance, token-authenticated IPC (Inter-Process Communication) mechanism.
The new system operates over a pure WebSocket architecture using JSON-RPC 2.0, enabling reliable, bidirectional communication between the R session and the VS Code extension.
✨ Key Changes
1. New
sessR Packagesesspackage to handle the server-side IPC.sess::register_hooks) andrstudioapiemulation.2. Client Session Manager Modernization
src/session.tsrefactored: Heavily refactored the extension's session manager to act as a JSON-RPC client/server.3. Viewer Architecture Overhaul
httpgdViewer.tsandstandardViewer.ts).helpViewerandwebViewerimplementations to cleanly integrate with the new IPC layer.4. Comprehensive Testing & CI Modernization
session.test.ts) and terminal (terminal.test.ts).main.yml,pre-release.yml,release.yml) to support the new testing architecture and package building steps.💡 Motivation & Background
The previous file-based session watcher (writing state to
.vscode-Rdirectories) was prone to race conditions, slow I/O, and was strictly one-way (R -> VS Code).By migrating to WebSockets and JSON-RPC 2.0:
🧪 Testing Performed
httpgdand standard viewers.rstudioapiemulation and global environment variable syncing.Note: Ensure to check any new dependencies introduced in
package.jsonandpackage-lock.jsonare properly installed before building.