-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Start to) handle cli hyperlinks in the terminal used for pkg dev tasks #5231
base: main
Are you sure you want to change the base?
Conversation
@@ -3,7 +3,7 @@ | |||
"displayName": "%displayName%", | |||
"description": "%description%", | |||
"version": "0.0.2", | |||
"publisher": "vscode", | |||
"publisher": "positron", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this should be the case for all extensions we (Positron) have introduced. Harder to say what should happen to VS Code built-in extensions that we modify, but worth thinking about.
The relevance to this PR is that the publisher
affects the form of URI that the associated extention (positron-r, in this case) is allowed to handle. The general form is:
{product-name}://{publisher}.{extension-name}
which means that positron-r can handle URIs that begin like so:
positron://positron.positron-r
{ | ||
"command": "r.cliHyperlinks", | ||
"category": "R", | ||
"title": "%r.command.cliHyperlinks.title%", | ||
"shortTitle": "%r.menu.cliHyperlinks.title%" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away. Purely a development convenience, before I modified cli the way I needed.
}, | ||
"enabledApiProposals": [ | ||
"terminalDataWriteEvent" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away. Purely a development convenience, when convincing myself that we could see OSC 8 hyperlinks.
@@ -12,6 +12,7 @@ | |||
"r.command.packageBuild.title": "Build R Package", | |||
"r.command.packageInstall.title": "Install R Package and Restart R", | |||
"r.command.packageTest.title": "Test R Package", | |||
"r.command.cliHyperlinks.title": "Emit cli hyperlinks", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away.
@@ -26,6 +27,7 @@ | |||
"r.menu.packageBuild.title": "Build R Package", | |||
"r.menu.packageInstall.title": "Install R Package and Restart R", | |||
"r.menu.packageTest.title": "Test R Package", | |||
"r.menu.cliHyperlinks.title": "Emit cli hyperlinks", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away.
vscode.commands.registerCommand('r.cliHyperlinks', async () => { | ||
const tasks = await getRPackageTasks(); | ||
const task = tasks.filter(task => task.definition.task === 'r.task.cliHyperlinks')[0]; | ||
const isInstalled = await checkInstalled(task.definition.pkg); | ||
if (isInstalled) { | ||
vscode.tasks.executeTask(task); | ||
} | ||
}), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away.
// Listen for terminal output | ||
const disposable = vscode.window.onDidWriteTerminalData(event => { | ||
processTerminalOutput(event.data); | ||
}); | ||
context.subscriptions.push(disposable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away. Purely a development convenience, when convincing myself that we could see OSC 8 hyperlinks.
}; | ||
|
||
const uriDetailsJson = JSON.stringify(uriDetails, null, 2); | ||
vscode.window.showInformationMessage(`URI Details:\n${uriDetailsJson}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away. A development convenience.
} | ||
}, | ||
{ | ||
task: 'r.task.cliHyperlinks', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will go away.
Still WIP, because negotiations need to happen with cli
Addresses #5218
QA Notes
none yet