Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
c2c080da
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c2c080da
编写于
11月 11, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: restructure imports
上级
fe4d68e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
46 addition
and
46 deletion
+46
-46
src/vs/workbench/parts/debug/common/debugSource.ts
src/vs/workbench/parts/debug/common/debugSource.ts
+1
-1
src/vs/workbench/parts/debug/common/debugViewModel.ts
src/vs/workbench/parts/debug/common/debugViewModel.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+38
-38
src/vs/workbench/parts/debug/node/debugAdapter.ts
src/vs/workbench/parts/debug/node/debugAdapter.ts
+6
-6
未找到文件。
src/vs/workbench/parts/debug/common/debugSource.ts
浏览文件 @
c2c080da
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
uri
from
'
vs/base/common/uri
'
;
import
paths
=
require
(
'
vs/base/common/paths
'
)
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
{
DEBUG_SCHEME
}
from
'
vs/workbench/parts/debug/common/debug
'
;
export
class
Source
{
...
...
src/vs/workbench/parts/debug/common/debugViewModel.ts
浏览文件 @
c2c080da
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
debug
=
require
(
'
vs/workbench/parts/debug/common/debug
'
)
;
import
*
as
debug
from
'
vs/workbench/parts/debug/common/debug
'
;
export
class
ViewModel
implements
debug
.
IViewModel
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
c2c080da
...
...
@@ -3,21 +3,21 @@
* 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
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
lifecycle
=
require
(
'
vs/base/common/lifecycle
'
)
;
import
env
=
require
(
'
vs/base/common/platform
'
)
;
import
*
as
lifecycle
from
'
vs/base/common/lifecycle
'
;
import
*
as
env
from
'
vs/base/common/platform
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
{
IAction
,
Action
}
from
'
vs/base/common/actions
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
keyboard
=
require
(
'
vs/base/browser/keyboardEvent
'
)
;
import
editorbrowser
=
require
(
'
vs/editor/browser/editorBrowser
'
)
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
editorContribution
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
editorcommon
=
require
(
'
vs/editor/common/editorCommon
'
)
;
import
{
IModelDecorationOptions
,
MouseTargetType
,
IModelDeltaDecoration
,
TrackedRangeStickiness
}
from
'
vs/editor/common/editorCommon
'
;
import
{
DebugHoverWidget
}
from
'
vs/workbench/parts/debug/electron-browser/debugHover
'
;
import
debugactions
=
require
(
'
vs/workbench/parts/debug/browser/debugActions
'
)
;
import
debug
=
require
(
'
vs/workbench/parts/debug/common/debug
'
)
;
import
{
RemoveBreakpointAction
,
EditConditionalBreakpointAction
,
ToggleEnablementAction
,
AddConditionalBreakpointAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IDebugEditorContribution
,
IDebugService
,
State
,
IBreakpoint
,
EDITOR_CONTRIBUTION_ID
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -26,7 +26,7 @@ import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'
const
HOVER_DELAY
=
300
;
@
editorContribution
export
class
DebugEditorContribution
implements
debug
.
IDebugEditorContribution
{
export
class
DebugEditorContribution
implements
IDebugEditorContribution
{
private
toDispose
:
lifecycle
.
IDisposable
[];
private
breakpointHintDecoration
:
string
[];
...
...
@@ -37,8 +37,8 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
private
hoveringOver
:
string
;
constructor
(
private
editor
:
editorbrowser
.
ICodeEditor
,
@
debug
.
IDebugService
private
debugService
:
debug
.
IDebugService
,
private
editor
:
ICodeEditor
,
@
IDebugService
private
debugService
:
IDebugService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
ICodeEditorService
private
codeEditorService
:
ICodeEditorService
...
...
@@ -51,12 +51,12 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
this
.
registerListeners
();
}
private
getContextMenuActions
(
breakpoint
:
debug
.
IBreakpoint
,
uri
:
uri
,
lineNumber
:
number
):
TPromise
<
IAction
[]
>
{
private
getContextMenuActions
(
breakpoint
:
IBreakpoint
,
uri
:
uri
,
lineNumber
:
number
):
TPromise
<
IAction
[]
>
{
const
actions
=
[];
if
(
breakpoint
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
RemoveBreakpointAction
,
debugactions
.
RemoveBreakpointAction
.
ID
,
debugactions
.
RemoveBreakpointAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
EditConditionalBreakpointAction
,
debugactions
.
EditConditionalBreakpointAction
.
ID
,
debugactions
.
EditConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
ToggleEnablementAction
,
debugactions
.
ToggleEnablementAction
.
ID
,
debugactions
.
ToggleEnablementAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RemoveBreakpointAction
,
RemoveBreakpointAction
.
ID
,
RemoveBreakpointAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
EditConditionalBreakpointAction
,
EditConditionalBreakpointAction
.
ID
,
EditConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
ToggleEnablementAction
,
ToggleEnablementAction
.
ID
,
ToggleEnablementAction
.
LABEL
));
}
else
{
actions
.
push
(
new
Action
(
'
addBreakpoint
'
,
...
...
@@ -65,15 +65,15 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
true
,
()
=>
this
.
debugService
.
addBreakpoints
(
uri
,
[{
lineNumber
}])
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
AddConditionalBreakpointAction
,
debugactions
.
AddConditionalBreakpointAction
.
ID
,
debugactions
.
AddConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
AddConditionalBreakpointAction
,
AddConditionalBreakpointAction
.
ID
,
AddConditionalBreakpointAction
.
LABEL
,
this
.
editor
,
lineNumber
));
}
return
TPromise
.
as
(
actions
);
}
private
registerListeners
():
void
{
this
.
toDispose
.
push
(
this
.
editor
.
onMouseDown
((
e
:
editorbrowser
.
IEditorMouseEvent
)
=>
{
if
(
e
.
target
.
type
!==
editorcommon
.
MouseTargetType
.
GUTTER_GLYPH_MARGIN
||
/* after last line */
e
.
target
.
detail
)
{
this
.
toDispose
.
push
(
this
.
editor
.
onMouseDown
((
e
:
IEditorMouseEvent
)
=>
{
if
(
e
.
target
.
type
!==
MouseTargetType
.
GUTTER_GLYPH_MARGIN
||
/* after last line */
e
.
target
.
detail
)
{
return
;
}
const
canSetBreakpoints
=
this
.
debugService
.
getConfigurationManager
().
canSetBreakpointsIn
(
this
.
editor
.
getModel
());
...
...
@@ -106,9 +106,9 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
}
}));
this
.
toDispose
.
push
(
this
.
editor
.
onMouseMove
((
e
:
editorbrowser
.
IEditorMouseEvent
)
=>
{
this
.
toDispose
.
push
(
this
.
editor
.
onMouseMove
((
e
:
IEditorMouseEvent
)
=>
{
var
showBreakpointHintAtLineNumber
=
-
1
;
if
(
e
.
target
.
type
===
editorcommon
.
MouseTargetType
.
GUTTER_GLYPH_MARGIN
&&
this
.
debugService
.
getConfigurationManager
().
canSetBreakpointsIn
(
this
.
editor
.
getModel
()))
{
if
(
e
.
target
.
type
===
MouseTargetType
.
GUTTER_GLYPH_MARGIN
&&
this
.
debugService
.
getConfigurationManager
().
canSetBreakpointsIn
(
this
.
editor
.
getModel
()))
{
if
(
!
e
.
target
.
detail
)
{
// is not after last line
showBreakpointHintAtLineNumber
=
e
.
target
.
position
.
lineNumber
;
...
...
@@ -116,28 +116,28 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
}
this
.
ensureBreakpointHintDecoration
(
showBreakpointHintAtLineNumber
);
}));
this
.
toDispose
.
push
(
this
.
editor
.
onMouseLeave
((
e
:
editorbrowser
.
IEditorMouseEvent
)
=>
{
this
.
toDispose
.
push
(
this
.
editor
.
onMouseLeave
((
e
:
IEditorMouseEvent
)
=>
{
this
.
ensureBreakpointHintDecoration
(
-
1
);
}));
this
.
toDispose
.
push
(
this
.
debugService
.
onDidChangeState
(()
=>
this
.
onDebugStateUpdate
()));
// hover listeners & hover widget
this
.
toDispose
.
push
(
this
.
editor
.
onMouseDown
((
e
:
editorbrowser
.
IEditorMouseEvent
)
=>
this
.
onEditorMouseDown
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onMouseMove
((
e
:
editorbrowser
.
IEditorMouseEvent
)
=>
this
.
onEditorMouseMove
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onMouseLeave
((
e
:
editorbrowser
.
IEditorMouseEvent
)
=>
{
this
.
toDispose
.
push
(
this
.
editor
.
onMouseDown
((
e
:
IEditorMouseEvent
)
=>
this
.
onEditorMouseDown
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onMouseMove
((
e
:
IEditorMouseEvent
)
=>
this
.
onEditorMouseMove
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onMouseLeave
((
e
:
IEditorMouseEvent
)
=>
{
const
rect
=
this
.
hoverWidget
.
getDomNode
().
getBoundingClientRect
();
// Only hide the hover widget if the editor mouse leave event is outside the hover widget #3528
if
(
e
.
event
.
posx
<
rect
.
left
||
e
.
event
.
posx
>
rect
.
right
||
e
.
event
.
posy
<
rect
.
top
||
e
.
event
.
posy
>
rect
.
bottom
)
{
this
.
hideHoverWidget
();
}
}));
this
.
toDispose
.
push
(
this
.
editor
.
onKeyDown
((
e
:
keyboard
.
IKeyboardEvent
)
=>
this
.
onKeyDown
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onKeyDown
((
e
:
IKeyboardEvent
)
=>
this
.
onKeyDown
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onDidChangeModel
(()
=>
this
.
hideHoverWidget
()));
this
.
toDispose
.
push
(
this
.
editor
.
onDidScrollChange
(()
=>
this
.
hideHoverWidget
));
}
public
getId
():
string
{
return
debug
.
EDITOR_CONTRIBUTION_ID
;
return
EDITOR_CONTRIBUTION_ID
;
}
public
showHover
(
range
:
Range
,
hoveringOver
:
string
,
focus
:
boolean
):
TPromise
<
void
>
{
...
...
@@ -145,7 +145,7 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
}
private
ensureBreakpointHintDecoration
(
showBreakpointHintAtLineNumber
:
number
):
void
{
var
newDecoration
:
editorcommon
.
IModelDeltaDecoration
[]
=
[];
var
newDecoration
:
IModelDeltaDecoration
[]
=
[];
if
(
showBreakpointHintAtLineNumber
!==
-
1
)
{
newDecoration
.
push
({
options
:
DebugEditorContribution
.
BREAKPOINT_HELPER_DECORATION
,
...
...
@@ -163,11 +163,11 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
private
onDebugStateUpdate
():
void
{
const
state
=
this
.
debugService
.
state
;
if
(
state
!==
debug
.
State
.
Stopped
)
{
if
(
state
!==
State
.
Stopped
)
{
this
.
hideHoverWidget
();
}
this
.
codeEditorService
.
listCodeEditors
().
forEach
(
e
=>
{
e
.
updateOptions
({
hover
:
state
!==
debug
.
State
.
Stopped
});
e
.
updateOptions
({
hover
:
state
!==
State
.
Stopped
});
});
}
...
...
@@ -181,27 +181,27 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
// hover business
private
onEditorMouseDown
(
mouseEvent
:
editorbrowser
.
IEditorMouseEvent
):
void
{
if
(
mouseEvent
.
target
.
type
===
editorcommon
.
MouseTargetType
.
CONTENT_WIDGET
&&
mouseEvent
.
target
.
detail
===
DebugHoverWidget
.
ID
)
{
private
onEditorMouseDown
(
mouseEvent
:
IEditorMouseEvent
):
void
{
if
(
mouseEvent
.
target
.
type
===
MouseTargetType
.
CONTENT_WIDGET
&&
mouseEvent
.
target
.
detail
===
DebugHoverWidget
.
ID
)
{
return
;
}
this
.
hideHoverWidget
();
}
private
onEditorMouseMove
(
mouseEvent
:
editorbrowser
.
IEditorMouseEvent
):
void
{
if
(
this
.
debugService
.
state
!==
debug
.
State
.
Stopped
)
{
private
onEditorMouseMove
(
mouseEvent
:
IEditorMouseEvent
):
void
{
if
(
this
.
debugService
.
state
!==
State
.
Stopped
)
{
return
;
}
const
targetType
=
mouseEvent
.
target
.
type
;
const
stopKey
=
env
.
isMacintosh
?
'
metaKey
'
:
'
ctrlKey
'
;
if
(
targetType
===
editorcommon
.
MouseTargetType
.
CONTENT_WIDGET
&&
mouseEvent
.
target
.
detail
===
DebugHoverWidget
.
ID
&&
!
(
<
any
>
mouseEvent
.
event
)[
stopKey
])
{
if
(
targetType
===
MouseTargetType
.
CONTENT_WIDGET
&&
mouseEvent
.
target
.
detail
===
DebugHoverWidget
.
ID
&&
!
(
<
any
>
mouseEvent
.
event
)[
stopKey
])
{
// mouse moved on top of debug hover widget
return
;
}
if
(
targetType
===
editorcommon
.
MouseTargetType
.
CONTENT_TEXT
)
{
if
(
targetType
===
MouseTargetType
.
CONTENT_TEXT
)
{
const
wordAtPosition
=
this
.
editor
.
getModel
().
getWordAtPosition
(
mouseEvent
.
target
.
range
.
getStartPosition
());
if
(
wordAtPosition
&&
this
.
hoveringOver
!==
wordAtPosition
.
word
)
{
this
.
hoverRange
=
mouseEvent
.
target
.
range
;
...
...
@@ -213,7 +213,7 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
}
}
private
onKeyDown
(
e
:
keyboard
.
IKeyboardEvent
):
void
{
private
onKeyDown
(
e
:
IKeyboardEvent
):
void
{
const
stopKey
=
env
.
isMacintosh
?
KeyCode
.
Meta
:
KeyCode
.
Ctrl
;
if
(
e
.
keyCode
!==
stopKey
)
{
// do not hide hover when Ctrl/Meta is pressed
...
...
@@ -223,9 +223,9 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
// end hover business
private
static
BREAKPOINT_HELPER_DECORATION
:
editorcommon
.
IModelDecorationOptions
=
{
private
static
BREAKPOINT_HELPER_DECORATION
:
IModelDecorationOptions
=
{
glyphMarginClassName
:
'
debug-breakpoint-hint-glyph
'
,
stickiness
:
editorcommon
.
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
stickiness
:
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
};
public
dispose
():
void
{
...
...
src/vs/workbench/parts/debug/node/debugAdapter.ts
浏览文件 @
c2c080da
...
...
@@ -3,13 +3,13 @@
* 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
strings
=
require
(
'
vs/base/common/strings
'
)
;
import
objects
=
require
(
'
vs/base/common/objects
'
)
;
import
paths
=
require
(
'
vs/base/common/paths
'
)
;
import
platform
=
require
(
'
vs/base/common/platform
'
)
;
import
debug
=
require
(
'
vs/workbench/parts/debug/common/debug
'
)
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
*
as
debug
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录