Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
003ff303
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,发现更多精彩内容 >>
提交
003ff303
编写于
3月 07, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
strict null check: debug actions
上级
e9f899f5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
36 deletion
+34
-36
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/workbench/contrib/debug/browser/debugActions.ts
src/vs/workbench/contrib/debug/browser/debugActions.ts
+26
-29
src/vs/workbench/contrib/debug/browser/debugStatus.ts
src/vs/workbench/contrib/debug/browser/debugStatus.ts
+2
-2
src/vs/workbench/contrib/debug/common/debug.ts
src/vs/workbench/contrib/debug/common/debug.ts
+5
-5
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
003ff303
...
...
@@ -241,6 +241,7 @@
"./vs/workbench/contrib/debug/browser/exceptionWidget.ts"
,
"./vs/workbench/contrib/debug/browser/linkDetector.ts"
,
"./vs/workbench/contrib/debug/browser/baseDebugView.ts"
,
"./vs/workbench/contrib/debug/browser/debugActions.ts"
,
"./vs/workbench/contrib/debug/browser/statusbarColorProvider.ts"
,
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts"
,
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts"
,
...
...
src/vs/workbench/contrib/debug/browser/debugActions.ts
浏览文件 @
003ff303
...
...
@@ -7,9 +7,7 @@ import * as nls from 'vs/nls';
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
*
as
lifecycle
from
'
vs/base/common/lifecycle
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IDebugService
,
State
,
IDebugSession
,
IThread
,
IEnablement
,
IBreakpoint
,
IStackFrame
,
REPL_ID
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
Variable
,
Expression
,
Thread
,
Breakpoint
}
from
'
vs/workbench/contrib/debug/common/debugModel
'
;
...
...
@@ -113,7 +111,7 @@ export class ConfigureAction extends AbstractDebugAction {
configurationManager
.
selectConfiguration
(
configurationManager
.
getLaunches
()[
0
]);
}
return
configurationManager
.
selectedConfiguration
.
launch
.
openConfigFile
(
sideBySide
,
false
);
return
configurationManager
.
selectedConfiguration
.
launch
!
.
openConfigFile
(
sideBySide
,
false
);
}
}
...
...
@@ -145,7 +143,7 @@ export class StartAction extends AbstractDebugAction {
launch
=
configurationManager
.
getLaunch
(
rootUri
);
if
(
!
launch
||
launch
.
getConfigurationNames
().
length
===
0
)
{
const
launches
=
configurationManager
.
getLaunches
();
launch
=
first
(
launches
,
l
=>
!!
l
.
getConfigurationNames
().
length
,
launch
);
launch
=
first
(
launches
,
l
=>
!!
(
l
&&
l
.
getConfigurationNames
().
length
)
,
launch
);
}
configurationManager
.
selectConfiguration
(
launch
);
...
...
@@ -194,12 +192,9 @@ export class SelectAndStartAction extends AbstractDebugAction {
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
ICommandService
commandService
:
ICommandService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IFileService
fileService
:
IFileService
,
@
IQuickOpenService
private
readonly
quickOpenService
:
IQuickOpenService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
}
public
run
():
Promise
<
any
>
{
...
...
@@ -228,11 +223,13 @@ export class RestartAction extends AbstractDebugAction {
return
new
StartAction
(
StartAction
.
ID
,
StartAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
,
this
.
contextService
,
this
.
historyService
);
}
private
setLabel
(
session
:
IDebugSession
):
void
{
this
.
updateLabel
(
session
&&
session
.
configuration
.
request
===
'
attach
'
?
RestartAction
.
RECONNECT_LABEL
:
RestartAction
.
LABEL
);
private
setLabel
(
session
:
IDebugSession
|
undefined
):
void
{
if
(
session
)
{
this
.
updateLabel
(
session
&&
session
.
configuration
.
request
===
'
attach
'
?
RestartAction
.
RECONNECT_LABEL
:
RestartAction
.
LABEL
);
}
}
public
run
(
session
:
IDebugSession
):
Promise
<
any
>
{
public
run
(
session
:
IDebugSession
|
undefined
):
Promise
<
any
>
{
if
(
!
session
||
!
session
.
getId
)
{
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
}
...
...
@@ -262,7 +259,7 @@ export class StepOverAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action step-over
'
,
debugService
,
keybindingService
,
20
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
@@ -283,7 +280,7 @@ export class StepIntoAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action step-into
'
,
debugService
,
keybindingService
,
30
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
@@ -304,7 +301,7 @@ export class StepOutAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action step-out
'
,
debugService
,
keybindingService
,
40
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
@@ -325,7 +322,7 @@ export class StopAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action stop
'
,
debugService
,
keybindingService
,
80
);
}
public
run
(
session
:
IDebugSession
):
Promise
<
any
>
{
public
run
(
session
:
IDebugSession
|
undefined
):
Promise
<
any
>
{
if
(
!
session
||
!
session
.
getId
)
{
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
}
...
...
@@ -364,7 +361,7 @@ export class ContinueAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action continue
'
,
debugService
,
keybindingService
,
10
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
@@ -385,7 +382,7 @@ export class PauseAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action pause
'
,
debugService
,
keybindingService
,
10
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
if
(
!
thread
)
{
...
...
@@ -408,10 +405,10 @@ export class TerminateThreadAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
terminateThread
'
,
"
Terminate Thread
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
@@ -429,15 +426,15 @@ export class RestartFrameAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
restartFrame
'
,
"
Restart Frame
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
}
public
run
(
frame
:
IStackFrame
):
Promise
<
any
>
{
public
run
(
frame
:
IStackFrame
|
undefined
):
Promise
<
any
>
{
if
(
!
frame
)
{
frame
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
}
return
frame
.
restart
();
return
frame
!
.
restart
();
}
}
...
...
@@ -541,7 +538,7 @@ export class ReapplyBreakpointsAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
reapplyAllBreakpoints
'
,
"
Reapply All Breakpoints
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
null
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
this
.
toDispose
.
push
(
this
.
debugService
.
getModel
().
onDidChangeBreakpoints
(()
=>
this
.
updateEnablement
()));
}
...
...
@@ -581,7 +578,7 @@ export class SetValueAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
setValue
'
,
"
Set Value
"
);
constructor
(
id
:
string
,
label
:
string
,
private
variable
:
Variable
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
null
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
}
public
run
():
Promise
<
any
>
{
...
...
@@ -623,7 +620,7 @@ export class EditWatchExpressionAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
editWatchExpression
'
,
"
Edit Expression
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
}
public
run
(
expression
:
Expression
):
Promise
<
any
>
{
...
...
@@ -656,7 +653,7 @@ export class RemoveWatchExpressionAction extends AbstractDebugAction {
static
LABEL
=
nls
.
localize
(
'
removeWatchExpression
'
,
"
Remove Expression
"
);
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
undefined
,
debugService
,
keybindingService
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
);
}
public
run
(
expression
:
Expression
):
Promise
<
any
>
{
...
...
@@ -740,7 +737,7 @@ export class FocusSessionAction extends AbstractDebugAction {
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
)
{
super
(
id
,
label
,
null
,
debugService
,
keybindingService
,
100
);
super
(
id
,
label
,
''
,
debugService
,
keybindingService
,
100
);
}
public
run
(
sessionName
:
string
):
Promise
<
any
>
{
...
...
@@ -764,7 +761,7 @@ export class StepBackAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action step-back
'
,
debugService
,
keybindingService
,
50
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
@@ -787,7 +784,7 @@ export class ReverseContinueAction extends AbstractDebugAction {
super
(
id
,
label
,
'
debug-action reverse-continue
'
,
debugService
,
keybindingService
,
60
);
}
public
run
(
thread
:
IThread
):
Promise
<
any
>
{
public
run
(
thread
:
IThread
|
undefined
):
Promise
<
any
>
{
if
(
!
(
thread
instanceof
Thread
))
{
thread
=
this
.
debugService
.
getViewModel
().
focusedThread
;
}
...
...
src/vs/workbench/contrib/debug/browser/debugStatus.ts
浏览文件 @
003ff303
...
...
@@ -89,11 +89,11 @@ export class DebugStatus extends Themable implements IStatusbarItem {
private
setLabel
():
void
{
if
(
this
.
label
&&
this
.
statusBarItem
)
{
const
manager
=
this
.
debugService
.
getConfigurationManager
();
const
name
=
manager
.
selectedConfiguration
.
name
;
const
name
=
manager
.
selectedConfiguration
.
name
||
''
;
const
nameAndLaunchPresent
=
name
&&
manager
.
selectedConfiguration
.
launch
;
dom
.
toggleClass
(
this
.
statusBarItem
,
'
hidden
'
,
this
.
showInStatusBar
===
'
never
'
||
!
nameAndLaunchPresent
);
if
(
nameAndLaunchPresent
)
{
this
.
label
.
textContent
=
manager
.
getLaunches
().
length
>
1
?
`
${
name
}
(
${
manager
.
selectedConfiguration
.
launch
.
name
}
)`
:
name
;
this
.
label
.
textContent
=
manager
.
getLaunches
().
length
>
1
?
`
${
name
}
(
${
manager
.
selectedConfiguration
.
launch
!
.
name
}
)`
:
name
;
}
}
}
...
...
src/vs/workbench/contrib/debug/common/debug.ts
浏览文件 @
003ff303
...
...
@@ -585,11 +585,11 @@ export interface IConfigurationManager {
* Returns an object containing the selected launch configuration and the selected configuration name. Both these fields can be null (no folder workspace).
*/
readonly
selectedConfiguration
:
{
launch
:
ILaunch
;
name
:
string
;
launch
:
ILaunch
|
undefined
;
name
:
string
|
undefined
;
};
selectConfiguration
(
launch
:
ILaunch
,
name
?:
string
,
debugStarted
?:
boolean
):
void
;
selectConfiguration
(
launch
:
ILaunch
|
undefined
,
name
?:
string
,
debugStarted
?:
boolean
):
void
;
getLaunches
():
ReadonlyArray
<
ILaunch
>
;
...
...
@@ -710,7 +710,7 @@ export interface IDebugService {
/**
* Sets the focused stack frame and evaluates all expressions against the newly focused stack frame,
*/
focusStackFrame
(
focusedStackFrame
:
IStackFrame
,
thread
?:
IThread
,
session
?:
IDebugSession
,
explicit
?:
boolean
):
void
;
focusStackFrame
(
focusedStackFrame
:
IStackFrame
|
undefined
,
thread
?:
IThread
,
session
?:
IDebugSession
,
explicit
?:
boolean
):
void
;
/**
* Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes.
...
...
@@ -801,7 +801,7 @@ export interface IDebugService {
/**
* Stops the session. If the session does not exist then stops all sessions.
*/
stopSession
(
session
:
IDebugSession
):
Promise
<
any
>
;
stopSession
(
session
:
IDebugSession
|
undefined
):
Promise
<
any
>
;
/**
* Makes unavailable all sources with the passed uri. Source will appear as grayed out in callstack view.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录