Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
57e6bfcd
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,发现更多精彩内容 >>
提交
57e6bfcd
编写于
12月 01, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: StartDebugActionItem
fixes #16258
上级
9288e575
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
111 addition
and
44 deletion
+111
-44
src/vs/workbench/parts/debug/browser/debugActionItems.ts
src/vs/workbench/parts/debug/browser/debugActionItems.ts
+65
-20
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+0
-14
src/vs/workbench/parts/debug/browser/debugViewlet.ts
src/vs/workbench/parts/debug/browser/debugViewlet.ts
+4
-5
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
+42
-5
未找到文件。
src/vs/workbench/parts/debug/browser/debugActionItems.ts
浏览文件 @
57e6bfcd
...
...
@@ -3,38 +3,87 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
SelectActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
*
as
lifecycle
from
'
vs/base/common/lifecycle
'
;
import
{
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
SelectBox
}
from
'
vs/base/browser/ui/selectBox/selectBox
'
;
import
{
SelectActionItem
,
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
EventEmitter
}
from
'
vs/base/common/eventEmitter
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IDebugService
,
IGlobalConfig
,
NO_CONFIGURATIONS_LABEL
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IDebugService
,
IGlobalConfig
,
NO_CONFIGURATIONS_LABEL
,
State
}
from
'
vs/workbench/parts/debug/common/debug
'
;
export
class
SelectConfigurationActionItem
extends
SelectActionItem
{
const
$
=
dom
.
$
;
export
class
StartDebugActionItem
extends
EventEmitter
implements
IActionItem
{
public
actionRunner
:
IActionRunner
;
private
container
:
HTMLElement
;
private
nameContainer
:
HTMLElement
;
private
selectBox
:
SelectBox
;
private
toDispose
:
lifecycle
.
IDisposable
[];
constructor
(
action
:
IAction
,
private
context
:
any
,
private
action
:
IAction
,
@
IDebugService
private
debugService
:
IDebugService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
)
{
super
(
null
,
action
,
[],
-
1
);
super
();
this
.
toDispose
=
[];
this
.
selectBox
=
new
SelectBox
([],
-
1
);
this
.
registerListeners
();
}
this
.
toDispose
.
push
(
configurationService
.
onDidUpdateConfiguration
(
e
=>
{
this
.
updateOptions
(
true
);
private
registerListeners
():
void
{
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
{
this
.
updateOptions
();
}));
this
.
toDispose
.
push
(
this
.
debugService
.
getViewModel
().
onDidSelectConfigurationName
(
name
=>
{
this
.
updateOptions
(
false
);
this
.
toDispose
.
push
(
this
.
selectBox
.
onDidSelect
(
configurationName
=>
{
this
.
debugService
.
getViewModel
().
setSelectedConfigurationName
(
configurationName
);
this
.
nameContainer
.
textContent
=
configurationName
;
}));
}
public
render
(
container
:
HTMLElement
):
void
{
super
.
render
(
container
);
this
.
updateOptions
(
true
);
this
.
container
=
container
;
dom
.
addClass
(
container
,
'
start-debug-action-item
'
);
const
debugStartContainer
=
dom
.
append
(
container
,
$
(
'
.start-debug
'
));
dom
.
append
(
debugStartContainer
,
$
(
'
.icon
'
));
this
.
nameContainer
=
dom
.
append
(
debugStartContainer
,
$
(
'
.name
'
));
this
.
nameContainer
.
textContent
=
this
.
debugService
.
getViewModel
().
selectedConfigurationName
;
this
.
toDispose
.
push
(
dom
.
addDisposableListener
(
debugStartContainer
,
'
click
'
,
()
=>
{
this
.
actionRunner
.
run
(
this
.
action
,
this
.
context
);
}));
this
.
selectBox
.
render
(
dom
.
append
(
container
,
$
(
'
.configuration
'
)));
this
.
updateOptions
();
}
public
setActionContext
(
context
:
any
):
void
{
this
.
context
=
context
;
}
private
updateOptions
(
changeDebugConfiguration
:
boolean
):
void
{
public
isEnabled
():
boolean
{
return
this
.
debugService
.
state
!==
State
.
Inactive
;
}
public
focus
():
void
{
this
.
container
.
focus
();
}
public
blur
():
void
{
this
.
container
.
blur
();
}
public
dispose
():
void
{
this
.
toDispose
=
lifecycle
.
dispose
(
this
.
toDispose
);
}
private
updateOptions
():
void
{
const
config
=
this
.
configurationService
.
getConfiguration
<
IGlobalConfig
>
(
'
launch
'
);
if
(
!
config
||
!
config
.
configurations
||
config
.
configurations
.
length
===
0
)
{
this
.
setOptions
([
NO_CONFIGURATIONS_LABEL
],
0
);
this
.
se
lectBox
.
se
tOptions
([
NO_CONFIGURATIONS_LABEL
],
0
);
}
else
{
const
options
=
config
.
configurations
.
filter
(
cfg
=>
!!
cfg
.
name
).
map
(
cfg
=>
cfg
.
name
);
if
(
config
.
compounds
)
{
...
...
@@ -42,11 +91,7 @@ export class SelectConfigurationActionItem extends SelectActionItem {
}
const
selected
=
options
.
indexOf
(
this
.
debugService
.
getViewModel
().
selectedConfigurationName
);
this
.
setOptions
(
options
,
selected
);
}
if
(
changeDebugConfiguration
)
{
this
.
actionRunner
.
run
(
this
.
_action
,
this
.
getSelected
()).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
selectBox
.
setOptions
(
options
,
selected
);
}
}
}
...
...
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
57e6bfcd
...
...
@@ -92,20 +92,6 @@ export class ConfigureAction extends AbstractDebugAction {
}
}
export
class
SelectConfigAction
extends
AbstractDebugAction
{
static
ID
=
'
workbench.debug.action.setActiveConfig
'
;
static
LABEL
=
nls
.
localize
(
'
selectConfig
'
,
"
Select Configuration
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action select-active-config
'
,
debugService
,
keybindingService
);
}
public
run
(
configName
:
string
):
TPromise
<
any
>
{
this
.
debugService
.
getViewModel
().
setSelectedConfigurationName
(
configName
===
NO_CONFIGURATIONS_LABEL
?
null
:
configName
);
return
TPromise
.
as
(
null
);
}
}
export
class
StartAction
extends
AbstractDebugAction
{
static
ID
=
'
workbench.action.debug.start
'
;
static
LABEL
=
nls
.
localize
(
'
startDebug
'
,
"
Start Debugging
"
);
...
...
src/vs/workbench/parts/debug/browser/debugViewlet.ts
浏览文件 @
57e6bfcd
...
...
@@ -15,8 +15,8 @@ import { Scope } from 'vs/workbench/common/memento';
import
{
IViewletView
,
Viewlet
}
from
'
vs/workbench/browser/viewlet
'
;
import
{
IDebugService
,
VIEWLET_ID
,
State
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
DebugViewRegistry
}
from
'
vs/workbench/parts/debug/browser/debugViewRegistry
'
;
import
{
StartAction
,
ToggleReplAction
,
ConfigureAction
,
SelectConfigAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
S
electConfiguration
ActionItem
}
from
'
vs/workbench/parts/debug/browser/debugActionItems
'
;
import
{
StartAction
,
ToggleReplAction
,
ConfigureAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
S
tartDebug
ActionItem
}
from
'
vs/workbench/parts/debug/browser/debugActionItems
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IProgressService
,
IProgressRunner
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -122,7 +122,6 @@ export class DebugViewlet extends Viewlet {
if
(
!
this
.
actions
)
{
this
.
actions
=
[
this
.
instantiationService
.
createInstance
(
StartAction
,
StartAction
.
ID
,
StartAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
SelectConfigAction
,
SelectConfigAction
.
ID
,
SelectConfigAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ConfigureAction
,
ConfigureAction
.
ID
,
ConfigureAction
.
LABEL
),
this
.
instantiationService
.
createInstance
(
ToggleReplAction
,
ToggleReplAction
.
ID
,
ToggleReplAction
.
LABEL
)
];
...
...
@@ -136,8 +135,8 @@ export class DebugViewlet extends Viewlet {
}
public
getActionItem
(
action
:
IAction
):
IActionItem
{
if
(
action
.
id
===
S
electConfig
Action
.
ID
)
{
return
this
.
instantiationService
.
createInstance
(
S
electConfigurationActionItem
,
action
);
if
(
action
.
id
===
S
tart
Action
.
ID
)
{
return
this
.
instantiationService
.
createInstance
(
S
tartDebugActionItem
,
null
,
action
);
}
return
null
;
...
...
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
浏览文件 @
57e6bfcd
...
...
@@ -41,12 +41,45 @@
background
:
url('repl-inverse.svg')
center
center
no-repeat
;
}
.monaco-workbench
.debug-action.start
{
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
{
display
:
flex
;
align-items
:
center
;
margin
:
6px
0
;
border
:
1px
solid
#dddddd
;
font-size
:
11px
;
margin-right
:
0.3em
;
height
:
20px
;
}
.vs-dark
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
,
.hc-black
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
{
border-color
:
#383838
;
}
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
{
border-right
:
1px
solid
#dddddd
;
height
:
20px
;
}
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
.name
{
margin-right
:
6px
;
display
:
inline-block
;
}
.vs-dark
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
,
.hc-black
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
{
border-color
:
#383838
;
}
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
.icon
{
width
:
20px
;
height
:
20px
;
background
:
url('continue.svg')
center
center
no-repeat
;
vertical-align
:
bottom
;
}
.vs-dark
.monaco-workbench
.debug-action.start
,
.hc-black
.monaco-workbench
.debug-action.start
{
.vs-dark
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
.icon
,
.hc-black
.monaco-workbench
>
.part
>
.title
>
.title-actions
.start-debug-action-item
.start-debug
.icon
{
background
:
url('continue-inverse.svg')
center
center
no-repeat
;
}
...
...
@@ -56,8 +89,12 @@
line-height
:
22px
;
}
.monaco-workbench
.monaco-action-bar
.action-item.select-container
{
overflow
:
hidden
;
.monaco-workbench
.monaco-action-bar
.start-debug-action-item
.configuration
.select-box
{
width
:
12px
;
background-color
:
inherit
;
border
:
none
;
margin-top
:
0px
;
cursor
:
pointer
;
}
.debug-viewlet
.line-number
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录