Skip to content

feat!: simplify R executable / console path settings - #1735

Open
eitsupi wants to merge 3 commits into
masterfrom
refactor/r-executable-settings
Open

eitsupi wants to merge 3 commits into
masterfrom
refactor/r-executable-settings

Conversation

@eitsupi

@eitsupi eitsupi commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Close #597
Close #1437
Supersede #1625

Related to #1130

Summary

  • add r.executablePath as the canonical vanilla R executable for language-server and other background processes
  • add r.consolePath as the canonical interactive console executable, including bare executable names resolved from PATH (for example, arf or radian)
  • formally deprecate the six platform-specific r.rpath.<platform> and r.rterm.<platform> settings while preserving them as compatibility inputs
  • remove the unreleased r.rterm.preferredConsoles setting and the previously deprecated, unused r.helpPanel.rpath setting
  • add host-independent regression coverage for precedence, PATH and registry discovery, substitutions, quoting, and workspace edge cases
  • resolve executable settings and ${workspaceFolder} against the relevant workspace or document resource when one is available

Why these names?

The names follow the convention used by other VS Code language extensions: for example, Python uses python.defaultInterpreterPath, Julia uses julia.executablePath, and Ruby LSP uses rubyLsp.rubyExecutablePath. executablePath clearly identifies the vanilla executable used by the extension, while the parallel consolePath name preserves vscode-R's important distinction between background R and an alternative interactive console.

We cannot use the shorter r.rpath and r.rterm while retaining their legacy platform-specific children: VS Code treats dotted configuration identifiers hierarchically, so scalar parent settings conflict with r.rpath.windows, r.rterm.linux, and the other existing keys. The Path suffix also makes clear that these settings select an executable location (including a name resolved from PATH), rather than configuring console behavior more broadly.

Resolution rules

Background/vanilla R resolves in this order:

  1. r.executablePath
  2. legacy r.rpath.<current platform>
  3. R on PATH
  4. Windows registry InstallPath (Windows only)

The interactive console resolves in this order:

  1. r.consolePath
  2. legacy r.rterm.<current platform>
  3. an explicitly configured r.executablePath
  4. system R (PATH, then the Windows registry)

The distinction between background R and the interactive console remains intentional: background processes never use r.consolePath or legacy r.rterm.<platform>. Also, a legacy r.rpath.<platform> override does not begin controlling the console; only the new canonical r.executablePath can provide that default.

Both canonical settings use machine-overridable scope because executable locations are machine-dependent while workspace overrides remain useful. Relevant terminal, language-server, task, R Markdown, C++ properties, and command call sites now pass their workspace or document URI so folder-level settings and ${workspaceFolder} substitution use the same resource. Empty values are treated as unset. Explicit but unavailable values fail instead of silently selecting a different executable.

Historical compatibility

The old settings were split by OS when defaults were hard-coded installation paths. The resolver keeps the later discovery behavior added for real-world installations:

The platform-specific settings remain supported for backward compatibility but are deprecated in favor of the canonical settings and may be removed in a future release.

Scope boundaries and deliberate follow-ups

  • .github/ISSUE_TEMPLATE/bug_report.md intentionally remains unchanged even though it contains legacy setting examples. The template needs a broader rewrite, which will be handled separately rather than partially updating it in this PR.
  • This PR makes executable configuration lookup resource-aware, but does not introduce a complete per-folder runtime lifecycle. In particular, it does not restart the help subsystem when the active folder changes or redesign single-/multi-server LSP lifecycle behavior.

@eitsupi eitsupi changed the title refactor(config): simplify R executable settings feat!: simplify R executable settings Sep 19, 2026
@eitsupi eitsupi added this to the 3.0.0 milestone Sep 19, 2026
@eitsupi
eitsupi marked this pull request as draft September 19, 2026 09:43
@eitsupi eitsupi changed the title feat!: simplify R executable settings feat!: simplify R executable / console path settings Sep 19, 2026
@eitsupi
eitsupi marked this pull request as ready for review September 19, 2026 10:04
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.

Executable name is resolved as relative terminal path Combine rterm/rpath settings for different operating systems?

1 participant