Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented Oct 31, 2024

Still WIP, because negotiations need to happen with cli

Addresses #5218

QA Notes

none yet

@@ -3,7 +3,7 @@
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.2",
"publisher": "vscode",
"publisher": "positron",
Copy link
Member Author

@jennybc jennybc Oct 31, 2024

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

Comment on lines +90 to +95
{
"command": "r.cliHyperlinks",
"category": "R",
"title": "%r.command.cliHyperlinks.title%",
"shortTitle": "%r.menu.cliHyperlinks.title%"
},
Copy link
Member Author

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.

Comment on lines +663 to +666
},
"enabledApiProposals": [
"terminalDataWriteEvent"
]
Copy link
Member Author

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",
Copy link
Member Author

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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will go away.

Comment on lines +121 to +129
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);
}
}),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will go away.

Comment on lines +48 to +52
// Listen for terminal output
const disposable = vscode.window.onDidWriteTerminalData(event => {
processTerminalOutput(event.data);
});
context.subscriptions.push(disposable);
Copy link
Member Author

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}`);
Copy link
Member Author

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',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will go away.

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.

1 participant