Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bf2f9210
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,发现更多精彩内容 >>
提交
bf2f9210
编写于
11月 08, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix problems when starting debug from status line
fixes #37507
上级
ac77bc03
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
12 deletion
+20
-12
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+11
-7
src/vs/workbench/parts/debug/browser/debugQuickOpen.ts
src/vs/workbench/parts/debug/browser/debugQuickOpen.ts
+9
-5
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
bf2f9210
...
...
@@ -132,16 +132,15 @@ export class StartAction extends AbstractDebugAction {
return
false
;
}
// Disabled if the launch drop down shows the launch config that is already running.
protected
isEnabled
(
state
:
State
):
boolean
{
const
processes
=
this
.
debugService
.
getModel
().
getProcesses
();
const
selectedName
=
this
.
debugService
.
getConfigurationManager
().
selectedName
;
const
launch
=
this
.
debugService
.
getConfigurationManager
().
selectedLaunch
;
public
static
isEnabled
(
debugService
:
IDebugService
,
contextService
:
IWorkspaceContextService
)
{
const
processes
=
debugService
.
getModel
().
getProcesses
();
const
selectedName
=
debugService
.
getConfigurationManager
().
selectedName
;
const
launch
=
debugService
.
getConfigurationManager
().
selectedLaunch
;
if
(
state
===
State
.
Initializing
)
{
if
(
debugService
.
state
===
State
.
Initializing
)
{
return
false
;
}
if
(
this
.
contextService
&&
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
&&
processes
.
length
>
0
)
{
if
(
contextService
&&
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
&&
processes
.
length
>
0
)
{
return
false
;
}
if
(
processes
.
some
(
p
=>
p
.
getName
(
false
)
===
selectedName
&&
(
!
launch
||
p
.
session
.
root
.
uri
.
toString
()
===
launch
.
workspace
.
uri
.
toString
())))
{
...
...
@@ -154,6 +153,11 @@ export class StartAction extends AbstractDebugAction {
return
true
;
}
// Disabled if the launch drop down shows the launch config that is already running.
protected
isEnabled
(
state
:
State
):
boolean
{
return
StartAction
.
isEnabled
(
this
.
debugService
,
this
.
contextService
);
}
}
export
class
RunAction
extends
StartAction
{
...
...
src/vs/workbench/parts/debug/browser/debugQuickOpen.ts
浏览文件 @
bf2f9210
...
...
@@ -14,6 +14,9 @@ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
QuickOpenEntry
,
QuickOpenEntryGroup
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
StartAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
Severity
}
from
'
vs/workbench/services/message/browser/messageList
'
;
class
AddConfigEntry
extends
Model
.
QuickOpenEntry
{
...
...
@@ -45,7 +48,7 @@ class AddConfigEntry extends Model.QuickOpenEntry {
class
StartDebugEntry
extends
Model
.
QuickOpenEntry
{
constructor
(
private
debugService
:
IDebugService
,
private
contextService
:
IWorkspaceContextService
,
private
launch
:
ILaunch
,
private
configurationName
:
string
,
highlights
:
Model
.
IHighlight
[]
=
[])
{
constructor
(
private
debugService
:
IDebugService
,
private
contextService
:
IWorkspaceContextService
,
private
messageService
:
IMessageService
,
private
launch
:
ILaunch
,
private
configurationName
:
string
,
highlights
:
Model
.
IHighlight
[]
=
[])
{
super
(
highlights
);
}
...
...
@@ -62,12 +65,12 @@ class StartDebugEntry extends Model.QuickOpenEntry {
}
public
run
(
mode
:
QuickOpen
.
Mode
,
context
:
Model
.
IContext
):
boolean
{
if
(
mode
===
QuickOpen
.
Mode
.
PREVIEW
)
{
if
(
mode
===
QuickOpen
.
Mode
.
PREVIEW
||
!
StartAction
.
isEnabled
(
this
.
debugService
,
this
.
contextService
)
)
{
return
false
;
}
// Run selected debug configuration
this
.
debugService
.
getConfigurationManager
().
selectConfiguration
(
this
.
launch
,
this
.
configurationName
);
this
.
debugService
.
startDebugging
(
this
.
launch
.
workspace
).
done
(
undefined
,
e
rrors
.
onUnexpectedError
);
this
.
debugService
.
startDebugging
(
this
.
launch
.
workspace
).
done
(
undefined
,
e
=>
this
.
messageService
.
show
(
Severity
.
Error
,
e
)
);
return
true
;
}
...
...
@@ -81,7 +84,8 @@ export class DebugQuickOpenHandler extends Quickopen.QuickOpenHandler {
constructor
(
@
IDebugService
private
debugService
:
IDebugService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
ICommandService
private
commandService
:
ICommandService
@
ICommandService
private
commandService
:
ICommandService
,
@
IMessageService
private
messageService
:
IMessageService
)
{
super
();
}
...
...
@@ -102,7 +106,7 @@ export class DebugQuickOpenHandler extends Quickopen.QuickOpenHandler {
if
(
launch
===
configManager
.
selectedLaunch
&&
config
===
configManager
.
selectedName
)
{
this
.
autoFocusIndex
=
configurations
.
length
;
}
configurations
.
push
(
new
StartDebugEntry
(
this
.
debugService
,
this
.
contextService
,
launch
,
config
,
highlights
));
configurations
.
push
(
new
StartDebugEntry
(
this
.
debugService
,
this
.
contextService
,
this
.
messageService
,
launch
,
config
,
highlights
));
});
}
launches
.
forEach
((
l
,
index
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录