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

uri trigger #799

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"onStartupFinished",
"workspaceContains:**/**.portalconfig",
"onDebug",
"onFileSystem:powerplatform-vfs"
"onFileSystem:powerplatform-vfs",
"onUri"
],
"capabilities": {
"untrustedWorkspaces": {
Expand Down
23 changes: 23 additions & 0 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,29 @@ export async function activate(
vscode.workspace.onDidOpenTextDocument(didOpenTextDocument);
vscode.workspace.textDocuments.forEach(didOpenTextDocument);

vscode.window.registerUriHandler({
handleUri(uri:vscode.Uri) {
const params = uri.query.split('&'); //'vscode://microsoft-IsvExpTools.powerplatform-vscode?org&siteid'
let org = '';
let siteid = '';
params.forEach(param => {
const pair = param.split('=');
switch (pair[0]){
case 'org':{
org = pair[1];
break;
}
case 'siteid':{
siteid = pair[1];
break;
}
}
});
vscode.commands.executeCommand("pacCLI.pacAuthCreate", org);
vscode.commands.executeCommand("pacCLI.pacPaportalDownload", siteid);
}
})

// portal web view panel
_context.subscriptions.push(
vscode.commands.registerCommand(
Expand Down
4 changes: 3 additions & 1 deletion src/client/lib/PacTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export class PacTerminal implements vscode.Disposable {
vscode.commands.registerCommand('pacCLI.pacAuthHelp', () => PacTerminal.getTerminal().sendText("pac auth help")),
vscode.commands.registerCommand('pacCLI.pacPackageHelp', () => PacTerminal.getTerminal().sendText("pac package help")),
vscode.commands.registerCommand('pacCLI.pacPcfHelp', () => PacTerminal.getTerminal().sendText("pac pcf help")),
vscode.commands.registerCommand('pacCLI.pacSolutionHelp', () => PacTerminal.getTerminal().sendText("pac solution help")));
vscode.commands.registerCommand('pacCLI.pacSolutionHelp', () => PacTerminal.getTerminal().sendText("pac solution help")),
vscode.commands.registerCommand('pacCLI.pacAuthCreate', (orgUrl) => PacTerminal.getTerminal().sendText("pac auth create -u " + orgUrl)),
vscode.commands.registerCommand('pacCLI.pacPaportalDownload', (websiteId) => PacTerminal.getTerminal().sendText(`pac paportal download -id ${websiteId} -p . -o`)));

this._cmdDisposables.push(vscode.commands.registerCommand(`pacCLI.enableTelemetry`, async () => {
const result = await this._pacWrapper.enableTelemetry();
Expand Down
Loading