Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the temporary feature flag
Browse files Browse the repository at this point in the history
jennybc committed Dec 21, 2024
1 parent e323be7 commit e0c3be7
Showing 3 changed files with 1 addition and 22 deletions.
6 changes: 0 additions & 6 deletions extensions/positron-r/package.json
Original file line number Diff line number Diff line change
@@ -273,12 +273,6 @@
"default": [],
"description": "%r.configuration.extraArguments.description%"
},
"positron.r.taskHyperlinks": {
"scope": "window",
"type": "boolean",
"default": false,
"description": "%r.configuration.taskHyperlinks.description%"
},
"positron.r.defaultRepositories": {
"scope": "window",
"type": "string",
1 change: 0 additions & 1 deletion extensions/positron-r/package.nls.json
Original file line number Diff line number Diff line change
@@ -59,7 +59,6 @@
"r.configuration.pipe.native.description": "Native pipe available in R >= 4.1",
"r.configuration.pipe.magrittr.description": "Pipe operator from the magrittr package, re-exported by many other packages",
"r.configuration.diagnostics.enable.description": "Enable R diagnostics globally",
"r.configuration.taskHyperlinks.description": "Turn on experimental support for hyperlinks in package development tasks",
"r.configuration.defaultRepositories.description": "The default repositories to use for R package installation, if no repository is otherwise specified in R startup scripts (restart Positron to apply).\n\nThe default repositories will be set as the `repos` option in R.",
"r.configuration.defaultRepositories.auto.description": "Automatically choose a default repository, or use a repos.conf file if it exists.",
"r.configuration.defaultRepositories.rstudio.description": "Use the RStudio CRAN mirror (cran.rstudio.com)",
16 changes: 1 addition & 15 deletions extensions/positron-r/src/uri-handler.ts
Original file line number Diff line number Diff line change
@@ -5,26 +5,13 @@

import * as vscode from 'vscode';

import { LOGGER } from './extension';
import { RSessionManager } from './session-manager';
import { EnvVar, RSession } from './session';

export async function registerUriHandler() {
vscode.window.registerUriHandler({ handleUri });
}

// Temporary feature flag to finesse the fact that cli hyperlinks are either all ON or all OFF.
// cli 3.6.3.9001 gained support for configuring the URL format of run/help/vignette hyperlinks.
// But file hyperlinks are not yet configurable and will delegate to operating system.
// If the user still has RStudio as the app associated with .R files, it will open in RStudio.
// Flag will be removed once cli can be configured to emit positron://file/... hyperlinks.
function taskHyperlinksEnabled(): boolean {
const extConfig = vscode.workspace.getConfiguration('positron.r');
const taskHyperlinksEnabled = extConfig.get<boolean>('taskHyperlinks');

return taskHyperlinksEnabled === true;
}

// Example of a URI we expect to handle:
// positron://positron.positron-r/cli?command=x-r-run:testthat::snapshot_review('snap')
//
@@ -72,11 +59,10 @@ export async function prepCliEnvVars(session?: RSession): Promise<EnvVar> {
return {};
}

const taskHyperlinks = taskHyperlinksEnabled();
const cliPkg = await session.packageVersion('cli', '3.6.3.9002');
const cliSupportsHyperlinks = cliPkg?.compatible ?? false;

if (!taskHyperlinks || !cliSupportsHyperlinks) {
if (!cliSupportsHyperlinks) {
// eslint-disable-next-line @typescript-eslint/naming-convention
return { R_CLI_HYPERLINKS: 'FALSE' };
}

0 comments on commit e0c3be7

Please sign in to comment.