Skip to content

Commit b3c5202

Browse files
authored
refactor!: clean up 3.0 manifest and console configuration (#1762)
## Summary Clean up obsolete command and configuration surfaces for 3.0 while preserving supported legacy settings and viewer-local controls. - Remove obsolete Live Share contributions, unused session settings, the retired `~/.vscode-R/settings.json` writer, unused WebSocket/help-path compatibility code, and the unconsumed `SESS_USE_HTTPGD` environment variable. Plot backend selection continues through `SESS_PLOT_BACKEND`. Existing user files remain intact. Wrap the built-in WebView Find action with `r.webview.find` and remove the dead activation event. - Add `r.consoleArgs` and `r.consoleSendDelay`, deprecating their old names. Resolve canonical and legacy settings by workspace folder (where supported), workspace, then user scope for console and executable settings; plot-backend settings use workspace then user scope. Prefer the canonical name within each scope. Retain file resources for configuration and variable substitution, use the workspace directory as terminal cwd, and preserve the terminal's configuration resource across restart. For profile terminals with a string cwd, recover the matching workspace URI before resolving settings, preserving remote scheme/authority and workspace-folder send delays. - Report unresolved console executables once with the relevant setting name. Clarify bare executable names in `r.consolePath` and compatibility behavior for `r.plot.backend`. - Resolve sess help notifications using `r.session.viewers.viewColumn.helpPanel` in the extension, including `Disable`; remove the obsolete R-side help-viewer option and its notification field. Explicitly document the removal of Live Share integration in the 3.0 changelog, update the sess documentation, and make the README installation command usable in PowerShell. - Hide 15 contextual `r.plot.*` commands from the Command Palette using `when: "false"` because they are viewer-local actions exposed through the httpgd toolbar or jgd controls; the commands remain registered for toolbar, webview command URI, and custom keybinding use. Do not gate them with `r.plot.active`, which is currently maintained only by httpgd and would make Command Palette availability inconsistent for jgd. Keep `r.plot.showViewers` discoverable because it reopens closed jgd/httpgd panels with their existing plots. Retain the httpgd toolbar contributions and runtime handlers, including navigation, hide/close/reset, zoom, style/layout, export, and URL/external-browser actions, plus the viewer-specific `showIndex` / `hidePlot` webview command URIs.
1 parent 8eb421a commit b3c5202

25 files changed

Lines changed: 783 additions & 185 deletions

‎CHANGELOG.md‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ detected.
1313

1414
### Bug Fixes
1515

16+
* fix(console): use the workspace directory as terminal cwd when given a file URI
17+
* fix(console): preserve remote workspace configuration for R terminals created from the terminal profile
18+
1619
* fix(sess): clean up failed runtime and server initialization and preserve the selected terminal during reconnect
1720

1821
* fix(sess): share server startup across concurrent session clients and wait for startup during shutdown
@@ -24,12 +27,11 @@ detected.
2427
* fix(sess): reconnect managed R sessions after window reload and prioritize manual recovery of the selected R terminal
2528

2629
* fix(rstudioapi): resolve emulation issues and viewer routing
27-
* fix(liveshare): resolve activation errors, file reading bugs, and add hooks for sess compatibility
2830
* fix(workspace): fix code submission delays when the workspace contains many or large objects
2931

3032
### Features
3133

32-
* feat(sess): migrate session watcher to WebSockets/JSON-RPC 2.0
34+
* feat(sess): migrate session watcher to Unix domain sockets / Windows named pipes with JSON Lines framing and JSON-RPC 2.0
3335
* feat: implement rstudioapi::showPrompt() and rstudioapi::askForPassword() for sess package
3436
* feat: evaluate params from YAML header in Rmd files before running code
3537
* feat: check sess package version and prompt for update
@@ -46,10 +48,18 @@ detected.
4648

4749
### Other
4850

51+
* Hide context-dependent plot commands from the Command Palette while keeping the Show Viewers command discoverable for reopening plot viewers and retaining viewer-local controls.
52+
53+
* Remove Live Share integration, including its commands and settings. Remove other obsolete session settings that are no longer consumed.
54+
* Stop writing `~/.vscode-R/settings.json`; the current sess protocol no longer reads the propagated configuration. Remove the unused WebSocket server compatibility function, the unused `SESS_USE_HTTPGD` environment variable, and the path override argument left by the removed help-path setting.
4955
* Remove the unused `r.workspaceViewer.showObjectSize` setting and obsolete object-size tooltip support
5056
* Remove obsolete `r.session.objectLengthLimit`, `r.session.objectTimeout`, and `r.session.levelOfObjectDetail` settings following the switch to on-demand workspace inspection
5157
* Remove `r.helpPanel.rpath`, which was previously deprecated and no longer used by the extension
5258

59+
### Configuration
60+
61+
* Add `r.consoleArgs` and `r.consoleSendDelay` as canonical settings, with legacy `r.rterm.option` and `r.rtermSendDelay` deprecated and supported for backward compatibility. Resolve renamed console and executable-path settings by workspace folder (where supported), workspace, then user scope; plot-backend settings use workspace then user scope. Prefer the canonical name within each scope. Empty paths and automatic backend selection retain their fallback behavior.
62+
5363
### Styling
5464

5565
* style: fix line length lint error in sess/R/rstudioapi.R

‎README.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ is missing or outdated, so no manual setup is needed.
4545
pre-release is rebuilt from every push to `main`. Download and install it:
4646

4747
```sh
48-
curl -fsSL -o vscode-R.vsix \
49-
https://github.com/REditorSupport/vscode-R/releases/download/latest/vscode-R.vsix
48+
curl -fsSL -o vscode-R.vsix https://github.com/REditorSupport/vscode-R/releases/download/latest/vscode-R.vsix
5049
code --install-extension vscode-R.vsix
5150
```
5251

@@ -59,14 +58,14 @@ is missing or outdated, so no manual setup is needed.
5958
Steps 1–3 above are all that's required to get started with R in VS Code. But we also recommend the following software for a fully optimized R + VS Code experience:
6059
6160
* Install an interactive plotting backend for a better R graphics experience:
62-
* [jgd](https://github.com/grantmcdermott/jgd): Lightweight JSON graphics device with native vscode-R integration.
63-
* [httpgd](https://github.com/nx10/httpgd): SVG-based graphics device served via HTTP and WebSockets.
61+
* [jgd](https://github.com/grantmcdermott/jgd): Lightweight JSON graphics device with native vscode-R integration.
62+
* [httpgd](https://github.com/nx10/httpgd): SVG-based graphics device served via HTTP and WebSockets.
6463
6564
* [arf](https://github.com/eitsupi/arf): A modern R console with many features: syntax highlighting, multiline editing, vi/emacs keybindings, R version switching, etc. Successor to [radian](https://github.com/randy3k/radian) written in Rust.
6665
6766
* Complementary VS Code extensions:
68-
* [Quarto](https://marketplace.visualstudio.com/items?itemName=quarto.quarto): the official Quarto plugin for VS Code.
69-
* [VSCode-R-Debugger](https://github.com/ManuelHentschel/VSCode-R-Debugger): enables VS Code's debugging facilities for R scripts.
67+
* [Quarto](https://marketplace.visualstudio.com/items?itemName=quarto.quarto): the official Quarto plugin for VS Code.
68+
* [VSCode-R-Debugger](https://github.com/ManuelHentschel/VSCode-R-Debugger): enables VS Code's debugging facilities for R scripts.
7069

7170
For example, assuming that you have installed `arf` and `jgd`, your user `settings.json` might include:
7271

‎package.json‎

Lines changed: 94 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
},
3131
"activationEvents": [
3232
"workspaceContains:**/*.{rproj,Rproj,r,R,rd,Rd,rmd,Rmd}",
33-
"onCommand:r.runSelectionInActiveTerm",
3433
"onWebviewPanel:rhelp",
3534
"onLanguage:r",
3635
"onLanguage:rmd"
@@ -178,16 +177,6 @@
178177
}
179178
],
180179
"commands": [
181-
{
182-
"command": "r.liveShare.toggle",
183-
"title": "Toggle Live Share",
184-
"category": "R"
185-
},
186-
{
187-
"command": "r.liveShare.retry",
188-
"title": "Retry Live Share",
189-
"category": "R"
190-
},
191180
{
192181
"command": "r.workspaceViewer.refreshEntry",
193182
"title": "Manual Refresh",
@@ -250,7 +239,7 @@
250239
"category": "R"
251240
},
252241
{
253-
"command": "editor.action.webvieweditor.showFind",
242+
"command": "r.webview.find",
254243
"title": "R: Find in WebView",
255244
"icon": "$(search)",
256245
"category": "R"
@@ -856,6 +845,66 @@
856845
],
857846
"menus": {
858847
"commandPalette": [
848+
{
849+
"command": "r.plot.toggleStyle",
850+
"when": "false"
851+
},
852+
{
853+
"command": "r.plot.toggleFullWindow",
854+
"when": "false"
855+
},
856+
{
857+
"command": "r.plot.togglePreviewPlots",
858+
"when": "false"
859+
},
860+
{
861+
"command": "r.plot.exportPlot",
862+
"when": "false"
863+
},
864+
{
865+
"command": "r.plot.closePlot",
866+
"when": "false"
867+
},
868+
{
869+
"command": "r.plot.hidePlot",
870+
"when": "false"
871+
},
872+
{
873+
"command": "r.plot.resetPlots",
874+
"when": "false"
875+
},
876+
{
877+
"command": "r.plot.prevPlot",
878+
"when": "false"
879+
},
880+
{
881+
"command": "r.plot.nextPlot",
882+
"when": "false"
883+
},
884+
{
885+
"command": "r.plot.firstPlot",
886+
"when": "false"
887+
},
888+
{
889+
"command": "r.plot.lastPlot",
890+
"when": "false"
891+
},
892+
{
893+
"command": "r.plot.zoomIn",
894+
"when": "false"
895+
},
896+
{
897+
"command": "r.plot.zoomOut",
898+
"when": "false"
899+
},
900+
{
901+
"command": "r.plot.openUrl",
902+
"when": "false"
903+
},
904+
{
905+
"command": "r.plot.openExternal",
906+
"when": "false"
907+
},
859908
{
860909
"command": "r.workspaceViewer.view",
861910
"when": "false"
@@ -943,10 +992,6 @@
943992
{
944993
"command": "r.helpPanel.openForPath",
945994
"when": "false"
946-
},
947-
{
948-
"command": "r.liveShare.toggle",
949-
"when": "false"
950995
}
951996
],
952997
"editor/title/run": [
@@ -1002,12 +1047,12 @@
10021047
"group": "navigation"
10031048
},
10041049
{
1005-
"command": "editor.action.webvieweditor.showFind",
1050+
"command": "r.webview.find",
10061051
"when": "resourceScheme =~ /webview/ && r.browser.active",
10071052
"group": "navigation"
10081053
},
10091054
{
1010-
"command": "editor.action.webvieweditor.showFind",
1055+
"command": "r.webview.find",
10111056
"when": "resourceScheme =~ /webview/ && r.helpPanel.active",
10121057
"group": "navigation"
10131058
},
@@ -1203,22 +1248,18 @@
12031248
"command": "r.helpPanel.summarizeTopics",
12041249
"group": "inline@8",
12051250
"when": "view == rHelpPages && viewItem =~ /_summarizeTopics_/"
1206-
},
1207-
{
1208-
"command": "r.liveShare.toggle",
1209-
"when": "view == rLiveShare"
12101251
}
12111252
],
12121253
"view/title": [
12131254
{
12141255
"command": "r.workspaceViewer.load",
12151256
"group": "navigation@0",
1216-
"when": "r.WorkspaceViewer:show && view == workspaceViewer && !r.liveShare:isGuest"
1257+
"when": "r.WorkspaceViewer:show && view == workspaceViewer"
12171258
},
12181259
{
12191260
"command": "r.workspaceViewer.save",
12201261
"group": "navigation@1",
1221-
"when": "r.WorkspaceViewer:show && view == workspaceViewer && !r.liveShare:isGuest"
1262+
"when": "r.WorkspaceViewer:show && view == workspaceViewer"
12221263
},
12231264
{
12241265
"command": "r.workspaceViewer.clear",
@@ -1234,11 +1275,6 @@
12341275
"command": "r.helpPanel.showQuickPick",
12351276
"group": "navigation",
12361277
"when": "view == rHelpPages"
1237-
},
1238-
{
1239-
"command": "r.liveShare.retry",
1240-
"group": "navigation@3",
1241-
"when": "view == rLiveShare && r.liveShare:aborted"
12421278
}
12431279
],
12441280
"explorer/context": [
@@ -1294,7 +1330,7 @@
12941330
"type": "string",
12951331
"default": "",
12961332
"scope": "machine-overridable",
1297-
"markdownDescription": "Absolute or substituted path to the executable used to launch the interactive R console, or an executable name available on `PATH`. Alternative consoles such as arf (or radian) are supported. The supported substitutions are `${userHome}`, `${workspaceFolder}`, `${fileWorkspaceFolder}`, and `${fileDirname}`."
1333+
"markdownDescription": "Use an absolute or substituted path, or a bare executable name such as `R`, `arf`, or `radian` resolved from `PATH` to launch the interactive R console. The supported substitutions are `${userHome}`, `${workspaceFolder}`, `${fileWorkspaceFolder}`, and `${fileDirname}`."
12981334
},
12991335
"r.rpath.windows": {
13001336
"type": "string",
@@ -1345,6 +1381,20 @@
13451381
"--no-restore"
13461382
],
13471383
"description": "R command line options.",
1384+
"markdownDeprecationMessage": "Deprecated. Use `#r.consoleArgs#` instead.",
1385+
"deprecationMessage": "Deprecated. Use r.consoleArgs instead.",
1386+
"items": {
1387+
"type": "string"
1388+
}
1389+
},
1390+
"r.consoleArgs": {
1391+
"type": "array",
1392+
"default": [
1393+
"--no-save",
1394+
"--no-restore"
1395+
],
1396+
"scope": "machine-overridable",
1397+
"description": "Arguments passed to the interactive R console.",
13481398
"items": {
13491399
"type": "string"
13501400
}
@@ -1618,11 +1668,6 @@
16181668
"default": true,
16191669
"description": "Enable R session watcher. Required for workspace viewer and most features to work with an R session. Restart required to take effect."
16201670
},
1621-
"r.session.useWebServer": {
1622-
"type": "boolean",
1623-
"default": false,
1624-
"markdownDescription": "Enable experimental use of web server in the R session to handle session requests from the extension. Requires `#r.sessionWatcher#` to be set to `true`. Requires the `httpuv` R package."
1625-
},
16261671
"r.session.watchGlobalEnvironment": {
16271672
"type": "boolean",
16281673
"default": true,
@@ -1633,11 +1678,6 @@
16331678
"default": true,
16341679
"markdownDescription": "Emulate the RStudio API for addin support and other {rstudioapi} calls. Requires `#r.sessionWatcher#` to be set to `true`."
16351680
},
1636-
"r.session.data.rowLimit": {
1637-
"type": "integer",
1638-
"default": 0,
1639-
"markdownDescription": "The maximum number of rows to be displayed in the data viewer. `0` means no limit. Changes the option `sess.row_limit` in R. Requires `#r.sessionWatcher#` to be set to `true`."
1640-
},
16411681
"r.session.data.pageSize": {
16421682
"type": "integer",
16431683
"default": 500,
@@ -1725,7 +1765,7 @@
17251765
},
17261766
"view": {
17271767
"type": "string",
1728-
"description": "Which view column to show the WebView triggered by View()? \n\nChanges the option 'sess.dataview' in R.",
1768+
"description": "Which view column to show the WebView triggered by View()?",
17291769
"enum": [
17301770
"Two",
17311771
"Active",
@@ -1742,7 +1782,7 @@
17421782
},
17431783
"helpPanel": {
17441784
"type": "string",
1745-
"description": "Which view column to show the WebView triggered by the help panel? \n\nChanges the option 'sess.helpPanel' in R.",
1785+
"description": "Which view column to show the WebView triggered by the help panel?",
17461786
"enum": [
17471787
"Two",
17481788
"Active",
@@ -1763,7 +1803,15 @@
17631803
"r.rtermSendDelay": {
17641804
"type": "integer",
17651805
"default": 8,
1766-
"markdownDescription": "Delay in milliseconds before sending each line to rterm. Requires `#r.bracketedPaste#` to be `false`."
1806+
"markdownDescription": "Delay in milliseconds before sending each line to the R console. Requires `#r.bracketedPaste#` to be `false`.",
1807+
"markdownDeprecationMessage": "Deprecated. Use `#r.consoleSendDelay#` instead.",
1808+
"deprecationMessage": "Deprecated. Use r.consoleSendDelay instead."
1809+
},
1810+
"r.consoleSendDelay": {
1811+
"type": "integer",
1812+
"default": 8,
1813+
"scope": "machine-overridable",
1814+
"markdownDescription": "Delay in milliseconds before sending each line to the R console. Requires `#r.bracketedPaste#` to be `false`."
17671815
},
17681816
"r.workspaceViewer.removeHiddenItems": {
17691817
"type": "boolean",
@@ -1775,29 +1823,9 @@
17751823
"default": true,
17761824
"description": "Prompt the user for confirmation when clearing the workspace."
17771825
},
1778-
"r.liveShare.timeout": {
1779-
"type": "integer",
1780-
"default": 10000,
1781-
"description": "Time in milliseconds before aborting attempt to connect to Live Share API."
1782-
},
1783-
"r.liveShare.defaults.commandForward": {
1784-
"type": "boolean",
1785-
"default": false,
1786-
"description": "Default boolean value for guest command forwarding."
1787-
},
1788-
"r.liveShare.defaults.shareWorkspace": {
1789-
"type": "boolean",
1790-
"default": true,
1791-
"description": "Default boolean value for sharing the R workspace with guests."
1792-
},
1793-
"r.liveShare.defaults.shareBrowser": {
1794-
"type": "boolean",
1795-
"default": false,
1796-
"description": "Default boolean value for automatically sharing R browser ports with guests."
1797-
},
17981826
"r.plot.devArgs": {
17991827
"type": "object",
1800-
"markdownDescription": "Supplementary arguments for the rendering device (for example, `png()` or `svglite()`) used by the `standard` plot backend. This setting is ignored by the `httpgd` and `jgd` backends. Width and height are managed dynamically by the responsive viewer and will be overridden.\n\nChanges the option `sess.devArgs` in R.",
1828+
"markdownDescription": "Supplementary arguments for the rendering device (for example, `png()` or `svglite()`) used by the `standard` plot backend. This setting is ignored by the `httpgd` and `jgd` backends. Width and height are managed dynamically by the responsive viewer and will be overridden.",
18011829
"default": {
18021830
"width": 800,
18031831
"height": 1200
@@ -1831,7 +1859,7 @@
18311859
"r.plot.useHttpgd": {
18321860
"type": "boolean",
18331861
"default": false,
1834-
"markdownDescription": "Legacy compatibility setting for selecting the httpgd plot viewer. When `#r.plot.backend#` is `auto`, setting this to `true` selects the `httpgd` backend. An explicit `#r.plot.backend#` value takes precedence.\n\nRequires the `httpgd` R package version 1.2.0 or later.",
1862+
"markdownDescription": "Legacy compatibility setting for selecting the httpgd plot viewer. When `#r.plot.backend#` is `auto`, setting this to `true` selects the `httpgd` backend. Workspace settings take precedence over user settings. Within the same scope, an explicit `#r.plot.backend#` value takes precedence.\n\nRequires the `httpgd` R package version 1.2.0 or later.",
18351863
"markdownDeprecationMessage": "Deprecated: use `#r.plot.backend#` instead. This setting is retained for compatibility with existing configurations but will be removed in a future release.",
18361864
"deprecationMessage": "Deprecated: use r.plot.backend instead. This setting is retained for compatibility with existing configurations but will be removed in a future release."
18371865
},
@@ -1850,7 +1878,7 @@
18501878
"httpgd-based interactive plot viewer (requires `httpgd` R package)",
18511879
"JGD-based interactive plot viewer (requires `jgd` R package)"
18521880
],
1853-
"markdownDescription": "The canonical setting for selecting the plot backend.\n\nWhen set to `auto`, the best available backend is used (JGD if installed, then httpgd, then standard). For compatibility, setting `#r.plot.useHttpgd#` to `true` selects httpgd while this setting remains `auto`; an explicit backend value takes precedence."
1881+
"markdownDescription": "The canonical setting for selecting the plot backend.\n\nWhen set to `auto`, the best available backend is used (JGD if installed, then httpgd, then standard). For backwards compatibility, setting `#r.plot.useHttpgd#` to `true` selects httpgd while this setting remains `auto`; workspace settings take precedence over user settings, with an explicit backend value preferred within the same scope."
18541882
},
18551883
"r.plot.jgd.historyLimit": {
18561884
"type": "number",

‎sess/R/hooks.R‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ runtime_start <- function(use_rstudioapi = TRUE, use_httpgd = TRUE, use_jgd = FA
145145
pkgname <- basename(dirname(dirname(file)))
146146
requestPath <- paste0("/library/", pkgname, "/html/", basename(file), ".html")
147147
notify_client("help", list(
148-
requestPath = requestPath,
149-
viewer = getOption("sess.helpPanel", "Two")
148+
requestPath = requestPath
150149
))
151150
} else {
152151
utils:::print.help_files_with_topic(x, ...)
@@ -162,8 +161,7 @@ runtime_start <- function(use_rstudioapi = TRUE, use_httpgd = TRUE, use_jgd = FA
162161
if (length(x) >= 1) {
163162
requestPath <- paste0("/doc/html/Search?pattern=", tools:::escapeAmpersand(x$pattern))
164163
notify_client("help", list(
165-
requestPath = requestPath,
166-
viewer = getOption("sess.helpPanel", "Two")
164+
requestPath = requestPath
167165
))
168166
} else {
169167
utils:::print.hsearch(x, ...)

0 commit comments

Comments
 (0)