diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts index f242c03a8cbfeaca425cbcd3839dda87a80968c3..cb6f0ab1a92325f4968d0ff4563eade5683f409d 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts @@ -3,28 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import nls = require('vs/nls'); +import * as nls from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; -import lifecycle = require('vs/base/common/lifecycle'); +import * as lifecycle from 'vs/base/common/lifecycle'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import paths = require('vs/base/common/paths'); -import async = require('vs/base/common/async'); -import errors = require('vs/base/common/errors'); -import strings = require('vs/base/common/strings'); +import * as paths from 'vs/base/common/paths'; +import * as async from 'vs/base/common/async'; +import * as errors from 'vs/base/common/errors'; +import { equalsIgnoreCase } from 'vs/base/common/strings'; import { isMacintosh } from 'vs/base/common/platform'; -import dom = require('vs/base/browser/dom'); +import * as dom from 'vs/base/browser/dom'; import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -import labels = require('vs/base/common/labels'); -import actions = require('vs/base/common/actions'); -import actionbar = require('vs/base/browser/ui/actionbar/actionbar'); -import tree = require('vs/base/parts/tree/browser/tree'); +import { getPathLabel } from 'vs/base/common/labels'; +import { IAction, IActionRunner } from 'vs/base/common/actions'; +import { IActionItem, Separator, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; +import { ITree, IAccessibilityProvider, ContextMenuEvent, IDataSource, IRenderer } from 'vs/base/parts/tree/browser/tree'; import { InputBox, IInputValidationOptions } from 'vs/base/browser/ui/inputbox/inputBox'; -import treedefaults = require('vs/base/parts/tree/browser/treeDefaults'); -import renderer = require('vs/base/parts/tree/browser/actionsRenderer'); -import debug = require('vs/workbench/parts/debug/common/debug'); -import model = require('vs/workbench/parts/debug/common/debugModel'); -import viewmodel = require('vs/workbench/parts/debug/common/debugViewModel'); -import debugactions = require('vs/workbench/parts/debug/browser/debugActions'); +import { DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; +import { IActionProvider } from 'vs/base/parts/tree/browser/actionsRenderer'; +import * as debug from 'vs/workbench/parts/debug/common/debug'; +import { Expression, Variable, FunctionBreakpoint, StackFrame, Thread, Process, Breakpoint, ExceptionBreakpoint, Model, Scope } from 'vs/workbench/parts/debug/common/debugModel'; +import { ViewModel } from 'vs/workbench/parts/debug/common/debugViewModel'; +import { ContinueAction, StepOverAction, PauseAction, AddFunctionBreakpointAction, ReapplyBreakpointsAction, DisableAllBreakpointsAction, RemoveBreakpointAction, ToggleEnablementAction, RenameFunctionBreakpointAction, RemoveWatchExpressionAction, AddWatchExpressionAction, EditWatchExpressionAction, RemoveAllBreakpointsAction, EnableAllBreakpointsAction, StepOutAction, StepIntoAction, SetValueAction, RemoveAllWatchExpressionsAction, ToggleBreakpointsActivatedAction, RestartFrameAction, AddToWatchExpressionsAction } from 'vs/workbench/parts/debug/browser/debugActions'; import { CopyValueAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -43,9 +43,9 @@ export function renderExpressionValue(expressionOrValue: debug.IExpression | str // remove stale classes container.className = 'value'; // when resolving expressions we represent errors from the server as a variable with name === null. - if (value === null || ((expressionOrValue instanceof model.Expression || expressionOrValue instanceof model.Variable) && !expressionOrValue.available)) { + if (value === null || ((expressionOrValue instanceof Expression || expressionOrValue instanceof Variable) && !expressionOrValue.available)) { dom.addClass(container, 'unavailable'); - if (value !== model.Expression.DEFAULT_VALUE) { + if (value !== Expression.DEFAULT_VALUE) { dom.addClass(container, 'error'); } } else if (!isNaN(+value)) { @@ -68,7 +68,7 @@ export function renderExpressionValue(expressionOrValue: debug.IExpression | str container.title = value; } -export function renderVariable(tree: tree.ITree, variable: model.Variable, data: IVariableTemplateData, showChanged: boolean): void { +export function renderVariable(tree: ITree, variable: Variable, data: IVariableTemplateData, showChanged: boolean): void { if (variable.available) { data.name.textContent = variable.name; data.name.title = variable.type ? variable.type : ''; @@ -91,7 +91,7 @@ interface IRenameBoxOptions { validationOptions?: IInputValidationOptions; } -function renderRenameBox(debugService: debug.IDebugService, contextViewService: IContextViewService, tree: tree.ITree, element: any, container: HTMLElement, options: IRenameBoxOptions): void { +function renderRenameBox(debugService: debug.IDebugService, contextViewService: IContextViewService, tree: ITree, element: any, container: HTMLElement, options: IRenameBoxOptions): void { let inputBoxContainer = dom.append(container, $('.inputBoxContainer')); let inputBox = new InputBox(inputBoxContainer, contextViewService, { validationOptions: options.validationOptions, @@ -109,15 +109,15 @@ function renderRenameBox(debugService: debug.IDebugService, contextViewService: const wrapUp = async.once((renamed: boolean) => { if (!disposed) { disposed = true; - if (element instanceof model.Expression && renamed && inputBox.value) { + if (element instanceof Expression && renamed && inputBox.value) { debugService.renameWatchExpression(element.getId(), inputBox.value).done(null, errors.onUnexpectedError); - } else if (element instanceof model.Expression && !element.name) { + } else if (element instanceof Expression && !element.name) { debugService.removeWatchExpressions(element.getId()); - } else if (element instanceof model.FunctionBreakpoint && renamed && inputBox.value) { + } else if (element instanceof FunctionBreakpoint && renamed && inputBox.value) { debugService.renameFunctionBreakpoint(element.getId(), inputBox.value).done(null, errors.onUnexpectedError); - } else if (element instanceof model.FunctionBreakpoint && !element.name) { + } else if (element instanceof FunctionBreakpoint && !element.name) { debugService.removeFunctionBreakpoints(element.getId()).done(null, errors.onUnexpectedError); - } else if (element instanceof model.Variable) { + } else if (element instanceof Variable) { element.errorMessage = null; if (renamed && element.value !== inputBox.value) { element.setVariable(inputBox.value) @@ -153,15 +153,15 @@ function getSourceName(source: Source, contextService: IWorkspaceContextService) return source.name; } - return labels.getPathLabel(paths.basename(source.uri.fsPath), contextService); + return getPathLabel(paths.basename(source.uri.fsPath), contextService); } -export class BaseDebugController extends treedefaults.DefaultController { +export class BaseDebugController extends DefaultController { constructor( protected debugService: debug.IDebugService, private contextMenuService: IContextMenuService, - private actionProvider: renderer.IActionProvider, + private actionProvider: IActionProvider, private focusOnContextMenu = true ) { super(); @@ -174,7 +174,7 @@ export class BaseDebugController extends treedefaults.DefaultController { } } - public onContextMenu(tree: tree.ITree, element: debug.IEnablement, event: tree.ContextMenuEvent): boolean { + public onContextMenu(tree: ITree, element: debug.IEnablement, event: ContextMenuEvent): boolean { if (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') { return false; } @@ -205,7 +205,7 @@ export class BaseDebugController extends treedefaults.DefaultController { return false; } - protected onDelete(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onDelete(tree: ITree, event: IKeyboardEvent): boolean { return false; } } @@ -222,51 +222,51 @@ class ThreadAndProcessIds implements debug.ITreeElement { export class CallStackController extends BaseDebugController { - protected onLeftClick(tree: tree.ITree, element: any, event: IMouseEvent): boolean { + protected onLeftClick(tree: ITree, element: any, event: IMouseEvent): boolean { if (element instanceof ThreadAndProcessIds) { return this.showMoreStackFrames(tree, element); } - if (element instanceof model.StackFrame) { + if (element instanceof StackFrame) { this.focusStackFrame(element, event, true); } return super.onLeftClick(tree, element, event); } - protected onEnter(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onEnter(tree: ITree, event: IKeyboardEvent): boolean { const element = tree.getFocus(); if (element instanceof ThreadAndProcessIds) { return this.showMoreStackFrames(tree, element); } - if (element instanceof model.StackFrame) { + if (element instanceof StackFrame) { this.focusStackFrame(element, event, false); } return super.onEnter(tree, event); } - protected onUp(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onUp(tree: ITree, event: IKeyboardEvent): boolean { super.onUp(tree, event); this.focusStackFrame(tree.getFocus(), event, true); return true; } - protected onPageUp(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onPageUp(tree: ITree, event: IKeyboardEvent): boolean { super.onPageUp(tree, event); this.focusStackFrame(tree.getFocus(), event, true); return true; } - protected onDown(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onDown(tree: ITree, event: IKeyboardEvent): boolean { super.onDown(tree, event); this.focusStackFrame(tree.getFocus(), event, true); return true; } - protected onPageDown(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onPageDown(tree: ITree, event: IKeyboardEvent): boolean { super.onPageDown(tree, event); this.focusStackFrame(tree.getFocus(), event, true); @@ -274,7 +274,7 @@ export class CallStackController extends BaseDebugController { } // user clicked / pressed on 'Load More Stack Frames', get those stack frames and refresh the tree. - private showMoreStackFrames(tree: tree.ITree, threadAndProcessIds: ThreadAndProcessIds): boolean { + private showMoreStackFrames(tree: ITree, threadAndProcessIds: ThreadAndProcessIds): boolean { const process = this.debugService.getModel().getProcesses().filter(p => p.getId() === threadAndProcessIds.processId).pop(); const thread = process && process.getThread(threadAndProcessIds.threadId); if (thread) { @@ -296,54 +296,54 @@ export class CallStackController extends BaseDebugController { } -export class CallStackActionProvider implements renderer.IActionProvider { +export class CallStackActionProvider implements IActionProvider { constructor( @IInstantiationService private instantiationService: IInstantiationService, @debug.IDebugService private debugService: debug.IDebugService) { // noop } - public hasActions(tree: tree.ITree, element: any): boolean { + public hasActions(tree: ITree, element: any): boolean { return false; } - public getActions(tree: tree.ITree, element: any): TPromise { + public getActions(tree: ITree, element: any): TPromise { return TPromise.as([]); } - public hasSecondaryActions(tree: tree.ITree, element: any): boolean { - return element instanceof model.Thread || element instanceof model.StackFrame; + public hasSecondaryActions(tree: ITree, element: any): boolean { + return element instanceof Thread || element instanceof StackFrame; } - public getSecondaryActions(tree: tree.ITree, element: any): TPromise { - const actions: actions.Action[] = []; - if (element instanceof model.Thread) { - const thread = element; + public getSecondaryActions(tree: ITree, element: any): TPromise { + const actions: IAction[] = []; + if (element instanceof Thread) { + const thread = element; if (thread.stopped) { - actions.push(this.instantiationService.createInstance(debugactions.ContinueAction, debugactions.ContinueAction.ID, debugactions.ContinueAction.LABEL)); - actions.push(this.instantiationService.createInstance(debugactions.StepOverAction, debugactions.StepOverAction.ID, debugactions.StepOverAction.LABEL)); - actions.push(this.instantiationService.createInstance(debugactions.StepIntoAction, debugactions.StepIntoAction.ID, debugactions.StepIntoAction.LABEL)); - actions.push(this.instantiationService.createInstance(debugactions.StepOutAction, debugactions.StepOutAction.ID, debugactions.StepOutAction.LABEL)); + actions.push(this.instantiationService.createInstance(ContinueAction, ContinueAction.ID, ContinueAction.LABEL)); + actions.push(this.instantiationService.createInstance(StepOverAction, StepOverAction.ID, StepOverAction.LABEL)); + actions.push(this.instantiationService.createInstance(StepIntoAction, StepIntoAction.ID, StepIntoAction.LABEL)); + actions.push(this.instantiationService.createInstance(StepOutAction, StepOutAction.ID, StepOutAction.LABEL)); } else { - actions.push(this.instantiationService.createInstance(debugactions.PauseAction, debugactions.PauseAction.ID, debugactions.PauseAction.LABEL)); + actions.push(this.instantiationService.createInstance(PauseAction, PauseAction.ID, PauseAction.LABEL)); } - } else if (element instanceof model.StackFrame) { + } else if (element instanceof StackFrame) { const capabilities = this.debugService.getViewModel().focusedProcess.session.configuration.capabilities; if (typeof capabilities.supportsRestartFrame === 'boolean' && capabilities.supportsRestartFrame) { - actions.push(this.instantiationService.createInstance(debugactions.RestartFrameAction, debugactions.RestartFrameAction.ID, debugactions.RestartFrameAction.LABEL)); + actions.push(this.instantiationService.createInstance(RestartFrameAction, RestartFrameAction.ID, RestartFrameAction.LABEL)); } } return TPromise.as(actions); } - public getActionItem(tree: tree.ITree, element: any, action: actions.IAction): actionbar.IActionItem { + public getActionItem(tree: ITree, element: any, action: IAction): IActionItem { return null; } } -export class CallStackDataSource implements tree.IDataSource { +export class CallStackDataSource implements IDataSource { - public getId(tree: tree.ITree, element: any): string { + public getId(tree: ITree, element: any): string { if (typeof element === 'string') { return element; } @@ -351,15 +351,15 @@ export class CallStackDataSource implements tree.IDataSource { return element.getId(); } - public hasChildren(tree: tree.ITree, element: any): boolean { - return element instanceof model.Model || element instanceof model.Process || (element instanceof model.Thread && (element).stopped); + public hasChildren(tree: ITree, element: any): boolean { + return element instanceof Model || element instanceof Process || (element instanceof Thread && (element).stopped); } - public getChildren(tree: tree.ITree, element: any): TPromise { - if (element instanceof model.Thread) { + public getChildren(tree: ITree, element: any): TPromise { + if (element instanceof Thread) { return this.getThreadChildren(element); } - if (element instanceof model.Model) { + if (element instanceof Model) { return TPromise.as(element.getProcesses()); } @@ -380,7 +380,7 @@ export class CallStackDataSource implements tree.IDataSource { }); } - public getParent(tree: tree.ITree, element: any): TPromise { + public getParent(tree: ITree, element: any): TPromise { return TPromise.as(null); } } @@ -413,7 +413,7 @@ interface IStackFrameTemplateData { lineNumber: HTMLElement; } -export class CallStackRenderer implements tree.IRenderer { +export class CallStackRenderer implements IRenderer { private static THREAD_TEMPLATE_ID = 'thread'; private static STACK_FRAME_TEMPLATE_ID = 'stackFrame'; @@ -425,18 +425,18 @@ export class CallStackRenderer implements tree.IRenderer { // noop } - public getHeight(tree: tree.ITree, element: any): number { + public getHeight(tree: ITree, element: any): number { return 22; } - public getTemplateId(tree: tree.ITree, element: any): string { - if (element instanceof model.Process) { + public getTemplateId(tree: ITree, element: any): string { + if (element instanceof Process) { return CallStackRenderer.PROCESS_TEMPLATE_ID; } - if (element instanceof model.Thread) { + if (element instanceof Thread) { return CallStackRenderer.THREAD_TEMPLATE_ID; } - if (element instanceof model.StackFrame) { + if (element instanceof StackFrame) { return CallStackRenderer.STACK_FRAME_TEMPLATE_ID; } if (typeof element === 'string') { @@ -446,7 +446,7 @@ export class CallStackRenderer implements tree.IRenderer { return CallStackRenderer.LOAD_MORE_TEMPLATE_ID; } - public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement): any { + public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): any { if (templateId === CallStackRenderer.PROCESS_TEMPLATE_ID) { let data: IProcessTemplateData = Object.create(null); data.process = dom.append(container, $('.process')); @@ -487,7 +487,7 @@ export class CallStackRenderer implements tree.IRenderer { return data; } - public renderElement(tree: tree.ITree, element: any, templateId: string, templateData: any): void { + public renderElement(tree: ITree, element: any, templateId: string, templateData: any): void { if (templateId === CallStackRenderer.PROCESS_TEMPLATE_ID) { this.renderProcess(element, templateData); } else if (templateId === CallStackRenderer.THREAD_TEMPLATE_ID) { @@ -536,23 +536,23 @@ export class CallStackRenderer implements tree.IRenderer { } } - public disposeTemplate(tree: tree.ITree, templateId: string, templateData: any): void { + public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { // noop } } -export class CallstackAccessibilityProvider implements tree.IAccessibilityProvider { +export class CallstackAccessibilityProvider implements IAccessibilityProvider { constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) { // noop } - public getAriaLabel(tree: tree.ITree, element: any): string { - if (element instanceof model.Thread) { - return nls.localize('threadAriaLabel', "Thread {0}, callstack, debug", (element).name); + public getAriaLabel(tree: ITree, element: any): string { + if (element instanceof Thread) { + return nls.localize('threadAriaLabel', "Thread {0}, callstack, debug", (element).name); } - if (element instanceof model.StackFrame) { - return nls.localize('stackFrameAriaLabel', "Stack Frame {0} line {1} {2}, callstack, debug", (element).name, (element).lineNumber, getSourceName((element).source, this.contextService)); + if (element instanceof StackFrame) { + return nls.localize('stackFrameAriaLabel', "Stack Frame {0} line {1} {2}, callstack, debug", (element).name, (element).lineNumber, getSourceName((element).source, this.contextService)); } return null; @@ -561,68 +561,68 @@ export class CallstackAccessibilityProvider implements tree.IAccessibilityProvid // variables -export class VariablesActionProvider implements renderer.IActionProvider { +export class VariablesActionProvider implements IActionProvider { constructor(private instantiationService: IInstantiationService) { // noop } - public hasActions(tree: tree.ITree, element: any): boolean { + public hasActions(tree: ITree, element: any): boolean { return false; } - public getActions(tree: tree.ITree, element: any): TPromise { + public getActions(tree: ITree, element: any): TPromise { return TPromise.as([]); } - public hasSecondaryActions(tree: tree.ITree, element: any): boolean { - return element instanceof model.Variable; + public hasSecondaryActions(tree: ITree, element: any): boolean { + return element instanceof Variable; } - public getSecondaryActions(tree: tree.ITree, element: any): TPromise { - let actions: actions.Action[] = []; - const variable = element; + public getSecondaryActions(tree: ITree, element: any): TPromise { + let actions: IAction[] = []; + const variable = element; if (variable.reference === 0) { - actions.push(this.instantiationService.createInstance(debugactions.SetValueAction, debugactions.SetValueAction.ID, debugactions.SetValueAction.LABEL, variable)); + actions.push(this.instantiationService.createInstance(SetValueAction, SetValueAction.ID, SetValueAction.LABEL, variable)); actions.push(this.instantiationService.createInstance(CopyValueAction, CopyValueAction.ID, CopyValueAction.LABEL, variable)); - actions.push(new actionbar.Separator()); + actions.push(new Separator()); } - actions.push(this.instantiationService.createInstance(debugactions.AddToWatchExpressionsAction, debugactions.AddToWatchExpressionsAction.ID, debugactions.AddToWatchExpressionsAction.LABEL, variable)); + actions.push(this.instantiationService.createInstance(AddToWatchExpressionsAction, AddToWatchExpressionsAction.ID, AddToWatchExpressionsAction.LABEL, variable)); return TPromise.as(actions); } - public getActionItem(tree: tree.ITree, element: any, action: actions.IAction): actionbar.IActionItem { + public getActionItem(tree: ITree, element: any, action: IAction): IActionItem { return null; } } -export class VariablesDataSource implements tree.IDataSource { +export class VariablesDataSource implements IDataSource { - public getId(tree: tree.ITree, element: any): string { + public getId(tree: ITree, element: any): string { return element.getId(); } - public hasChildren(tree: tree.ITree, element: any): boolean { - if (element instanceof viewmodel.ViewModel || element instanceof model.Scope) { + public hasChildren(tree: ITree, element: any): boolean { + if (element instanceof ViewModel || element instanceof Scope) { return true; } - let variable = element; - return variable.reference !== 0 && !strings.equalsIgnoreCase(variable.value, 'null'); + let variable = element; + return variable.reference !== 0 && !equalsIgnoreCase(variable.value, 'null'); } - public getChildren(tree: tree.ITree, element: any): TPromise { - if (element instanceof viewmodel.ViewModel) { - const focusedStackFrame = (element).focusedStackFrame; + public getChildren(tree: ITree, element: any): TPromise { + if (element instanceof ViewModel) { + const focusedStackFrame = (element).focusedStackFrame; return focusedStackFrame ? focusedStackFrame.getScopes() : TPromise.as([]); } - let scope = element; + let scope = element; return scope.getChildren(); } - public getParent(tree: tree.ITree, element: any): TPromise { + public getParent(tree: ITree, element: any): TPromise { return TPromise.as(null); } } @@ -637,7 +637,7 @@ export interface IVariableTemplateData { value: HTMLElement; } -export class VariablesRenderer implements tree.IRenderer { +export class VariablesRenderer implements IRenderer { private static SCOPE_TEMPLATE_ID = 'scope'; private static VARIABLE_TEMPLATE_ID = 'variable'; @@ -649,22 +649,22 @@ export class VariablesRenderer implements tree.IRenderer { // noop } - public getHeight(tree: tree.ITree, element: any): number { + public getHeight(tree: ITree, element: any): number { return 22; } - public getTemplateId(tree: tree.ITree, element: any): string { - if (element instanceof model.Scope) { + public getTemplateId(tree: ITree, element: any): string { + if (element instanceof Scope) { return VariablesRenderer.SCOPE_TEMPLATE_ID; } - if (element instanceof model.Variable) { + if (element instanceof Variable) { return VariablesRenderer.VARIABLE_TEMPLATE_ID; } return null; } - public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement): any { + public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): any { if (templateId === VariablesRenderer.SCOPE_TEMPLATE_ID) { let data: IScopeTemplateData = Object.create(null); data.name = dom.append(container, $('.scope')); @@ -680,11 +680,11 @@ export class VariablesRenderer implements tree.IRenderer { return data; } - public renderElement(tree: tree.ITree, element: any, templateId: string, templateData: any): void { + public renderElement(tree: ITree, element: any, templateId: string, templateData: any): void { if (templateId === VariablesRenderer.SCOPE_TEMPLATE_ID) { this.renderScope(element, templateData); } else { - const variable = element; + const variable = element; if (variable === this.debugService.getViewModel().getSelectedExpression() || variable.errorMessage) { renderRenameBox(this.debugService, this.contextViewService, tree, variable, (templateData).expression, { initialValue: variable.value, @@ -699,23 +699,23 @@ export class VariablesRenderer implements tree.IRenderer { } } - private renderScope(scope: model.Scope, data: IScopeTemplateData): void { + private renderScope(scope: Scope, data: IScopeTemplateData): void { data.name.textContent = scope.name; } - public disposeTemplate(tree: tree.ITree, templateId: string, templateData: any): void { + public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { // noop } } -export class VariablesAccessibilityProvider implements tree.IAccessibilityProvider { +export class VariablesAccessibilityProvider implements IAccessibilityProvider { - public getAriaLabel(tree: tree.ITree, element: any): string { - if (element instanceof model.Scope) { - return nls.localize('variableScopeAriaLabel', "Scope {0}, variables, debug", (element).name); + public getAriaLabel(tree: ITree, element: any): string { + if (element instanceof Scope) { + return nls.localize('variableScopeAriaLabel', "Scope {0}, variables, debug", (element).name); } - if (element instanceof model.Variable) { - return nls.localize('variableAriaLabel', "{0} value {1}, variables, debug", (element).name, (element).value); + if (element instanceof Variable) { + return nls.localize('variableAriaLabel', "{0} value {1}, variables, debug", (element).name, (element).value); } return null; @@ -724,14 +724,14 @@ export class VariablesAccessibilityProvider implements tree.IAccessibilityProvid export class VariablesController extends BaseDebugController { - constructor(debugService: debug.IDebugService, contextMenuService: IContextMenuService, actionProvider: renderer.IActionProvider) { + constructor(debugService: debug.IDebugService, contextMenuService: IContextMenuService, actionProvider: IActionProvider) { super(debugService, contextMenuService, actionProvider); this.downKeyBindingDispatcher.set(KeyCode.Enter, this.setSelectedExpression.bind(this)); } - protected onLeftClick(tree: tree.ITree, element: any, event: IMouseEvent): boolean { + protected onLeftClick(tree: ITree, element: any, event: IMouseEvent): boolean { // double click on primitive value: open input box to be able to set the value - if (element instanceof model.Variable && event.detail === 2) { + if (element instanceof Variable && event.detail === 2) { const expression = element; if (expression.reference === 0) { this.debugService.getViewModel().setSelectedExpression(expression); @@ -742,9 +742,9 @@ export class VariablesController extends BaseDebugController { return super.onLeftClick(tree, element, event); } - protected setSelectedExpression(tree: tree.ITree, event: KeyboardEvent): boolean { + protected setSelectedExpression(tree: ITree, event: KeyboardEvent): boolean { const element = tree.getFocus(); - if (element instanceof model.Variable && element.reference === 0) { + if (element instanceof Variable && element.reference === 0) { this.debugService.getViewModel().setSelectedExpression(element); return true; } @@ -755,7 +755,7 @@ export class VariablesController extends BaseDebugController { // watch expressions -export class WatchExpressionsActionProvider implements renderer.IActionProvider { +export class WatchExpressionsActionProvider implements IActionProvider { private instantiationService: IInstantiationService; @@ -763,89 +763,89 @@ export class WatchExpressionsActionProvider implements renderer.IActionProvider this.instantiationService = instantiationService; } - public hasActions(tree: tree.ITree, element: any): boolean { - return element instanceof model.Expression && !!element.name; + public hasActions(tree: ITree, element: any): boolean { + return element instanceof Expression && !!element.name; } - public hasSecondaryActions(tree: tree.ITree, element: any): boolean { + public hasSecondaryActions(tree: ITree, element: any): boolean { return true; } - public getActions(tree: tree.ITree, element: any): TPromise { + public getActions(tree: ITree, element: any): TPromise { return TPromise.as(this.getExpressionActions()); } - public getExpressionActions(): actions.IAction[] { - return [this.instantiationService.createInstance(debugactions.RemoveWatchExpressionAction, debugactions.RemoveWatchExpressionAction.ID, debugactions.RemoveWatchExpressionAction.LABEL)]; + public getExpressionActions(): IAction[] { + return [this.instantiationService.createInstance(RemoveWatchExpressionAction, RemoveWatchExpressionAction.ID, RemoveWatchExpressionAction.LABEL)]; } - public getSecondaryActions(tree: tree.ITree, element: any): TPromise { - const actions: actions.Action[] = []; - if (element instanceof model.Expression) { - const expression = element; - actions.push(this.instantiationService.createInstance(debugactions.AddWatchExpressionAction, debugactions.AddWatchExpressionAction.ID, debugactions.AddWatchExpressionAction.LABEL)); - actions.push(this.instantiationService.createInstance(debugactions.EditWatchExpressionAction, debugactions.EditWatchExpressionAction.ID, debugactions.EditWatchExpressionAction.LABEL, expression)); + public getSecondaryActions(tree: ITree, element: any): TPromise { + const actions: IAction[] = []; + if (element instanceof Expression) { + const expression = element; + actions.push(this.instantiationService.createInstance(AddWatchExpressionAction, AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL)); + actions.push(this.instantiationService.createInstance(EditWatchExpressionAction, EditWatchExpressionAction.ID, EditWatchExpressionAction.LABEL, expression)); if (expression.reference === 0) { actions.push(this.instantiationService.createInstance(CopyValueAction, CopyValueAction.ID, CopyValueAction.LABEL, expression.value)); } - actions.push(new actionbar.Separator()); + actions.push(new Separator()); - actions.push(this.instantiationService.createInstance(debugactions.RemoveWatchExpressionAction, debugactions.RemoveWatchExpressionAction.ID, debugactions.RemoveWatchExpressionAction.LABEL)); - actions.push(this.instantiationService.createInstance(debugactions.RemoveAllWatchExpressionsAction, debugactions.RemoveAllWatchExpressionsAction.ID, debugactions.RemoveAllWatchExpressionsAction.LABEL)); + actions.push(this.instantiationService.createInstance(RemoveWatchExpressionAction, RemoveWatchExpressionAction.ID, RemoveWatchExpressionAction.LABEL)); + actions.push(this.instantiationService.createInstance(RemoveAllWatchExpressionsAction, RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL)); } else { - actions.push(this.instantiationService.createInstance(debugactions.AddWatchExpressionAction, debugactions.AddWatchExpressionAction.ID, debugactions.AddWatchExpressionAction.LABEL)); - if (element instanceof model.Variable) { - const variable = element; + actions.push(this.instantiationService.createInstance(AddWatchExpressionAction, AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL)); + if (element instanceof Variable) { + const variable = element; if (variable.reference === 0) { actions.push(this.instantiationService.createInstance(CopyValueAction, CopyValueAction.ID, CopyValueAction.LABEL, variable.value)); } - actions.push(new actionbar.Separator()); + actions.push(new Separator()); } - actions.push(this.instantiationService.createInstance(debugactions.RemoveAllWatchExpressionsAction, debugactions.RemoveAllWatchExpressionsAction.ID, debugactions.RemoveAllWatchExpressionsAction.LABEL)); + actions.push(this.instantiationService.createInstance(RemoveAllWatchExpressionsAction, RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL)); } return TPromise.as(actions); } - public getActionItem(tree: tree.ITree, element: any, action: actions.IAction): actionbar.IActionItem { + public getActionItem(tree: ITree, element: any, action: IAction): IActionItem { return null; } } -export class WatchExpressionsDataSource implements tree.IDataSource { +export class WatchExpressionsDataSource implements IDataSource { - public getId(tree: tree.ITree, element: any): string { + public getId(tree: ITree, element: any): string { return element.getId(); } - public hasChildren(tree: tree.ITree, element: any): boolean { - if (element instanceof model.Model) { + public hasChildren(tree: ITree, element: any): boolean { + if (element instanceof Model) { return true; } - const watchExpression = element; - return watchExpression.reference !== 0 && !strings.equalsIgnoreCase(watchExpression.value, 'null'); + const watchExpression = element; + return watchExpression.reference !== 0 && !equalsIgnoreCase(watchExpression.value, 'null'); } - public getChildren(tree: tree.ITree, element: any): TPromise { - if (element instanceof model.Model) { - return TPromise.as((element).getWatchExpressions()); + public getChildren(tree: ITree, element: any): TPromise { + if (element instanceof Model) { + return TPromise.as((element).getWatchExpressions()); } - let expression = element; + let expression = element; return expression.getChildren(); } - public getParent(tree: tree.ITree, element: any): TPromise { + public getParent(tree: ITree, element: any): TPromise { return TPromise.as(null); } } interface IWatchExpressionTemplateData extends IVariableTemplateData { - actionBar: actionbar.ActionBar; + actionBar: ActionBar; } -export class WatchExpressionsRenderer implements tree.IRenderer { +export class WatchExpressionsRenderer implements IRenderer { private static WATCH_EXPRESSION_TEMPLATE_ID = 'watchExpression'; private static VARIABLE_TEMPLATE_ID = 'variables'; @@ -853,8 +853,8 @@ export class WatchExpressionsRenderer implements tree.IRenderer { private actionProvider: WatchExpressionsActionProvider; constructor( - actionProvider: renderer.IActionProvider, - private actionRunner: actions.IActionRunner, + actionProvider: IActionProvider, + private actionRunner: IActionRunner, @debug.IDebugService private debugService: debug.IDebugService, @IContextViewService private contextViewService: IContextViewService ) { @@ -862,22 +862,22 @@ export class WatchExpressionsRenderer implements tree.IRenderer { this.actionProvider = actionProvider; } - public getHeight(tree: tree.ITree, element: any): number { + public getHeight(tree: ITree, element: any): number { return 22; } - public getTemplateId(tree: tree.ITree, element: any): string { - if (element instanceof model.Expression) { + public getTemplateId(tree: ITree, element: any): string { + if (element instanceof Expression) { return WatchExpressionsRenderer.WATCH_EXPRESSION_TEMPLATE_ID; } return WatchExpressionsRenderer.VARIABLE_TEMPLATE_ID; } - public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement): any { + public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): any { let data: IWatchExpressionTemplateData = Object.create(null); if (templateId === WatchExpressionsRenderer.WATCH_EXPRESSION_TEMPLATE_ID) { - data.actionBar = new actionbar.ActionBar(container, { actionRunner: this.actionRunner }); + data.actionBar = new ActionBar(container, { actionRunner: this.actionRunner }); data.actionBar.push(this.actionProvider.getExpressionActions(), { icon: true, label: false }); } @@ -888,7 +888,7 @@ export class WatchExpressionsRenderer implements tree.IRenderer { return data; } - public renderElement(tree: tree.ITree, element: any, templateId: string, templateData: any): void { + public renderElement(tree: ITree, element: any, templateId: string, templateData: any): void { if (templateId === WatchExpressionsRenderer.WATCH_EXPRESSION_TEMPLATE_ID) { this.renderWatchExpression(tree, element, templateData); } else { @@ -896,9 +896,9 @@ export class WatchExpressionsRenderer implements tree.IRenderer { } } - private renderWatchExpression(tree: tree.ITree, watchExpression: debug.IExpression, data: IWatchExpressionTemplateData): void { + private renderWatchExpression(tree: ITree, watchExpression: debug.IExpression, data: IWatchExpressionTemplateData): void { let selectedExpression = this.debugService.getViewModel().getSelectedExpression(); - if ((selectedExpression instanceof model.Expression && selectedExpression.getId() === watchExpression.getId()) || (watchExpression instanceof model.Expression && !watchExpression.name)) { + if ((selectedExpression instanceof Expression && selectedExpression.getId() === watchExpression.getId()) || (watchExpression instanceof Expression && !watchExpression.name)) { renderRenameBox(this.debugService, this.contextViewService, tree, watchExpression, data.expression, { initialValue: watchExpression.name, placeholder: nls.localize('watchExpressionPlaceholder', "Expression to watch"), @@ -915,7 +915,7 @@ export class WatchExpressionsRenderer implements tree.IRenderer { } } - public disposeTemplate(tree: tree.ITree, templateId: string, templateData: any): void { + public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { if (templateId === WatchExpressionsRenderer.WATCH_EXPRESSION_TEMPLATE_ID) { (templateData).actionBar.dispose(); } @@ -926,14 +926,14 @@ export class WatchExpressionsRenderer implements tree.IRenderer { } } -export class WatchExpressionsAccessibilityProvider implements tree.IAccessibilityProvider { +export class WatchExpressionsAccessibilityProvider implements IAccessibilityProvider { - public getAriaLabel(tree: tree.ITree, element: any): string { - if (element instanceof model.Expression) { - return nls.localize('watchExpressionAriaLabel', "{0} value {1}, watch, debug", (element).name, (element).value); + public getAriaLabel(tree: ITree, element: any): string { + if (element instanceof Expression) { + return nls.localize('watchExpressionAriaLabel', "{0} value {1}, watch, debug", (element).name, (element).value); } - if (element instanceof model.Variable) { - return nls.localize('watchVariableAriaLabel', "{0} value {1}, watch, debug", (element).name, (element).value); + if (element instanceof Variable) { + return nls.localize('watchVariableAriaLabel', "{0} value {1}, watch, debug", (element).name, (element).value); } return null; @@ -942,7 +942,7 @@ export class WatchExpressionsAccessibilityProvider implements tree.IAccessibilit export class WatchExpressionsController extends BaseDebugController { - constructor(debugService: debug.IDebugService, contextMenuService: IContextMenuService, actionProvider: renderer.IActionProvider) { + constructor(debugService: debug.IDebugService, contextMenuService: IContextMenuService, actionProvider: IActionProvider) { super(debugService, contextMenuService, actionProvider); if (isMacintosh) { @@ -952,9 +952,9 @@ export class WatchExpressionsController extends BaseDebugController { } } - protected onLeftClick(tree: tree.ITree, element: any, event: IMouseEvent): boolean { + protected onLeftClick(tree: ITree, element: any, event: IMouseEvent): boolean { // double click on primitive value: open input box to be able to select and copy value. - if (element instanceof model.Expression && event.detail === 2) { + if (element instanceof Expression && event.detail === 2) { const expression = element; if (expression.reference === 0) { this.debugService.getViewModel().setSelectedExpression(expression); @@ -965,10 +965,10 @@ export class WatchExpressionsController extends BaseDebugController { return super.onLeftClick(tree, element, event); } - protected onRename(tree: tree.ITree, event: KeyboardEvent): boolean { + protected onRename(tree: ITree, event: KeyboardEvent): boolean { const element = tree.getFocus(); - if (element instanceof model.Expression) { - const watchExpression = element; + if (element instanceof Expression) { + const watchExpression = element; if (watchExpression.reference === 0) { this.debugService.getViewModel().setSelectedExpression(watchExpression); } @@ -978,10 +978,10 @@ export class WatchExpressionsController extends BaseDebugController { return false; } - protected onDelete(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onDelete(tree: ITree, event: IKeyboardEvent): boolean { const element = tree.getFocus(); - if (element instanceof model.Expression) { - const we = element; + if (element instanceof Expression) { + const we = element; this.debugService.removeWatchExpressions(we.getId()); return true; @@ -993,83 +993,83 @@ export class WatchExpressionsController extends BaseDebugController { // breakpoints -export class BreakpointsActionProvider implements renderer.IActionProvider { +export class BreakpointsActionProvider implements IActionProvider { constructor(private instantiationService: IInstantiationService) { // noop } - public hasActions(tree: tree.ITree, element: any): boolean { - return element instanceof model.Breakpoint; + public hasActions(tree: ITree, element: any): boolean { + return element instanceof Breakpoint; } - public hasSecondaryActions(tree: tree.ITree, element: any): boolean { - return element instanceof model.Breakpoint || element instanceof model.ExceptionBreakpoint || element instanceof model.FunctionBreakpoint; + public hasSecondaryActions(tree: ITree, element: any): boolean { + return element instanceof Breakpoint || element instanceof ExceptionBreakpoint || element instanceof FunctionBreakpoint; } - public getActions(tree: tree.ITree, element: any): TPromise { - if (element instanceof model.Breakpoint) { + public getActions(tree: ITree, element: any): TPromise { + if (element instanceof Breakpoint) { return TPromise.as(this.getBreakpointActions()); } return TPromise.as([]); } - public getBreakpointActions(): actions.IAction[] { - return [this.instantiationService.createInstance(debugactions.RemoveBreakpointAction, debugactions.RemoveBreakpointAction.ID, debugactions.RemoveBreakpointAction.LABEL)]; + public getBreakpointActions(): IAction[] { + return [this.instantiationService.createInstance(RemoveBreakpointAction, RemoveBreakpointAction.ID, RemoveBreakpointAction.LABEL)]; } - public getSecondaryActions(tree: tree.ITree, element: any): TPromise { - const actions: actions.Action[] = [this.instantiationService.createInstance(debugactions.ToggleEnablementAction, debugactions.ToggleEnablementAction.ID, debugactions.ToggleEnablementAction.LABEL)]; - actions.push(new actionbar.Separator()); + public getSecondaryActions(tree: ITree, element: any): TPromise { + const actions: IAction[] = [this.instantiationService.createInstance(ToggleEnablementAction, ToggleEnablementAction.ID, ToggleEnablementAction.LABEL)]; + actions.push(new Separator()); - if (element instanceof model.Breakpoint || element instanceof model.FunctionBreakpoint) { - actions.push(this.instantiationService.createInstance(debugactions.RemoveBreakpointAction, debugactions.RemoveBreakpointAction.ID, debugactions.RemoveBreakpointAction.LABEL)); + if (element instanceof Breakpoint || element instanceof FunctionBreakpoint) { + actions.push(this.instantiationService.createInstance(RemoveBreakpointAction, RemoveBreakpointAction.ID, RemoveBreakpointAction.LABEL)); } - actions.push(this.instantiationService.createInstance(debugactions.RemoveAllBreakpointsAction, debugactions.RemoveAllBreakpointsAction.ID, debugactions.RemoveAllBreakpointsAction.LABEL)); - actions.push(new actionbar.Separator()); + actions.push(this.instantiationService.createInstance(RemoveAllBreakpointsAction, RemoveAllBreakpointsAction.ID, RemoveAllBreakpointsAction.LABEL)); + actions.push(new Separator()); - actions.push(this.instantiationService.createInstance(debugactions.ToggleBreakpointsActivatedAction, debugactions.ToggleBreakpointsActivatedAction.ID, debugactions.ToggleBreakpointsActivatedAction.ACTIVATE_LABEL)); - actions.push(new actionbar.Separator()); + actions.push(this.instantiationService.createInstance(ToggleBreakpointsActivatedAction, ToggleBreakpointsActivatedAction.ID, ToggleBreakpointsActivatedAction.ACTIVATE_LABEL)); + actions.push(new Separator()); - actions.push(this.instantiationService.createInstance(debugactions.EnableAllBreakpointsAction, debugactions.EnableAllBreakpointsAction.ID, debugactions.EnableAllBreakpointsAction.LABEL)); - actions.push(this.instantiationService.createInstance(debugactions.DisableAllBreakpointsAction, debugactions.DisableAllBreakpointsAction.ID, debugactions.DisableAllBreakpointsAction.LABEL)); - actions.push(new actionbar.Separator()); + actions.push(this.instantiationService.createInstance(EnableAllBreakpointsAction, EnableAllBreakpointsAction.ID, EnableAllBreakpointsAction.LABEL)); + actions.push(this.instantiationService.createInstance(DisableAllBreakpointsAction, DisableAllBreakpointsAction.ID, DisableAllBreakpointsAction.LABEL)); + actions.push(new Separator()); - actions.push(this.instantiationService.createInstance(debugactions.AddFunctionBreakpointAction, debugactions.AddFunctionBreakpointAction.ID, debugactions.AddFunctionBreakpointAction.LABEL)); - if (element instanceof model.FunctionBreakpoint) { - actions.push(this.instantiationService.createInstance(debugactions.RenameFunctionBreakpointAction, debugactions.RenameFunctionBreakpointAction.ID, debugactions.RenameFunctionBreakpointAction.LABEL)); + actions.push(this.instantiationService.createInstance(AddFunctionBreakpointAction, AddFunctionBreakpointAction.ID, AddFunctionBreakpointAction.LABEL)); + if (element instanceof FunctionBreakpoint) { + actions.push(this.instantiationService.createInstance(RenameFunctionBreakpointAction, RenameFunctionBreakpointAction.ID, RenameFunctionBreakpointAction.LABEL)); } - actions.push(new actionbar.Separator()); + actions.push(new Separator()); - actions.push(this.instantiationService.createInstance(debugactions.ReapplyBreakpointsAction, debugactions.ReapplyBreakpointsAction.ID, debugactions.ReapplyBreakpointsAction.LABEL)); + actions.push(this.instantiationService.createInstance(ReapplyBreakpointsAction, ReapplyBreakpointsAction.ID, ReapplyBreakpointsAction.LABEL)); return TPromise.as(actions); } - public getActionItem(tree: tree.ITree, element: any, action: actions.IAction): actionbar.IActionItem { + public getActionItem(tree: ITree, element: any, action: IAction): IActionItem { return null; } } -export class BreakpointsDataSource implements tree.IDataSource { +export class BreakpointsDataSource implements IDataSource { - public getId(tree: tree.ITree, element: any): string { + public getId(tree: ITree, element: any): string { return element.getId(); } - public hasChildren(tree: tree.ITree, element: any): boolean { - return element instanceof model.Model; + public hasChildren(tree: ITree, element: any): boolean { + return element instanceof Model; } - public getChildren(tree: tree.ITree, element: any): TPromise { - const model = element; + public getChildren(tree: ITree, element: any): TPromise { + const model = element; const exBreakpoints = model.getExceptionBreakpoints(); return TPromise.as(exBreakpoints.concat(model.getFunctionBreakpoints()).concat(model.getBreakpoints())); } - public getParent(tree: tree.ITree, element: any): TPromise { + public getParent(tree: ITree, element: any): TPromise { return TPromise.as(null); } } @@ -1082,16 +1082,16 @@ interface IExceptionBreakpointTemplateData { } interface IBreakpointTemplateData extends IExceptionBreakpointTemplateData { - actionBar: actionbar.ActionBar; + actionBar: ActionBar; lineNumber: HTMLElement; filePath: HTMLElement; } interface IFunctionBreakpointTemplateData extends IExceptionBreakpointTemplateData { - actionBar: actionbar.ActionBar; + actionBar: ActionBar; } -export class BreakpointsRenderer implements tree.IRenderer { +export class BreakpointsRenderer implements IRenderer { private static EXCEPTION_BREAKPOINT_TEMPLATE_ID = 'exceptionBreakpoint'; private static FUNCTION_BREAKPOINT_TEMPLATE_ID = 'functionBreakpoint'; @@ -1099,7 +1099,7 @@ export class BreakpointsRenderer implements tree.IRenderer { constructor( private actionProvider: BreakpointsActionProvider, - private actionRunner: actions.IActionRunner, + private actionRunner: IActionRunner, @IWorkspaceContextService private contextService: IWorkspaceContextService, @debug.IDebugService private debugService: debug.IDebugService, @IContextViewService private contextViewService: IContextViewService @@ -1107,28 +1107,28 @@ export class BreakpointsRenderer implements tree.IRenderer { // noop } - public getHeight(tree: tree.ITree, element: any): number { + public getHeight(tree: ITree, element: any): number { return 22; } - public getTemplateId(tree: tree.ITree, element: any): string { - if (element instanceof model.Breakpoint) { + public getTemplateId(tree: ITree, element: any): string { + if (element instanceof Breakpoint) { return BreakpointsRenderer.BREAKPOINT_TEMPLATE_ID; } - if (element instanceof model.FunctionBreakpoint) { + if (element instanceof FunctionBreakpoint) { return BreakpointsRenderer.FUNCTION_BREAKPOINT_TEMPLATE_ID; } - if (element instanceof model.ExceptionBreakpoint) { + if (element instanceof ExceptionBreakpoint) { return BreakpointsRenderer.EXCEPTION_BREAKPOINT_TEMPLATE_ID; } return null; } - public renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement): any { + public renderTemplate(tree: ITree, templateId: string, container: HTMLElement): any { const data: IBreakpointTemplateData = Object.create(null); if (templateId === BreakpointsRenderer.BREAKPOINT_TEMPLATE_ID || templateId === BreakpointsRenderer.FUNCTION_BREAKPOINT_TEMPLATE_ID) { - data.actionBar = new actionbar.ActionBar(container, { actionRunner: this.actionRunner }); + data.actionBar = new ActionBar(container, { actionRunner: this.actionRunner }); data.actionBar.push(this.actionProvider.getBreakpointActions(), { icon: true, label: false }); } @@ -1150,7 +1150,7 @@ export class BreakpointsRenderer implements tree.IRenderer { return data; } - public renderElement(tree: tree.ITree, element: any, templateId: string, templateData: any): void { + public renderElement(tree: ITree, element: any, templateId: string, templateData: any): void { templateData.toDisposeBeforeRender = lifecycle.dispose(templateData.toDisposeBeforeRender); templateData.toDisposeBeforeRender.push(dom.addStandardDisposableListener(templateData.checkbox, 'change', (e) => { this.debugService.enableOrDisableBreakpoints(!element.enabled, element); @@ -1171,7 +1171,7 @@ export class BreakpointsRenderer implements tree.IRenderer { data.checkbox.checked = exceptionBreakpoint.enabled; } - private renderFunctionBreakpoint(tree: tree.ITree, functionBreakpoint: debug.IFunctionBreakpoint, data: IFunctionBreakpointTemplateData): void { + private renderFunctionBreakpoint(tree: ITree, functionBreakpoint: debug.IFunctionBreakpoint, data: IFunctionBreakpointTemplateData): void { const selected = this.debugService.getViewModel().getSelectedFunctionBreakpoint(); if (!functionBreakpoint.name || (selected && selected.getId() === functionBreakpoint.getId())) { renderRenameBox(this.debugService, this.contextViewService, tree, functionBreakpoint, data.breakpoint, { @@ -1198,12 +1198,12 @@ export class BreakpointsRenderer implements tree.IRenderer { data.actionBar.context = functionBreakpoint; } - private renderBreakpoint(tree: tree.ITree, breakpoint: debug.IBreakpoint, data: IBreakpointTemplateData): void { + private renderBreakpoint(tree: ITree, breakpoint: debug.IBreakpoint, data: IBreakpointTemplateData): void { this.debugService.getModel().areBreakpointsActivated() ? tree.removeTraits('disabled', [breakpoint]) : tree.addTraits('disabled', [breakpoint]); - data.name.textContent = labels.getPathLabel(paths.basename(breakpoint.source.uri.fsPath), this.contextService); + data.name.textContent = getPathLabel(paths.basename(breakpoint.source.uri.fsPath), this.contextService); data.lineNumber.textContent = breakpoint.desiredLineNumber !== breakpoint.lineNumber ? breakpoint.desiredLineNumber + ' \u2192 ' + breakpoint.lineNumber : '' + breakpoint.lineNumber; - data.filePath.textContent = labels.getPathLabel(paths.dirname(breakpoint.source.uri.fsPath), this.contextService); + data.filePath.textContent = getPathLabel(paths.dirname(breakpoint.source.uri.fsPath), this.contextService); data.checkbox.checked = breakpoint.enabled; data.actionBar.context = breakpoint; @@ -1218,28 +1218,28 @@ export class BreakpointsRenderer implements tree.IRenderer { } } - public disposeTemplate(tree: tree.ITree, templateId: string, templateData: any): void { + public disposeTemplate(tree: ITree, templateId: string, templateData: any): void { if (templateId === BreakpointsRenderer.BREAKPOINT_TEMPLATE_ID || templateId === BreakpointsRenderer.FUNCTION_BREAKPOINT_TEMPLATE_ID) { templateData.actionBar.dispose(); } } } -export class BreakpointsAccessibilityProvider implements tree.IAccessibilityProvider { +export class BreakpointsAccessibilityProvider implements IAccessibilityProvider { constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) { // noop } - public getAriaLabel(tree: tree.ITree, element: any): string { - if (element instanceof model.Breakpoint) { - return nls.localize('breakpointAriaLabel', "Breakpoint line {0} {1}, breakpoints, debug", (element).lineNumber, getSourceName((element).source, this.contextService)); + public getAriaLabel(tree: ITree, element: any): string { + if (element instanceof Breakpoint) { + return nls.localize('breakpointAriaLabel', "Breakpoint line {0} {1}, breakpoints, debug", (element).lineNumber, getSourceName((element).source, this.contextService)); } - if (element instanceof model.FunctionBreakpoint) { - return nls.localize('functionBreakpointAriaLabel', "Function breakpoint {0}, breakpoints, debug", (element).name); + if (element instanceof FunctionBreakpoint) { + return nls.localize('functionBreakpointAriaLabel', "Function breakpoint {0}, breakpoints, debug", (element).name); } - if (element instanceof model.ExceptionBreakpoint) { - return nls.localize('exceptionBreakpointAriaLabel', "Exception breakpoint {0}, breakpoints, debug", (element).filter); + if (element instanceof ExceptionBreakpoint) { + return nls.localize('exceptionBreakpointAriaLabel', "Exception breakpoint {0}, breakpoints, debug", (element).filter); } return null; @@ -1248,7 +1248,7 @@ export class BreakpointsAccessibilityProvider implements tree.IAccessibilityProv export class BreakpointsController extends BaseDebugController { - constructor(debugService: debug.IDebugService, contextMenuService: IContextMenuService, actionProvider: renderer.IActionProvider) { + constructor(debugService: debug.IDebugService, contextMenuService: IContextMenuService, actionProvider: IActionProvider) { super(debugService, contextMenuService, actionProvider); if (isMacintosh) { this.downKeyBindingDispatcher.set(KeyCode.Enter, this.onRename.bind(this)); @@ -1257,32 +1257,32 @@ export class BreakpointsController extends BaseDebugController { } } - protected onLeftClick(tree: tree.ITree, element: any, event: IMouseEvent): boolean { - if (element instanceof model.FunctionBreakpoint && event.detail === 2) { + protected onLeftClick(tree: ITree, element: any, event: IMouseEvent): boolean { + if (element instanceof FunctionBreakpoint && event.detail === 2) { this.debugService.getViewModel().setSelectedFunctionBreakpoint(element); return true; } - if (element instanceof model.Breakpoint) { + if (element instanceof Breakpoint) { this.openBreakpointSource(element, event, true); } return super.onLeftClick(tree, element, event); } - protected onRename(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onRename(tree: ITree, event: IKeyboardEvent): boolean { const element = tree.getFocus(); - if (element instanceof model.FunctionBreakpoint && element.name) { + if (element instanceof FunctionBreakpoint && element.name) { this.debugService.getViewModel().setSelectedFunctionBreakpoint(element); return true; } - if (element instanceof model.Breakpoint) { + if (element instanceof Breakpoint) { this.openBreakpointSource(element, event, false); } return super.onEnter(tree, event); } - protected onSpace(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onSpace(tree: ITree, event: IKeyboardEvent): boolean { super.onSpace(tree, event); const element = tree.getFocus(); this.debugService.enableOrDisableBreakpoints(!element.enabled, element).done(null, errors.onUnexpectedError); @@ -1290,13 +1290,13 @@ export class BreakpointsController extends BaseDebugController { return true; } - protected onDelete(tree: tree.ITree, event: IKeyboardEvent): boolean { + protected onDelete(tree: ITree, event: IKeyboardEvent): boolean { const element = tree.getFocus(); - if (element instanceof model.Breakpoint) { - this.debugService.removeBreakpoints((element).getId()).done(null, errors.onUnexpectedError); + if (element instanceof Breakpoint) { + this.debugService.removeBreakpoints((element).getId()).done(null, errors.onUnexpectedError); return true; - } else if (element instanceof model.FunctionBreakpoint) { - const fbp = element; + } else if (element instanceof FunctionBreakpoint) { + const fbp = element; this.debugService.removeFunctionBreakpoints(fbp.getId()).done(null, errors.onUnexpectedError); return true;