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

Report Issue for Remote extensions doesn't work #176518

Merged
merged 1 commit into from Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 30 additions & 8 deletions src/vs/workbench/contrib/remote/browser/remote.ts
Expand Up @@ -22,7 +22,7 @@ import { VIEWLET_ID } from 'vs/workbench/contrib/remote/browser/remoteExplorer';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IViewDescriptor, IViewsRegistry, Extensions, ViewContainerLocation, IViewContainersRegistry, IViewDescriptorService } from 'vs/workbench/common/views';
import { Registry } from 'vs/platform/registry/common/platform';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { IExtensionDescription, IRelaxedExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
import { ICommandService } from 'vs/platform/commands/common/commands';
Expand Down Expand Up @@ -314,6 +314,20 @@ abstract class HelpItemBase implements IHelpItem {
this.iconClasses.push('remote-help-tree-node-item-icon');
}

protected async getActions(): Promise<{
label: string;
description: string;
extensionDescription: Readonly<IRelaxedExtensionDescription>;
}[]> {
return (await Promise.all(this.values.map(async (value) => {
return {
label: value.extensionDescription.displayName || value.extensionDescription.identifier.value,
description: await value.url,
extensionDescription: value.extensionDescription
};
}))).filter(item => item.description);
}

async handleClick() {
const remoteAuthority = this.environmentService.remoteAuthority;
if (remoteAuthority) {
Expand Down Expand Up @@ -351,13 +365,7 @@ abstract class HelpItemBase implements IHelpItem {
}

if (this.values.length > 1) {
const actions = (await Promise.all(this.values.map(async (value) => {
return {
label: value.extensionDescription.displayName || value.extensionDescription.identifier.value,
description: await value.url,
extensionDescription: value.extensionDescription
};
}))).filter(item => item.description);
const actions = await this.getActions();

if (actions.length) {
const action = await this.quickInputService.pick(actions, { placeHolder: nls.localize('pickRemoteExtension', "Select url to open") });
Expand Down Expand Up @@ -407,6 +415,20 @@ class IssueReporterItem extends HelpItemBase {
super(icon, label, values, quickInputService, environmentService, remoteExplorerService, workspaceContextService);
}

protected override async getActions(): Promise<{
label: string;
description: string;
extensionDescription: Readonly<IRelaxedExtensionDescription>;
}[]> {
return Promise.all(this.values.map(async (value) => {
return {
label: value.extensionDescription.displayName || value.extensionDescription.identifier.value,
description: '',
extensionDescription: value.extensionDescription
};
}));
}

protected async takeAction(extensionDescription: IExtensionDescription): Promise<void> {
await this.commandService.executeCommand('workbench.action.openIssueReporter', [extensionDescription.identifier.value]);
}
Expand Down