提交 ae218e1f 编写于 作者: I isidor

debugViewlet - destructure imports

上级 9b0f6931
...@@ -4,36 +4,33 @@ ...@@ -4,36 +4,33 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/debugViewlet'; import 'vs/css!./media/debugViewlet';
import nls = require('vs/nls'); import * as nls from 'vs/nls';
import builder = require('vs/base/browser/builder'); import { $, Builder, Dimension } from 'vs/base/browser/builder';
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import lifecycle = require('vs/base/common/lifecycle'); import * as lifecycle from 'vs/base/common/lifecycle';
import actions = require('vs/base/common/actions'); import { IAction } from 'vs/base/common/actions';
import actionbar = require('vs/base/browser/ui/actionbar/actionbar'); import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { SplitView } from 'vs/base/browser/ui/splitview/splitview'; import { SplitView } from 'vs/base/browser/ui/splitview/splitview';
import memento = require('vs/workbench/common/memento'); import { Scope } from 'vs/workbench/common/memento';
import { IViewletView, Viewlet } from 'vs/workbench/browser/viewlet'; import { IViewletView, Viewlet } from 'vs/workbench/browser/viewlet';
import debug = require('vs/workbench/parts/debug/common/debug'); import { IDebugService, VIEWLET_ID, State } from 'vs/workbench/parts/debug/common/debug';
import { DebugViewRegistry } from 'vs/workbench/parts/debug/browser/debugViewRegistry'; import { DebugViewRegistry } from 'vs/workbench/parts/debug/browser/debugViewRegistry';
import debugactions = require('vs/workbench/parts/debug/browser/debugActions'); import { StartAction, ToggleReplAction, ConfigureAction, SelectConfigAction } from 'vs/workbench/parts/debug/browser/debugActions';
import dbgactionitems = require('vs/workbench/parts/debug/browser/debugActionItems'); import { SelectConfigurationActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress'; import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IStorageService } from 'vs/platform/storage/common/storage'; import { IStorageService } from 'vs/platform/storage/common/storage';
import IDebugService = debug.IDebugService;
const $ = builder.$;
export class DebugViewlet extends Viewlet { export class DebugViewlet extends Viewlet {
private toDispose: lifecycle.IDisposable[]; private toDispose: lifecycle.IDisposable[];
private actions: actions.IAction[]; private actions: IAction[];
private progressRunner: IProgressRunner; private progressRunner: IProgressRunner;
private viewletSettings: any; private viewletSettings: any;
private $el: builder.Builder; private $el: Builder;
private splitView: SplitView; private splitView: SplitView;
private views: IViewletView[]; private views: IViewletView[];
...@@ -47,10 +44,10 @@ export class DebugViewlet extends Viewlet { ...@@ -47,10 +44,10 @@ export class DebugViewlet extends Viewlet {
@IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkspaceContextService private contextService: IWorkspaceContextService,
@IStorageService storageService: IStorageService @IStorageService storageService: IStorageService
) { ) {
super(debug.VIEWLET_ID, telemetryService); super(VIEWLET_ID, telemetryService);
this.progressRunner = null; this.progressRunner = null;
this.viewletSettings = this.getMemento(storageService, memento.Scope.WORKSPACE); this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE);
this.toDispose = []; this.toDispose = [];
this.views = []; this.views = [];
this.toDispose.push(this.debugService.onDidChangeState(() => { this.toDispose.push(this.debugService.onDidChangeState(() => {
...@@ -60,7 +57,7 @@ export class DebugViewlet extends Viewlet { ...@@ -60,7 +57,7 @@ export class DebugViewlet extends Viewlet {
// viewlet // viewlet
public create(parent: builder.Builder): TPromise<void> { public create(parent: Builder): TPromise<void> {
super.create(parent); super.create(parent);
this.$el = parent.div().addClass('debug-viewlet'); this.$el = parent.div().addClass('debug-viewlet');
...@@ -98,7 +95,7 @@ export class DebugViewlet extends Viewlet { ...@@ -98,7 +95,7 @@ export class DebugViewlet extends Viewlet {
}); });
} }
public layout(dimension: builder.Dimension): void { public layout(dimension: Dimension): void {
if (this.splitView) { if (this.splitView) {
this.splitView.layout(dimension.height); this.splitView.layout(dimension.height);
} }
...@@ -117,17 +114,17 @@ export class DebugViewlet extends Viewlet { ...@@ -117,17 +114,17 @@ export class DebugViewlet extends Viewlet {
} }
} }
public getActions(): actions.IAction[] { public getActions(): IAction[] {
if (this.debugService.state === debug.State.Disabled) { if (this.debugService.state === State.Disabled) {
return []; return [];
} }
if (!this.actions) { if (!this.actions) {
this.actions = [ this.actions = [
this.instantiationService.createInstance(debugactions.StartAction, debugactions.StartAction.ID, debugactions.StartAction.LABEL), this.instantiationService.createInstance(StartAction, StartAction.ID, StartAction.LABEL),
this.instantiationService.createInstance(debugactions.SelectConfigAction, debugactions.SelectConfigAction.ID, debugactions.SelectConfigAction.LABEL), this.instantiationService.createInstance(SelectConfigAction, SelectConfigAction.ID, SelectConfigAction.LABEL),
this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL), this.instantiationService.createInstance(ConfigureAction, ConfigureAction.ID, ConfigureAction.LABEL),
this.instantiationService.createInstance(debugactions.ToggleReplAction, debugactions.ToggleReplAction.ID, debugactions.ToggleReplAction.LABEL) this.instantiationService.createInstance(ToggleReplAction, ToggleReplAction.ID, ToggleReplAction.LABEL)
]; ];
this.actions.forEach(a => { this.actions.forEach(a => {
...@@ -138,9 +135,9 @@ export class DebugViewlet extends Viewlet { ...@@ -138,9 +135,9 @@ export class DebugViewlet extends Viewlet {
return this.actions; return this.actions;
} }
public getActionItem(action: actions.IAction): actionbar.IActionItem { public getActionItem(action: IAction): IActionItem {
if (action.id === debugactions.SelectConfigAction.ID) { if (action.id === SelectConfigAction.ID) {
return this.instantiationService.createInstance(dbgactionitems.SelectConfigurationActionItem, action); return this.instantiationService.createInstance(SelectConfigurationActionItem, action);
} }
return null; return null;
...@@ -151,7 +148,7 @@ export class DebugViewlet extends Viewlet { ...@@ -151,7 +148,7 @@ export class DebugViewlet extends Viewlet {
this.progressRunner.done(); this.progressRunner.done();
} }
if (this.debugService.state === debug.State.Initializing) { if (this.debugService.state === State.Initializing) {
this.progressRunner = this.progressService.show(true); this.progressRunner = this.progressService.show(true);
} else { } else {
this.progressRunner = null; this.progressRunner = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册