Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
98bfa340
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98bfa340
编写于
11月 28, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: configurationWidget in launch.json
上级
51108dd8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
0 deletion
+25
-0
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+25
-0
未找到文件。
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
98bfa340
...
...
@@ -24,8 +24,10 @@ import { DebugHoverWidget } from 'vs/workbench/parts/debug/electron-browser/debu
import
{
RemoveBreakpointAction
,
EditConditionalBreakpointAction
,
ToggleEnablementAction
,
AddConditionalBreakpointAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IDebugEditorContribution
,
IDebugService
,
State
,
IBreakpoint
,
EDITOR_CONTRIBUTION_ID
,
CONTEXT_BREAKPOINT_WIDGET_VISIBLE
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
BreakpointWidget
}
from
'
vs/workbench/parts/debug/browser/breakpointWidget
'
;
import
{
FloatingClickWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
const
HOVER_DELAY
=
300
;
const
LAUNCH_JSON_REGEX
=
/launch
\.
json$/
;
@
editorContribution
export
class
DebugEditorContribution
implements
IDebugEditorContribution
{
...
...
@@ -41,6 +43,8 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private
breakpointWidget
:
BreakpointWidget
;
private
breakpointWidgetVisible
:
IContextKey
<
boolean
>
;
private
configurationWidget
:
FloatingClickWidget
;
constructor
(
private
editor
:
ICodeEditor
,
@
IDebugService
private
debugService
:
IDebugService
,
...
...
@@ -56,6 +60,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this
.
hideHoverScheduler
=
new
RunOnceScheduler
(()
=>
this
.
hoverWidget
.
hide
(),
HOVER_DELAY
);
this
.
registerListeners
();
this
.
breakpointWidgetVisible
=
CONTEXT_BREAKPOINT_WIDGET_VISIBLE
.
bindTo
(
contextKeyService
);
this
.
updateConfigurationWidgetVisibility
();
}
private
getContextMenuActions
(
breakpoint
:
IBreakpoint
,
uri
:
uri
,
lineNumber
:
number
):
TPromise
<
IAction
[]
>
{
...
...
@@ -142,6 +147,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this
.
toDispose
.
push
(
this
.
editor
.
onDidChangeModel
(()
=>
{
this
.
closeBreakpointWidget
();
this
.
hideHoverWidget
();
this
.
updateConfigurationWidgetVisibility
();
}));
this
.
toDispose
.
push
(
this
.
editor
.
onDidScrollChange
(()
=>
this
.
hideHoverWidget
));
}
...
...
@@ -252,6 +258,22 @@ export class DebugEditorContribution implements IDebugEditorContribution {
}
}
// configuration widget
private
updateConfigurationWidgetVisibility
():
void
{
const
model
=
this
.
editor
.
getModel
();
if
(
model
&&
LAUNCH_JSON_REGEX
.
test
(
model
.
uri
.
toString
()))
{
this
.
configurationWidget
=
this
.
instantiationService
.
createInstance
(
FloatingClickWidget
,
this
.
editor
,
nls
.
localize
(
'
addConfiguration
'
,
"
Add Configuration
"
),
null
);
this
.
configurationWidget
.
render
();
this
.
toDispose
.
push
(
this
.
configurationWidget
.
onClick
(()
=>
this
.
addLaunchConfiguration
()));
}
else
if
(
this
.
configurationWidget
)
{
this
.
configurationWidget
.
dispose
();
}
}
private
addLaunchConfiguration
():
void
{
this
.
editor
.
focus
();
}
private
static
BREAKPOINT_HELPER_DECORATION
:
IModelDecorationOptions
=
{
glyphMarginClassName
:
'
debug-breakpoint-hint-glyph
'
,
stickiness
:
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
...
...
@@ -264,6 +286,9 @@ export class DebugEditorContribution implements IDebugEditorContribution {
if
(
this
.
hoverWidget
)
{
this
.
hoverWidget
.
dispose
();
}
if
(
this
.
configurationWidget
)
{
this
.
configurationWidget
.
dispose
();
}
this
.
toDispose
=
lifecycle
.
dispose
(
this
.
toDispose
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录