Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bd9dfef5
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,发现更多精彩内容 >>
提交
bd9dfef5
编写于
7月 22, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug debt: debug select action item extends SelectActionItem
上级
ebc11fe9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
98 deletion
+27
-98
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+8
-0
src/vs/workbench/parts/debug/browser/debugActionItems.ts
src/vs/workbench/parts/debug/browser/debugActionItems.ts
+18
-79
src/vs/workbench/parts/debug/browser/debugViewlet.ts
src/vs/workbench/parts/debug/browser/debugViewlet.ts
+1
-1
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
+0
-18
未找到文件。
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
bd9dfef5
...
...
@@ -695,7 +695,11 @@ export class SelectActionItem extends BaseActionItem {
public
setOptions
(
options
:
string
[],
selected
:
number
):
void
{
this
.
options
=
options
;
if
(
selected
>=
0
)
{
this
.
selected
=
selected
;
}
else
if
(
this
.
selected
<
0
||
this
.
selected
>
this
.
options
.
length
)
{
this
.
selected
=
0
;
}
this
.
doSetOptions
();
}
...
...
@@ -728,6 +732,10 @@ export class SelectActionItem extends BaseActionItem {
this
.
doSetOptions
();
}
protected
getSelected
():
string
{
return
this
.
options
&&
this
.
selected
>=
0
&&
this
.
selected
<
this
.
options
.
length
?
this
.
options
[
this
.
selected
]
:
null
;
}
private
doSetOptions
():
void
{
this
.
select
.
options
.
length
=
0
;
...
...
src/vs/workbench/parts/debug/browser/debugActionItems.ts
浏览文件 @
bd9dfef5
...
...
@@ -4,115 +4,54 @@
*--------------------------------------------------------------------------------------------*/
import
nls
=
require
(
'
vs/nls
'
);
import
lifecycle
=
require
(
'
vs/base/common/lifecycle
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
dom
=
require
(
'
vs/base/browser/dom
'
);
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Base
ActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDebugService
,
State
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Select
ActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IDebugService
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
export
class
SelectConfigActionItem
extends
BaseActionItem
{
private
select
:
HTMLSelectElement
;
private
toDispose
:
lifecycle
.
IDisposable
[];
export
class
DebugSelectActionItem
extends
SelectActionItem
{
constructor
(
action
:
IAction
,
@
IDebugService
private
debugService
:
IDebugService
,
@
IConfigurationService
configurationService
:
IConfigurationService
)
{
super
(
null
,
action
);
this
.
select
=
document
.
createElement
(
'
select
'
);
this
.
select
.
className
=
'
debug-select action-bar-select
'
;
super
(
null
,
action
,
[],
-
1
);
this
.
toDispose
=
[];
this
.
registerListeners
(
configurationService
);
this
.
registerConfigurationListeners
(
configurationService
);
}
private
registerListeners
(
configurationService
:
IConfigurationService
):
void
{
this
.
toDispose
.
push
(
dom
.
addStandardDisposableListener
(
this
.
select
,
'
change
'
,
(
e
)
=>
{
this
.
actionRunner
.
run
(
this
.
_action
,
e
.
target
.
value
).
done
(
null
,
errors
.
onUnexpectedError
);
}));
this
.
toDispose
.
push
(
this
.
debugService
.
onDidChangeState
(
state
=>
{
this
.
select
.
disabled
=
state
!==
State
.
Inactive
;
}));
private
registerConfigurationListeners
(
configurationService
:
IConfigurationService
):
void
{
this
.
toDispose
.
push
(
configurationService
.
onDidUpdateConfiguration
(
e
=>
{
this
.
set
Options
(
true
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
update
Options
(
true
).
done
(
null
,
errors
.
onUnexpectedError
);
}));
this
.
toDispose
.
push
(
this
.
debugService
.
getConfigurationManager
().
onDidConfigurationChange
(
name
=>
{
this
.
set
Options
(
false
).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
update
Options
(
false
).
done
(
null
,
errors
.
onUnexpectedError
);
}));
}
public
render
(
container
:
HTMLElement
):
void
{
dom
.
addClass
(
container
,
'
select-container
'
);
container
.
appendChild
(
this
.
select
);
this
.
setOptions
(
true
).
done
(
null
,
errors
.
onUnexpectedError
);
super
.
render
(
container
);
this
.
updateOptions
(
true
).
done
(
null
,
errors
.
onUnexpectedError
);
}
public
focus
():
void
{
if
(
this
.
select
)
{
this
.
select
.
focus
();
}
}
public
blur
():
void
{
if
(
this
.
select
)
{
this
.
select
.
blur
();
}
}
private
setOptions
(
changeDebugConfiguration
:
boolean
):
TPromise
<
any
>
{
let
previousSelectedIndex
=
this
.
select
.
selectedIndex
;
this
.
select
.
options
.
length
=
0
;
private
updateOptions
(
changeDebugConfiguration
:
boolean
):
TPromise
<
any
>
{
return
this
.
debugService
.
getConfigurationManager
().
loadLaunchConfig
().
then
(
config
=>
{
if
(
!
config
||
!
config
.
configurations
)
{
this
.
select
.
add
(
this
.
createOption
(
nls
.
localize
(
'
noConfigurations
'
,
"
No Configurations
"
)));
this
.
select
.
disabled
=
true
;
this
.
setOptions
([
nls
.
localize
(
'
noConfigurations
'
,
"
No Configurations
"
)],
0
);
return
changeDebugConfiguration
?
this
.
actionRunner
.
run
(
this
.
_action
,
null
)
:
null
;
}
const
configurations
=
config
.
configurations
;
this
.
select
.
disabled
=
configurations
.
length
<
1
;
let
found
=
false
;
const
configurationNames
=
config
.
configurations
.
map
(
cfg
=>
cfg
.
name
);
const
configurationName
=
this
.
debugService
.
getConfigurationManager
().
configurationName
;
for
(
let
i
=
0
;
i
<
configurations
.
length
;
i
++
)
{
this
.
select
.
add
(
this
.
createOption
(
configurations
[
i
].
name
));
if
(
configurationName
===
configurations
[
i
].
name
)
{
this
.
select
.
selectedIndex
=
i
;
found
=
true
;
}
}
let
selected
=
configurationNames
.
indexOf
(
configurationName
);
if
(
!
found
&&
configurations
.
length
>
0
)
{
if
(
!
previousSelectedIndex
||
previousSelectedIndex
<
0
||
previousSelectedIndex
>=
configurations
.
length
)
{
previousSelectedIndex
=
0
;
}
this
.
select
.
selectedIndex
=
previousSelectedIndex
;
if
(
changeDebugConfiguration
)
{
return
this
.
actionRunner
.
run
(
this
.
_action
,
configurations
[
previousSelectedIndex
].
name
);
}
this
.
setOptions
(
configurationNames
,
selected
);
if
(
changeDebugConfiguration
)
{
return
this
.
actionRunner
.
run
(
this
.
_action
,
this
.
getSelected
());
}
});
}
private
createOption
(
value
:
string
):
HTMLOptionElement
{
const
option
=
document
.
createElement
(
'
option
'
);
option
.
value
=
value
;
option
.
text
=
value
;
return
option
;
}
public
dispose
():
void
{
this
.
debugService
=
null
;
this
.
toDispose
=
lifecycle
.
dispose
(
this
.
toDispose
);
super
.
dispose
();
}
}
\ No newline at end of file
}
src/vs/workbench/parts/debug/browser/debugViewlet.ts
浏览文件 @
bd9dfef5
...
...
@@ -140,7 +140,7 @@ export class DebugViewlet extends Viewlet {
public
getActionItem
(
action
:
actions
.
IAction
):
actionbar
.
IActionItem
{
if
(
action
.
id
===
debugactions
.
SelectConfigAction
.
ID
)
{
return
this
.
instantiationService
.
createInstance
(
dbgactionitems
.
SelectConfig
ActionItem
,
action
);
return
this
.
instantiationService
.
createInstance
(
dbgactionitems
.
DebugSelect
ActionItem
,
action
);
}
return
null
;
...
...
src/vs/workbench/parts/debug/browser/media/debugViewlet.css
浏览文件 @
bd9dfef5
...
...
@@ -86,16 +86,6 @@
opacity
:
0.35
;
}
.monaco-workbench.windows
.debug-select
{
margin-top
:
7px
;
/* Center the select box */
}
.vs-dark
.monaco-workbench
.debug-select
{
background-color
:
#3C3C3C
;
border-color
:
#3C3C3C
;
color
:
rgb
(
204
,
204
,
204
);
}
/* Call stack */
.debug-viewlet
.debug-call-stack-title
{
...
...
@@ -326,11 +316,3 @@
.debug-viewlet
>
.noworkspace-view
>
p
{
line-height
:
1.5em
;
}
/* High Contrast Theming */
.hc-black
.monaco-workbench
.debug-select
{
background-color
:
#3C3C3C
;
border-color
:
#3C3C3C
;
color
:
rgb
(
204
,
204
,
204
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录