Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename packages.r.packageManager to packages.r.installer
Renames the setting key, shortens the enum descriptions, reworks the
top-level description, and scopes the setting to RESOURCE so it can be
overridden per workspace.

See #13606
  • Loading branch information
bricestacey committed May 27, 2026
commit f50e9bd5aebf9dbf2c8fcbe89ddd975586fb0f4a
10 changes: 5 additions & 5 deletions extensions/positron-r/src/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,13 @@ export class RPackageManager {
}

/**
* Read the configured R package manager preference.
* Read the configured R packages installer preference.
* 'auto' means: prefer pak, prompt to install it when missing, fall back to base on decline.
* 'pak' means: prefer pak, install it without prompting when missing.
* 'base' means: never use or install pak.
*/
private _getConfiguredPackageManager(): 'auto' | 'pak' | 'base' {
const value = vscode.workspace.getConfiguration('packages.r').get<string>('packageManager');
private _getConfiguredInstaller(): 'auto' | 'pak' | 'base' {
const value = vscode.workspace.getConfiguration('packages.r').get<string>('installer');
return value === 'pak' || value === 'base' ? value : 'auto';
}

Expand Down Expand Up @@ -324,14 +324,14 @@ export class RPackageManager {
}

/**
* Resolve which package manager to use, honoring the `packages.r.packageManager` setting.
* Resolve which installer to use, honoring the `packages.r.installer` setting.
*
* @param allowInstallPak When true (install/update operations), may install pak, either
* by prompting the user (setting: 'auto') or silently (setting: 'pak').
* When false (list/search/uninstall), only detects what is available.
*/
private async _resolveMethod(allowInstallPak: boolean): Promise<string> {
const setting = this._getConfiguredPackageManager();
const setting = this._getConfiguredInstaller();
if (setting === 'base') {
return 'base';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).regis
included: false,
tags: ['preview'],
},
'packages.r.packageManager': {
'packages.r.installer': {
type: 'string',
enum: ['auto', 'pak', 'base'],
enumDescriptions: [
nls.localize('positron.packages.r.packageManager.auto', "Use pak when it is already installed, otherwise prompt to install it; falls back to base R if the prompt is declined."),
nls.localize('positron.packages.r.packageManager.pak', "Always use pak. Install it automatically if it is not present."),
nls.localize('positron.packages.r.packageManager.base', "Always use base R (install.packages, update.packages, remove.packages). Never use or install pak."),
nls.localize('positron.packages.r.installer.auto', "Use pak if installed; otherwise prompt and fall back to base R."),
nls.localize('positron.packages.r.installer.pak', "Always use pak. Silently install it if missing."),
nls.localize('positron.packages.r.installer.base', "Always use base R."),
],
default: 'auto',
scope: ConfigurationScope.APPLICATION,
markdownDescription: nls.localize('positron.packages.r.packageManager', "Which R package manager to use for installing, updating, and removing R packages. Does not affect projects using renv, which always use renv."),
scope: ConfigurationScope.RESOURCE,
markdownDescription: nls.localize('positron.packages.r.installer', "Which package installer to use for installing, updating, and removing R packages. Does not affect projects using renv, which always use renv."),
tags: ['preview'],
}
}
Expand Down
Loading