Skip to content

fix(plot): (re)start jgd server on backend switch - #1766

Merged
eitsupi merged 3 commits into
masterfrom
fix/jgd-backend-switch-1756
Sep 25, 2026
Merged

eitsupi merged 3 commits into
masterfrom
fix/jgd-backend-switch-1756

Conversation

@grantmcdermott

@grantmcdermott grantmcdermott commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1756

The jgd socket server and the JGD_SOCKET terminal env var were only set up at extension activation, and only if r.plot.backend was "jgd" or "auto" at that point. Switching the backend to jgd afterwards left R with no renderer connection until VS Code was reloaded.

Fix: Listen for r.plot.backend changes and start the server (idempotently) and set JGD_SOCKET when the new backend allows jgd, so the change takes effect on the next R restart.

The jgd socket server and the JGD_SOCKET terminal env var were only
set up at extension activation, and only if r.plot.backend was jgd or
auto at that point. Switching the backend to jgd afterwards left R
with no renderer connection until VS Code was reloaded.

Listen for r.plot.backend changes and start the server (idempotently)
and set JGD_SOCKET when the new backend allows jgd, so the change takes
effect on the next R restart.

Closes #1756
The plot manager now sets JGD_SOCKET via the extension context's
environmentVariableCollection during initialization, which the session
test's mock context didn't support.
Replace the repeated `backend === 'jgd' || backend === 'auto'` checks
with a single helper.
@eitsupi
eitsupi merged commit cf75391 into master Sep 25, 2026
5 checks passed
@eitsupi
eitsupi deleted the fix/jgd-backend-switch-1756 branch September 25, 2026 23:37
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.

JGD sometimes requires VS Code to reload, not R restart to take effect

2 participants