From 71b5a2b385a21067c69453075124f8281c128c32 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 28 Oct 2016 16:24:27 +0200 Subject: [PATCH] debug: import polish --- src/vs/workbench/parts/debug/common/debug.ts | 8 ++--- .../parts/debug/common/debugModel.ts | 32 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 84cd7a2814a..fc8d05b07a7 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; import severity from 'vs/base/common/severity'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import editor = require('vs/editor/common/editorCommon'); +import { IModel as EditorIModel, IEditorContribution } from 'vs/editor/common/editorCommon'; import { Position } from 'vs/editor/common/core/position'; import { ISuggestion } from 'vs/editor/common/modes'; import { Source } from 'vs/workbench/parts/debug/common/debugSource'; @@ -98,9 +98,9 @@ export interface ISession { export interface IProcess extends ITreeElement { name: string; + session: ISession; getThread(threadId: number): IThread; getAllThreads(): IThread[]; - session: ISession; } export interface IThread extends ITreeElement { @@ -346,7 +346,7 @@ export interface IConfigurationManager { /** * Returns true if breakpoints can be set for a given editor model. Depends on mode. */ - canSetBreakpointsIn(model: editor.IModel): boolean; + canSetBreakpointsIn(model: EditorIModel): boolean; } export const IDebugService = createDecorator(DEBUG_SERVICE_ID); @@ -476,7 +476,7 @@ export interface IDebugService { } // Editor interfaces -export interface IDebugEditorContribution extends editor.IEditorContribution { +export interface IDebugEditorContribution extends IEditorContribution { showHover(range: Range, hoveringOver: string, focus: boolean): TPromise; } diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 6c6d90aeb5e..f61497f42c7 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -4,17 +4,17 @@ *--------------------------------------------------------------------------------------------*/ import { TPromise } from 'vs/base/common/winjs.base'; -import nls = require('vs/nls'); -import lifecycle = require('vs/base/common/lifecycle'); +import * as nls from 'vs/nls'; +import * as lifecycle from 'vs/base/common/lifecycle'; import Event, { Emitter } from 'vs/base/common/event'; -import uuid = require('vs/base/common/uuid'); -import objects = require('vs/base/common/objects'); +import { generateUuid } from 'vs/base/common/uuid'; +import { clone } from 'vs/base/common/objects'; import severity from 'vs/base/common/severity'; -import types = require('vs/base/common/types'); -import arrays = require('vs/base/common/arrays'); +import { isObject, isString } from 'vs/base/common/types'; +import { distinct } from 'vs/base/common/arrays'; import { ISuggestion } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; -import debug = require('vs/workbench/parts/debug/common/debug'); +import * as debug from 'vs/workbench/parts/debug/common/debug'; import { Source } from 'vs/workbench/parts/debug/common/debugSource'; const MAX_REPL_LENGTH = 10000; @@ -67,9 +67,9 @@ export class KeyValueOutputElement extends OutputElement { this._valueName = 'null'; } else if (Array.isArray(this.valueObj)) { this._valueName = `Array[${this.valueObj.length}]`; - } else if (types.isObject(this.valueObj)) { + } else if (isObject(this.valueObj)) { this._valueName = 'Object'; - } else if (types.isString(this.valueObj)) { + } else if (isString(this.valueObj)) { this._valueName = `"${massageValue(this.valueObj)}"`; } else { this._valueName = String(this.valueObj); @@ -87,7 +87,7 @@ export class KeyValueOutputElement extends OutputElement { if (!this.children) { if (Array.isArray(this.valueObj)) { this.children = (this.valueObj).slice(0, KeyValueOutputElement.MAX_CHILDREN).map((v, index) => new KeyValueOutputElement(String(index), v, null)); - } else if (types.isObject(this.valueObj)) { + } else if (isObject(this.valueObj)) { this.children = Object.getOwnPropertyNames(this.valueObj).slice(0, KeyValueOutputElement.MAX_CHILDREN).map(key => new KeyValueOutputElement(key, this.valueObj[key], null)); } else { this.children = []; @@ -179,7 +179,7 @@ export abstract class ExpressionContainer implements debug.IExpressionContainer count, filter }).then(response => { - return response && response.body && response.body.variables ? arrays.distinct(response.body.variables.filter(v => !!v), v => v.name).map( + return response && response.body && response.body.variables ? distinct(response.body.variables.filter(v => !!v), v => v.name).map( v => new Variable(this.stackFrame, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.type) ) : []; }, (e: Error) => [new Variable(this.stackFrame, this, 0, null, e.message, '', 0, 0, null, false)]); @@ -204,7 +204,7 @@ export class Expression extends ExpressionContainer implements debug.IExpression public available: boolean; public type: string; - constructor(public name: string, cacheChildren: boolean, id = uuid.generateUuid()) { + constructor(public name: string, cacheChildren: boolean, id = generateUuid()) { super(null, 0, id, cacheChildren, 0, 0); this.value = Expression.DEFAULT_VALUE; this.available = false; @@ -512,7 +512,7 @@ export class Process implements debug.IProcess { // Only update the details if all the threads are stopped // because we don't want to overwrite the details of other // threads that have stopped for a different reason - this.threads[ref].stoppedDetails = objects.clone(data.stoppedDetails); + this.threads[ref].stoppedDetails = clone(data.stoppedDetails); this.threads[ref].stopped = true; this.threads[ref].clearCallStack(); }); @@ -584,7 +584,7 @@ export class Breakpoint implements debug.IBreakpoint { } this.lineNumber = this.desiredLineNumber; this.verified = false; - this.id = uuid.generateUuid(); + this.id = generateUuid(); } public getId(): string { @@ -600,7 +600,7 @@ export class FunctionBreakpoint implements debug.IFunctionBreakpoint { constructor(public name: string, public enabled: boolean, public hitCondition: string) { this.verified = false; - this.id = uuid.generateUuid(); + this.id = generateUuid(); } public getId(): string { @@ -613,7 +613,7 @@ export class ExceptionBreakpoint implements debug.IExceptionBreakpoint { private id: string; constructor(public filter: string, public label: string, public enabled: boolean) { - this.id = uuid.generateUuid(); + this.id = generateUuid(); } public getId(): string { -- GitLab