Skip to content

R Console integration to support both vscode-R architectures #9

Draft
Fred-Wu wants to merge 9 commits into
mainfrom
dev
Draft

R Console integration to support both vscode-R architectures #9
Fred-Wu wants to merge 9 commits into
mainfrom
dev

Conversation

@Fred-Wu
Copy link
Copy Markdown
Owner

@Fred-Wu Fred-Wu commented May 5, 2026

Summary

This PR updates R Console session integration to support both vscode-R session architectures:

  • New vscode-R sess WebSocket/JSON-RPC integration
  • Legacy vscode-R file-based session watcher integration

The integration mode is detected by vscode-R capabilities rather than version number, so custom builds based on either architecture are handled correctly.

Changes

  • Added session integration mode detection:
    • sess mode when vscode-R exposes sess and r.connectToSession
    • legacy mode when vscode-R exposes R/session/init.R
    • disabled mode when no supported integration is available
  • Preserved the current sess attach/reconnect path using SESS_PORT, SESS_TOKEN, and sess::connect()
  • Restored legacy SessionWatcher support for request.log, workspace.json, and member completion
  • Updated console profile bootstrap to run only the matching integration path
  • Kept focused-terminal activation for new vscode-R sessions
  • Combined restored legacy completions with vscode-R provider-based completions

Fred-Wu added 2 commits May 5, 2026 19:35
- Bootstrap R sessions through sess::connect using SESS_PORT/SESS_TOKEN
- Obtain current vscode-R session connection info from r.connectToSession
- Persist sess reconnection data under ~/.vscode-R/sessions/{pid}.json
- Reattach restored consoles to fresh vscode-R session ports after reload
- Activate the focused R Console session when switching terminals
- Route runtime completions through vscode-R’s completion provider
- Remove legacy vscode-R init sourcing and file-watcher session bridge paths
@Fred-Wu Fred-Wu self-assigned this May 5, 2026
Fred-Wu added 7 commits May 10, 2026 11:04
- Detect new vscode-R integration by r.connectToSession instead of bundled sess files
- Use pipe_path / SESS_PIPE for sess startup and restored-runtime reconnect
- Keep legacy init.R support for older vscode-R builds
- Restore active-session switching for custom console terminals via sess attach refresh
- Document ownership boundary between R Console and vscode-R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant