Skip to content

Commit b0b7bd0

Browse files
committed
debugHover - restructure imports
1 parent c2c080d commit b0b7bd0

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

src/vs/workbench/parts/debug/electron-browser/debugHover.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import lifecycle = require('vs/base/common/lifecycle');
6+
import * as nls from 'vs/nls';
7+
import * as lifecycle from 'vs/base/common/lifecycle';
78
import { TPromise } from 'vs/base/common/winjs.base';
89
import { KeyCode } from 'vs/base/common/keyCodes';
9-
import dom = require('vs/base/browser/dom');
10-
import * as nls from 'vs/nls';
10+
import * as dom from 'vs/base/browser/dom';
1111
import { ITree } from 'vs/base/parts/tree/browser/tree';
1212
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
13+
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
1314
import { DefaultController, ICancelableEvent } from 'vs/base/parts/tree/browser/treeDefaults';
1415
import { IConfigurationChangedEvent } from 'vs/editor/common/editorCommon';
15-
import editorbrowser = require('vs/editor/browser/editorBrowser');
16-
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
17-
import debug = require('vs/workbench/parts/debug/common/debug');
18-
import { Expression } from 'vs/workbench/parts/debug/common/debugModel';
19-
import viewer = require('vs/workbench/parts/debug/electron-browser/debugViewer');
20-
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
2116
import { Position } from 'vs/editor/common/core/position';
2217
import { Range } from 'vs/editor/common/core/range';
18+
import { IContentWidget, ICodeEditor, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';
19+
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
20+
import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/parts/debug/common/debug';
21+
import { Expression } from 'vs/workbench/parts/debug/common/debugModel';
22+
import { VariablesRenderer, renderExpressionValue, VariablesDataSource } from 'vs/workbench/parts/debug/electron-browser/debugViewer';
2323

2424
const $ = dom.$;
2525
const debugTreeOptions = {
@@ -30,7 +30,7 @@ const debugTreeOptions = {
3030
const MAX_ELEMENTS_SHOWN = 18;
3131
const MAX_VALUE_RENDER_LENGTH_IN_HOVER = 4096;
3232

33-
export class DebugHoverWidget implements editorbrowser.IContentWidget {
33+
export class DebugHoverWidget implements IContentWidget {
3434

3535
public static ID = 'debug.hoverWidget';
3636
// editor.IContentWidget.allowEditorOverflow
@@ -48,14 +48,14 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
4848
private stoleFocus: boolean;
4949
private toDispose: lifecycle.IDisposable[];
5050

51-
constructor(private editor: editorbrowser.ICodeEditor, private debugService: debug.IDebugService, private instantiationService: IInstantiationService) {
51+
constructor(private editor: ICodeEditor, private debugService: IDebugService, private instantiationService: IInstantiationService) {
5252
this.domNode = $('.debug-hover-widget');
5353
this.complexValueContainer = dom.append(this.domNode, $('.complex-value'));
5454
this.complexValueTitle = dom.append(this.complexValueContainer, $('.title'));
5555
this.treeContainer = dom.append(this.complexValueContainer, $('.debug-hover-tree'));
5656
this.treeContainer.setAttribute('role', 'tree');
5757
this.tree = new Tree(this.treeContainer, {
58-
dataSource: new viewer.VariablesDataSource(),
58+
dataSource: new VariablesDataSource(),
5959
renderer: this.instantiationService.createInstance(VariablesHoverRenderer),
6060
controller: new DebugHoverController(editor)
6161
}, debugTreeOptions);
@@ -158,7 +158,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
158158
const expressionRange = this.getExactExpressionRange(lineContent, range);
159159
// use regex to extract the sub-expression #9821
160160
const matchingExpression = lineContent.substring(expressionRange.startColumn - 1, expressionRange.endColumn);
161-
let promise: TPromise<debug.IExpression>;
161+
let promise: TPromise<IExpression>;
162162
if (process.session.configuration.capabilities.supportsEvaluateForHovers) {
163163
const result = new Expression(matchingExpression);
164164
promise = result.evaluate(process, focusedStackFrame, 'hover').then(() => result);
@@ -183,7 +183,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
183183
});
184184
}
185185

186-
private doFindExpression(container: debug.IExpressionContainer, namesToFind: string[]): TPromise<debug.IExpression> {
186+
private doFindExpression(container: IExpressionContainer, namesToFind: string[]): TPromise<IExpression> {
187187
return container.getChildren(this.debugService).then(children => {
188188
// look for our variable in the list. First find the parents of the hovered variable if there are any.
189189
// some languages pass the type as part of the name, so need to check if the last word of the name matches.
@@ -200,7 +200,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
200200
});
201201
}
202202

203-
private findExpressionInStackFrame(namesToFind: string[]): TPromise<debug.IExpression> {
203+
private findExpressionInStackFrame(namesToFind: string[]): TPromise<IExpression> {
204204
return this.debugService.getViewModel().focusedStackFrame.getScopes()
205205
// no expensive scopes
206206
.then(scopes => scopes.filter(scope => !scope.expensive))
@@ -210,15 +210,15 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
210210
.then(expressions => (expressions.length > 0 && expressions.every(e => e.value === expressions[0].value)) ? expressions[0] : null);
211211
}
212212

213-
private doShow(position: Position, expression: debug.IExpression, focus: boolean, forceValueHover = false): TPromise<void> {
213+
private doShow(position: Position, expression: IExpression, focus: boolean, forceValueHover = false): TPromise<void> {
214214
this.showAtPosition = position;
215215
this.isVisible = true;
216216
this.stoleFocus = focus;
217217

218218
if (!expression.hasChildren || forceValueHover) {
219219
this.complexValueContainer.hidden = true;
220220
this.valueContainer.hidden = false;
221-
viewer.renderExpressionValue(expression, this.valueContainer, false, MAX_VALUE_RENDER_LENGTH_IN_HOVER);
221+
renderExpressionValue(expression, this.valueContainer, false, MAX_VALUE_RENDER_LENGTH_IN_HOVER);
222222
this.valueContainer.title = '';
223223
this.editor.layoutContentWidget(this);
224224
if (focus) {
@@ -277,12 +277,12 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
277277
}
278278
}
279279

280-
public getPosition(): editorbrowser.IContentWidgetPosition {
280+
public getPosition(): IContentWidgetPosition {
281281
return this.isVisible ? {
282282
position: this.showAtPosition,
283283
preference: [
284-
editorbrowser.ContentWidgetPositionPreference.ABOVE,
285-
editorbrowser.ContentWidgetPositionPreference.BELOW
284+
ContentWidgetPositionPreference.ABOVE,
285+
ContentWidgetPositionPreference.BELOW
286286
]
287287
} : null;
288288
}
@@ -294,7 +294,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
294294

295295
class DebugHoverController extends DefaultController {
296296

297-
constructor(private editor: editorbrowser.ICodeEditor) {
297+
constructor(private editor: ICodeEditor) {
298298
super();
299299
}
300300

@@ -310,7 +310,7 @@ class DebugHoverController extends DefaultController {
310310
}
311311
}
312312

313-
class VariablesHoverRenderer extends viewer.VariablesRenderer {
313+
class VariablesHoverRenderer extends VariablesRenderer {
314314

315315
public getHeight(tree: ITree, element: any): number {
316316
return 18;

0 commit comments

Comments
 (0)