diff --git a/src/vs/workbench/parts/debug/browser/debugActionItems.ts b/src/vs/workbench/parts/debug/browser/debugActionItems.ts index 0357c7088e87ab35d4cf0d013cf9e4c8251eec18..473d5697b1fdd3c7155bb4432a918420fe11c956 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionItems.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionItems.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as nls from 'vs/nls'; import * as lifecycle from 'vs/base/common/lifecycle'; import * as errors from 'vs/base/common/errors'; import { IAction, IActionRunner } from 'vs/base/common/actions'; @@ -13,7 +14,7 @@ import { SelectBox } from 'vs/base/browser/ui/selectBox/selectBox'; import { SelectActionItem, IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { EventEmitter } from 'vs/base/common/eventEmitter'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IDebugService, NO_CONFIGURATIONS_LABEL } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService } from 'vs/workbench/parts/debug/common/debug'; const $ = dom.$; @@ -106,7 +107,7 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem { private setEnabled(enabled: boolean): void { this.selectBox.enabled = enabled; if (!enabled) { - this.selectBox.setOptions([NO_CONFIGURATIONS_LABEL], 0); + this.selectBox.setOptions([nls.localize('noConfigurations', "No Configurations")], 0); } } diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index f113e5aab0593bb9a3c6ab135dd60a6f5ad9e12f..86188d6eb8dea75657756c7523691f4985f1f672 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; import uri from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; @@ -29,7 +28,6 @@ export const CONTEXT_BREAKPOINT_WIDGET_VISIBLE = new RawContextKey('bre export const EDITOR_CONTRIBUTION_ID = 'editor.contrib.debug'; export const DEBUG_SCHEME = 'debug'; -export const NO_CONFIGURATIONS_LABEL = nls.localize('noConfigurations', "No Configurations"); // raw @@ -260,7 +258,7 @@ export interface IModel extends ITreeElement { onDidChangeReplElements: Event; }; -// service enums +// Debug enums export enum State { Disabled, @@ -271,15 +269,13 @@ export enum State { RunningNoDebug } -// Service config +// Debug configuration interfaces export interface IDebugConfiguration { allowBreakpointsEverywhere: boolean; openExplorerOnEnd: boolean; } -// service interfaces - export interface IGlobalConfig { version: string; compounds: ICompound[]; @@ -331,10 +327,6 @@ export interface IRawAdapter extends IRawEnvAdapter { linux?: IRawEnvAdapter; } -export interface IRawBreakpointContribution { - language: string; -} - export interface IConfigurationManager { /** @@ -366,6 +358,8 @@ export interface IConfigurationManager { canSetBreakpointsIn(model: EditorIModel): boolean; } +// Debug service interfaces + export const IDebugService = createDecorator(DEBUG_SERVICE_ID); export interface IDebugService { diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts similarity index 93% rename from src/vs/workbench/parts/debug/node/debugConfigurationManager.ts rename to src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts index 12c0f98ba2556370abd395c56f72f205f78bb3cd..3519e4256495d8491cea640ac15a84858fe3c81a 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts @@ -22,6 +22,8 @@ import { IFileService } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IExtensionsViewlet, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/parts/extensions/common/extensions'; +import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import * as debug from 'vs/workbench/parts/debug/common/debug'; import { Adapter } from 'vs/workbench/parts/debug/node/debugAdapter'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -111,8 +113,12 @@ export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerE } }); +interface IRawBreakpointContribution { + language: string; +} + // breakpoints extension point #9037 -export const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint('breakpoints', [], { +const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registerExtensionPoint('breakpoints', [], { description: nls.localize('vscode.extension.contributes.breakpoints', 'Contributes breakpoints.'), type: 'array', defaultSnippets: [{ body: [{ language: '' }] }], @@ -197,7 +203,8 @@ export class ConfigurationManager implements debug.IConfigurationManager { @IConfigurationService private configurationService: IConfigurationService, @IQuickOpenService private quickOpenService: IQuickOpenService, @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService, - @IInstantiationService private instantiationService: IInstantiationService + @IInstantiationService private instantiationService: IInstantiationService, + @IViewletService private viewletService: IViewletService ) { this.adapters = []; this.registerListeners(); @@ -326,8 +333,21 @@ export class ConfigurationManager implements debug.IConfigurationManager { let configFileCreated = false; return this.fileService.resolveContent(resource).then(content => true, err => - this.quickOpenService.pick(this.adapters, { placeHolder: nls.localize('selectDebug', "Select Environment") }) - .then(adapter => adapter ? adapter.getInitialConfigurationContent() : null) + this.quickOpenService.pick([...this.adapters, { label: 'More...' }], { placeHolder: nls.localize('selectDebug', "Select Environment") }) + .then(picked => { + if (picked instanceof Adapter) { + return picked ? picked.getInitialConfigurationContent() : null; + } + if (picked) { + return this.viewletService.openViewlet(EXTENSIONS_VIEWLET_ID, true) + .then(viewlet => viewlet as IExtensionsViewlet) + .then(viewlet => { + viewlet.search('tag:debuggers'); + viewlet.focus(); + return null; + }); + } + }) .then(content => { if (!content) { return false; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 805bc2b0ad700d65ed6b316e57b1d8a0eb04ff6e..f36b240080922971a9e4d47590680ae056cda41f 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -34,7 +34,7 @@ import { RawDebugSession } from 'vs/workbench/parts/debug/electron-browser/rawDe import { Model, ExceptionBreakpoint, FunctionBreakpoint, Breakpoint, Expression, OutputNameValueElement, ExpressionContainer, Process } from 'vs/workbench/parts/debug/common/debugModel'; import { ViewModel } from 'vs/workbench/parts/debug/common/debugViewModel'; import * as debugactions from 'vs/workbench/parts/debug/browser/debugActions'; -import { ConfigurationManager } from 'vs/workbench/parts/debug/node/debugConfigurationManager'; +import { ConfigurationManager } from 'vs/workbench/parts/debug/electron-browser/debugConfigurationManager'; import { ToggleMarkersPanelAction } from 'vs/workbench/parts/markers/browser/markersPanelActions'; import { ITaskService, TaskEvent, TaskType, TaskServiceEvents, ITaskSummary } from 'vs/workbench/parts/tasks/common/taskService'; import { TaskError, TaskErrors } from 'vs/workbench/parts/tasks/common/taskSystem';