Skip to content

Allow issue service to display a bug report window when remote extension host is crashed #116896

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

Merged
merged 3 commits into from
Feb 22, 2021
Merged
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
53 changes: 34 additions & 19 deletions src/vs/workbench/contrib/issue/electron-sandbox/issueService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,40 @@ export class WorkbenchIssueService implements IWorkbenchIssueService {
) { }

async openReporter(dataOverrides: Partial<IssueReporterData> = {}): Promise<void> {
const extensions = await this.extensionManagementService.getInstalled();
const enabledExtensions = extensions.filter(extension => this.extensionEnablementService.isEnabled(extension) || (dataOverrides.extensionId && extension.identifier.id === dataOverrides.extensionId));
const extensionData = enabledExtensions.map((extension): IssueReporterExtensionData => {
const { manifest } = extension;
const manifestKeys = manifest.contributes ? Object.keys(manifest.contributes) : [];
const isTheme = !manifest.activationEvents && manifestKeys.length === 1 && manifestKeys[0] === 'themes';
const isBuiltin = extension.type === ExtensionType.System;
return {
name: manifest.name,
publisher: manifest.publisher,
version: manifest.version,
repositoryUrl: manifest.repository && manifest.repository.url,
bugsUrl: manifest.bugs && manifest.bugs.url,
displayName: manifest.displayName,
id: extension.identifier.id,
isTheme,
isBuiltin,
};
});
const extensionData: IssueReporterExtensionData[] = [];
try {
const extensions = await this.extensionManagementService.getInstalled();
const enabledExtensions = extensions.filter(extension => this.extensionEnablementService.isEnabled(extension) || (dataOverrides.extensionId && extension.identifier.id === dataOverrides.extensionId));
extensionData.push(...enabledExtensions.map((extension): IssueReporterExtensionData => {
const { manifest } = extension;
const manifestKeys = manifest.contributes ? Object.keys(manifest.contributes) : [];
const isTheme = !manifest.activationEvents && manifestKeys.length === 1 && manifestKeys[0] === 'themes';
const isBuiltin = extension.type === ExtensionType.System;
return {
name: manifest.name,
publisher: manifest.publisher,
version: manifest.version,
repositoryUrl: manifest.repository && manifest.repository.url,
bugsUrl: manifest.bugs && manifest.bugs.url,
displayName: manifest.displayName,
id: extension.identifier.id,
isTheme,
isBuiltin,
};
}));
} catch (e) {
extensionData.push({
name: 'Workbench Issue Service',
publisher: 'Unknown',
version: '0.0.0',
repositoryUrl: undefined,
bugsUrl: undefined,
displayName: `Extensions not loaded: ${e}`,
id: 'workbench.issue',
isTheme: false,
isBuiltin: true
});
}
const experiments = await this.experimentService.getCurrentExperiments();
const githubSessions = await this.authenticationService.getSessions('github');
const potentialSessions = githubSessions.filter(session => session.scopes.includes('repo'));
Expand Down