Skip to content

Commit

Permalink
Merge pull request #103891 from bamurtaugh/bamurtaugh/install-debug-e…
Browse files Browse the repository at this point in the history
…xtension

Add "Install Debug Extension(s)" Action
  • Loading branch information
isidorn authored Aug 13, 2020
2 parents aa6e57d + fa0a611 commit 2e2f69d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/vs/workbench/contrib/debug/browser/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { parse, getFirstFrame } from 'vs/base/common/console';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IAction } from 'vs/base/common/actions';
import { IAction, Action } from 'vs/base/common/actions';
import { deepClone, equals } from 'vs/base/common/objects';
import { DebugSession } from 'vs/workbench/contrib/debug/browser/debugSession';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
Expand All @@ -46,6 +46,7 @@ import { generateUuid } from 'vs/base/common/uuid';
import { DebugStorage } from 'vs/workbench/contrib/debug/common/debugStorage';
import { DebugTelemetry } from 'vs/workbench/contrib/debug/common/debugTelemetry';
import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot';
import { ICommandService } from 'vs/platform/commands/common/commands';

export class DebugService implements IDebugService {
declare readonly _serviceBrand: undefined;
Expand Down Expand Up @@ -87,7 +88,8 @@ export class DebugService implements IDebugService {
@IFileService private readonly fileService: IFileService,
@IConfigurationService private readonly configurationService: IConfigurationService,
@IExtensionHostDebugService private readonly extensionHostDebugService: IExtensionHostDebugService,
@IActivityService private readonly activityService: IActivityService
@IActivityService private readonly activityService: IActivityService,
@ICommandService private readonly commandService: ICommandService
) {
this.toDispose = [];

Expand Down Expand Up @@ -438,7 +440,18 @@ export class DebugService implements IDebugService {
nls.localize('debugTypeMissing', "Missing property 'type' for the chosen launch configuration.");
}

await this.showError(message);
const actionList: IAction[] = [];

actionList.push(new Action(
'installAdditionalDebuggers',
nls.localize('installAdditionalDebuggers', "Install {0} Extension", resolvedConfig.type),
undefined,
true,
async () => this.commandService.executeCommand('debug.installAdditionalDebuggers')
));

await this.showError(message, actionList);

return false;
}

Expand Down

0 comments on commit 2e2f69d

Please sign in to comment.