Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion R/vsc.R
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ options(

# rstudioapi
rstudioapi_enabled <- function() {
isTRUE(getOption("vsc.rstudioapi"))
isTRUE(getOption("vsc.rstudioapi", TRUE))
}

if (rstudioapi_enabled()) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@
},
"r.session.emulateRStudioAPI": {
"type": "boolean",
"default": false,
"default": true,
"markdownDescription": "Emulate the RStudio API for addin support and other {rstudioapi} calls. Changes the option `vsc.rstudioapi` in R. Requires `#r.sessionWatcher#` to be set to `true`."
},
"r.session.viewers.viewColumn": {
Expand Down
8 changes: 5 additions & 3 deletions src/rstudioapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export function projectPath(): { path: string; } {
}
}

// if we got to here either:
// if we got to here either:
// - the workspaceFolders array was undefined (no folder open)
// - the activeText editor was an unsaved document, which has undefined workspace folder.
// return undefined and handle with a message in R.
Expand Down Expand Up @@ -317,10 +317,12 @@ export function purgeAddinPickerItems(): void {
export async function launchAddinPicker(): Promise<void> {

if (!config().get<boolean>('sessionWatcher')) {
throw ('{rstudioapi} emulation requires session watcher to be enabled in extension config.');
void window.showErrorMessage('{rstudioapi} emulation requires session watcher to be enabled in extension config.');
return;
}
if (!sessionDirectoryExists()) {
throw ('No active R terminal session, attach one to use RStudio addins.');
void window.showErrorMessage('No active R terminal session, attach one to use RStudio addins.');
return;
}

const addinPickerOptions: QuickPickOptions = {
Expand Down