Skip to content

Commit c2c080d

Browse files
committed
debug: restructure imports
1 parent fe4d68e commit c2c080d

4 files changed

Lines changed: 46 additions & 46 deletions

File tree

src/vs/workbench/parts/debug/common/debugSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import uri from 'vs/base/common/uri';
7-
import paths = require('vs/base/common/paths');
7+
import * as paths from 'vs/base/common/paths';
88
import { DEBUG_SCHEME } from 'vs/workbench/parts/debug/common/debug';
99

1010
export class Source {

src/vs/workbench/parts/debug/common/debugViewModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import Event, { Emitter } from 'vs/base/common/event';
7-
import debug = require('vs/workbench/parts/debug/common/debug');
7+
import * as debug from 'vs/workbench/parts/debug/common/debug';
88

99
export class ViewModel implements debug.IViewModel {
1010

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

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

6-
import nls = require('vs/nls');
6+
import * as nls from 'vs/nls';
77
import { TPromise } from 'vs/base/common/winjs.base';
88
import { RunOnceScheduler } from 'vs/base/common/async';
9-
import lifecycle = require('vs/base/common/lifecycle');
10-
import env = require('vs/base/common/platform');
9+
import * as lifecycle from 'vs/base/common/lifecycle';
10+
import * as env from 'vs/base/common/platform';
1111
import uri from 'vs/base/common/uri';
1212
import { IAction, Action } from 'vs/base/common/actions';
1313
import { KeyCode } from 'vs/base/common/keyCodes';
14-
import keyboard = require('vs/base/browser/keyboardEvent');
15-
import editorbrowser = require('vs/editor/browser/editorBrowser');
14+
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
15+
import { ICodeEditor, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser';
1616
import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions';
17-
import editorcommon = require('vs/editor/common/editorCommon');
17+
import { IModelDecorationOptions, MouseTargetType, IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/editorCommon';
1818
import { DebugHoverWidget } from 'vs/workbench/parts/debug/electron-browser/debugHover';
19-
import debugactions = require('vs/workbench/parts/debug/browser/debugActions');
20-
import debug = require('vs/workbench/parts/debug/common/debug');
19+
import { RemoveBreakpointAction, EditConditionalBreakpointAction, ToggleEnablementAction, AddConditionalBreakpointAction } from 'vs/workbench/parts/debug/browser/debugActions';
20+
import { IDebugEditorContribution, IDebugService, State, IBreakpoint, EDITOR_CONTRIBUTION_ID } from 'vs/workbench/parts/debug/common/debug';
2121
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
2222
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
2323
import { Range } from 'vs/editor/common/core/range';
@@ -26,7 +26,7 @@ import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'
2626
const HOVER_DELAY = 300;
2727

2828
@editorContribution
29-
export class DebugEditorContribution implements debug.IDebugEditorContribution {
29+
export class DebugEditorContribution implements IDebugEditorContribution {
3030

3131
private toDispose: lifecycle.IDisposable[];
3232
private breakpointHintDecoration: string[];
@@ -37,8 +37,8 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
3737
private hoveringOver: string;
3838

3939
constructor(
40-
private editor: editorbrowser.ICodeEditor,
41-
@debug.IDebugService private debugService: debug.IDebugService,
40+
private editor: ICodeEditor,
41+
@IDebugService private debugService: IDebugService,
4242
@IContextMenuService private contextMenuService: IContextMenuService,
4343
@IInstantiationService private instantiationService: IInstantiationService,
4444
@ICodeEditorService private codeEditorService: ICodeEditorService
@@ -51,12 +51,12 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
5151
this.registerListeners();
5252
}
5353

54-
private getContextMenuActions(breakpoint: debug.IBreakpoint, uri: uri, lineNumber: number): TPromise<IAction[]> {
54+
private getContextMenuActions(breakpoint: IBreakpoint, uri: uri, lineNumber: number): TPromise<IAction[]> {
5555
const actions = [];
5656
if (breakpoint) {
57-
actions.push(this.instantiationService.createInstance(debugactions.RemoveBreakpointAction, debugactions.RemoveBreakpointAction.ID, debugactions.RemoveBreakpointAction.LABEL));
58-
actions.push(this.instantiationService.createInstance(debugactions.EditConditionalBreakpointAction, debugactions.EditConditionalBreakpointAction.ID, debugactions.EditConditionalBreakpointAction.LABEL, this.editor, lineNumber));
59-
actions.push(this.instantiationService.createInstance(debugactions.ToggleEnablementAction, debugactions.ToggleEnablementAction.ID, debugactions.ToggleEnablementAction.LABEL));
57+
actions.push(this.instantiationService.createInstance(RemoveBreakpointAction, RemoveBreakpointAction.ID, RemoveBreakpointAction.LABEL));
58+
actions.push(this.instantiationService.createInstance(EditConditionalBreakpointAction, EditConditionalBreakpointAction.ID, EditConditionalBreakpointAction.LABEL, this.editor, lineNumber));
59+
actions.push(this.instantiationService.createInstance(ToggleEnablementAction, ToggleEnablementAction.ID, ToggleEnablementAction.LABEL));
6060
} else {
6161
actions.push(new Action(
6262
'addBreakpoint',
@@ -65,15 +65,15 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
6565
true,
6666
() => this.debugService.addBreakpoints(uri, [{ lineNumber }])
6767
));
68-
actions.push(this.instantiationService.createInstance(debugactions.AddConditionalBreakpointAction, debugactions.AddConditionalBreakpointAction.ID, debugactions.AddConditionalBreakpointAction.LABEL, this.editor, lineNumber));
68+
actions.push(this.instantiationService.createInstance(AddConditionalBreakpointAction, AddConditionalBreakpointAction.ID, AddConditionalBreakpointAction.LABEL, this.editor, lineNumber));
6969
}
7070

7171
return TPromise.as(actions);
7272
}
7373

7474
private registerListeners(): void {
75-
this.toDispose.push(this.editor.onMouseDown((e: editorbrowser.IEditorMouseEvent) => {
76-
if (e.target.type !== editorcommon.MouseTargetType.GUTTER_GLYPH_MARGIN || /* after last line */ e.target.detail) {
75+
this.toDispose.push(this.editor.onMouseDown((e: IEditorMouseEvent) => {
76+
if (e.target.type !== MouseTargetType.GUTTER_GLYPH_MARGIN || /* after last line */ e.target.detail) {
7777
return;
7878
}
7979
const canSetBreakpoints = this.debugService.getConfigurationManager().canSetBreakpointsIn(this.editor.getModel());
@@ -106,46 +106,46 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
106106
}
107107
}));
108108

109-
this.toDispose.push(this.editor.onMouseMove((e: editorbrowser.IEditorMouseEvent) => {
109+
this.toDispose.push(this.editor.onMouseMove((e: IEditorMouseEvent) => {
110110
var showBreakpointHintAtLineNumber = -1;
111-
if (e.target.type === editorcommon.MouseTargetType.GUTTER_GLYPH_MARGIN && this.debugService.getConfigurationManager().canSetBreakpointsIn(this.editor.getModel())) {
111+
if (e.target.type === MouseTargetType.GUTTER_GLYPH_MARGIN && this.debugService.getConfigurationManager().canSetBreakpointsIn(this.editor.getModel())) {
112112
if (!e.target.detail) {
113113
// is not after last line
114114
showBreakpointHintAtLineNumber = e.target.position.lineNumber;
115115
}
116116
}
117117
this.ensureBreakpointHintDecoration(showBreakpointHintAtLineNumber);
118118
}));
119-
this.toDispose.push(this.editor.onMouseLeave((e: editorbrowser.IEditorMouseEvent) => {
119+
this.toDispose.push(this.editor.onMouseLeave((e: IEditorMouseEvent) => {
120120
this.ensureBreakpointHintDecoration(-1);
121121
}));
122122
this.toDispose.push(this.debugService.onDidChangeState(() => this.onDebugStateUpdate()));
123123

124124
// hover listeners & hover widget
125-
this.toDispose.push(this.editor.onMouseDown((e: editorbrowser.IEditorMouseEvent) => this.onEditorMouseDown(e)));
126-
this.toDispose.push(this.editor.onMouseMove((e: editorbrowser.IEditorMouseEvent) => this.onEditorMouseMove(e)));
127-
this.toDispose.push(this.editor.onMouseLeave((e: editorbrowser.IEditorMouseEvent) => {
125+
this.toDispose.push(this.editor.onMouseDown((e: IEditorMouseEvent) => this.onEditorMouseDown(e)));
126+
this.toDispose.push(this.editor.onMouseMove((e: IEditorMouseEvent) => this.onEditorMouseMove(e)));
127+
this.toDispose.push(this.editor.onMouseLeave((e: IEditorMouseEvent) => {
128128
const rect = this.hoverWidget.getDomNode().getBoundingClientRect();
129129
// Only hide the hover widget if the editor mouse leave event is outside the hover widget #3528
130130
if (e.event.posx < rect.left || e.event.posx > rect.right || e.event.posy < rect.top || e.event.posy > rect.bottom) {
131131
this.hideHoverWidget();
132132
}
133133
}));
134-
this.toDispose.push(this.editor.onKeyDown((e: keyboard.IKeyboardEvent) => this.onKeyDown(e)));
134+
this.toDispose.push(this.editor.onKeyDown((e: IKeyboardEvent) => this.onKeyDown(e)));
135135
this.toDispose.push(this.editor.onDidChangeModel(() => this.hideHoverWidget()));
136136
this.toDispose.push(this.editor.onDidScrollChange(() => this.hideHoverWidget));
137137
}
138138

139139
public getId(): string {
140-
return debug.EDITOR_CONTRIBUTION_ID;
140+
return EDITOR_CONTRIBUTION_ID;
141141
}
142142

143143
public showHover(range: Range, hoveringOver: string, focus: boolean): TPromise<void> {
144144
return this.hoverWidget.showAt(range, hoveringOver, focus);
145145
}
146146

147147
private ensureBreakpointHintDecoration(showBreakpointHintAtLineNumber: number): void {
148-
var newDecoration: editorcommon.IModelDeltaDecoration[] = [];
148+
var newDecoration: IModelDeltaDecoration[] = [];
149149
if (showBreakpointHintAtLineNumber !== -1) {
150150
newDecoration.push({
151151
options: DebugEditorContribution.BREAKPOINT_HELPER_DECORATION,
@@ -163,11 +163,11 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
163163

164164
private onDebugStateUpdate(): void {
165165
const state = this.debugService.state;
166-
if (state !== debug.State.Stopped) {
166+
if (state !== State.Stopped) {
167167
this.hideHoverWidget();
168168
}
169169
this.codeEditorService.listCodeEditors().forEach(e => {
170-
e.updateOptions({ hover: state !== debug.State.Stopped });
170+
e.updateOptions({ hover: state !== State.Stopped });
171171
});
172172
}
173173

@@ -181,27 +181,27 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
181181

182182
// hover business
183183

184-
private onEditorMouseDown(mouseEvent: editorbrowser.IEditorMouseEvent): void {
185-
if (mouseEvent.target.type === editorcommon.MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === DebugHoverWidget.ID) {
184+
private onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {
185+
if (mouseEvent.target.type === MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === DebugHoverWidget.ID) {
186186
return;
187187
}
188188

189189
this.hideHoverWidget();
190190
}
191191

192-
private onEditorMouseMove(mouseEvent: editorbrowser.IEditorMouseEvent): void {
193-
if (this.debugService.state !== debug.State.Stopped) {
192+
private onEditorMouseMove(mouseEvent: IEditorMouseEvent): void {
193+
if (this.debugService.state !== State.Stopped) {
194194
return;
195195
}
196196

197197
const targetType = mouseEvent.target.type;
198198
const stopKey = env.isMacintosh ? 'metaKey' : 'ctrlKey';
199199

200-
if (targetType === editorcommon.MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === DebugHoverWidget.ID && !(<any>mouseEvent.event)[stopKey]) {
200+
if (targetType === MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === DebugHoverWidget.ID && !(<any>mouseEvent.event)[stopKey]) {
201201
// mouse moved on top of debug hover widget
202202
return;
203203
}
204-
if (targetType === editorcommon.MouseTargetType.CONTENT_TEXT) {
204+
if (targetType === MouseTargetType.CONTENT_TEXT) {
205205
const wordAtPosition = this.editor.getModel().getWordAtPosition(mouseEvent.target.range.getStartPosition());
206206
if (wordAtPosition && this.hoveringOver !== wordAtPosition.word) {
207207
this.hoverRange = mouseEvent.target.range;
@@ -213,7 +213,7 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
213213
}
214214
}
215215

216-
private onKeyDown(e: keyboard.IKeyboardEvent): void {
216+
private onKeyDown(e: IKeyboardEvent): void {
217217
const stopKey = env.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl;
218218
if (e.keyCode !== stopKey) {
219219
// do not hide hover when Ctrl/Meta is pressed
@@ -223,9 +223,9 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
223223

224224
// end hover business
225225

226-
private static BREAKPOINT_HELPER_DECORATION: editorcommon.IModelDecorationOptions = {
226+
private static BREAKPOINT_HELPER_DECORATION: IModelDecorationOptions = {
227227
glyphMarginClassName: 'debug-breakpoint-hint-glyph',
228-
stickiness: editorcommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
228+
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
229229
};
230230

231231
public dispose(): void {

src/vs/workbench/parts/debug/node/debugAdapter.ts

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

6-
import nls = require('vs/nls');
6+
import * as nls from 'vs/nls';
77
import { TPromise } from 'vs/base/common/winjs.base';
8-
import strings = require('vs/base/common/strings');
9-
import objects = require('vs/base/common/objects');
10-
import paths = require('vs/base/common/paths');
11-
import platform = require('vs/base/common/platform');
12-
import debug = require('vs/workbench/parts/debug/common/debug');
8+
import * as strings from 'vs/base/common/strings';
9+
import * as objects from 'vs/base/common/objects';
10+
import * as paths from 'vs/base/common/paths';
11+
import * as platform from 'vs/base/common/platform';
12+
import * as debug from 'vs/workbench/parts/debug/common/debug';
1313
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
1414
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
1515
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';

0 commit comments

Comments
 (0)