Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c80a7601
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c80a7601
编写于
3月 08, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
strict null checks: electronDebugActions and variablesView
上级
fa93b07d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
15 deletion
+16
-15
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+2
-0
src/vs/workbench/contrib/debug/common/debugModel.ts
src/vs/workbench/contrib/debug/common/debugModel.ts
+1
-1
src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts
...ch/contrib/debug/electron-browser/electronDebugActions.ts
+6
-5
src/vs/workbench/contrib/debug/electron-browser/variablesView.ts
...workbench/contrib/debug/electron-browser/variablesView.ts
+7
-9
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
c80a7601
...
@@ -252,7 +252,9 @@
...
@@ -252,7 +252,9 @@
"./vs/workbench/contrib/debug/browser/exceptionWidget.ts"
,
"./vs/workbench/contrib/debug/browser/exceptionWidget.ts"
,
"./vs/workbench/contrib/debug/browser/linkDetector.ts"
,
"./vs/workbench/contrib/debug/browser/linkDetector.ts"
,
"./vs/workbench/contrib/debug/browser/statusbarColorProvider.ts"
,
"./vs/workbench/contrib/debug/browser/statusbarColorProvider.ts"
,
"./vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts"
,
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts"
,
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts"
,
"./vs/workbench/contrib/debug/electron-browser/variablesView.ts"
,
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts"
,
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts"
,
"./vs/workbench/contrib/debug/test/common/debugUtils.test.ts"
,
"./vs/workbench/contrib/debug/test/common/debugUtils.test.ts"
,
"./vs/workbench/contrib/debug/test/common/mockDebug.ts"
,
"./vs/workbench/contrib/debug/test/common/mockDebug.ts"
,
...
...
src/vs/workbench/contrib/debug/common/debugModel.ts
浏览文件 @
c80a7601
...
@@ -247,7 +247,7 @@ export class Expression extends ExpressionContainer implements IExpression {
...
@@ -247,7 +247,7 @@ export class Expression extends ExpressionContainer implements IExpression {
export
class
Variable
extends
ExpressionContainer
implements
IExpression
{
export
class
Variable
extends
ExpressionContainer
implements
IExpression
{
// Used to show the error message coming from the adapter when setting the value #7807
// Used to show the error message coming from the adapter when setting the value #7807
public
errorMessage
:
string
;
public
errorMessage
:
string
|
undefined
;
constructor
(
constructor
(
session
:
IDebugSession
|
undefined
,
session
:
IDebugSession
|
undefined
,
...
...
src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts
浏览文件 @
c80a7601
...
@@ -20,10 +20,11 @@ export class CopyValueAction extends Action {
...
@@ -20,10 +20,11 @@ export class CopyValueAction extends Action {
}
}
public
run
():
Promise
<
any
>
{
public
run
():
Promise
<
any
>
{
if
(
this
.
value
instanceof
Variable
)
{
const
stackFrame
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
const
frameId
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
.
frameId
;
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
return
session
.
evaluate
(
this
.
value
.
evaluateName
,
frameId
,
this
.
context
).
then
(
result
=>
{
if
(
this
.
value
instanceof
Variable
&&
stackFrame
&&
session
&&
this
.
value
.
evaluateName
)
{
return
session
.
evaluate
(
this
.
value
.
evaluateName
,
stackFrame
.
frameId
,
this
.
context
).
then
(
result
=>
{
clipboard
.
writeText
(
result
.
body
.
result
);
clipboard
.
writeText
(
result
.
body
.
result
);
},
err
=>
clipboard
.
writeText
(
this
.
value
.
value
));
},
err
=>
clipboard
.
writeText
(
this
.
value
.
value
));
}
}
...
@@ -43,7 +44,7 @@ export class CopyEvaluatePathAction extends Action {
...
@@ -43,7 +44,7 @@ export class CopyEvaluatePathAction extends Action {
}
}
public
run
():
Promise
<
any
>
{
public
run
():
Promise
<
any
>
{
clipboard
.
writeText
(
this
.
value
.
evaluateName
);
clipboard
.
writeText
(
this
.
value
.
evaluateName
!
);
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
(
undefined
);
}
}
}
}
...
...
src/vs/workbench/contrib/debug/electron-browser/variablesView.ts
浏览文件 @
c80a7601
...
@@ -129,14 +129,15 @@ export class VariablesView extends ViewletPanel {
...
@@ -129,14 +129,15 @@ export class VariablesView extends ViewletPanel {
private
onMouseDblClick
(
e
:
ITreeMouseEvent
<
IExpression
|
IScope
>
):
void
{
private
onMouseDblClick
(
e
:
ITreeMouseEvent
<
IExpression
|
IScope
>
):
void
{
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
const
session
=
this
.
debugService
.
getViewModel
().
focusedSession
;
if
(
e
.
element
instanceof
Variable
&&
session
.
capabilities
.
supportsSetVariable
)
{
if
(
session
&&
e
.
element
instanceof
Variable
&&
session
.
capabilities
.
supportsSetVariable
)
{
this
.
debugService
.
getViewModel
().
setSelectedExpression
(
e
.
element
);
this
.
debugService
.
getViewModel
().
setSelectedExpression
(
e
.
element
);
}
}
}
}
private
onContextMenu
(
e
:
ITreeContextMenuEvent
<
IExpression
|
IScope
>
):
void
{
private
onContextMenu
(
e
:
ITreeContextMenuEvent
<
IExpression
|
IScope
>
):
void
{
const
element
=
e
.
element
;
const
element
=
e
.
element
;
if
(
element
instanceof
Variable
&&
!!
element
.
value
)
{
const
anchor
=
e
.
anchor
;
if
(
element
instanceof
Variable
&&
!!
element
.
value
&&
anchor
)
{
const
actions
:
IAction
[]
=
[];
const
actions
:
IAction
[]
=
[];
const
variable
=
element
as
Variable
;
const
variable
=
element
as
Variable
;
actions
.
push
(
new
SetValueAction
(
SetValueAction
.
ID
,
SetValueAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
SetValueAction
(
SetValueAction
.
ID
,
SetValueAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
...
@@ -146,7 +147,7 @@ export class VariablesView extends ViewletPanel {
...
@@ -146,7 +147,7 @@ export class VariablesView extends ViewletPanel {
actions
.
push
(
new
AddToWatchExpressionsAction
(
AddToWatchExpressionsAction
.
ID
,
AddToWatchExpressionsAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
actions
.
push
(
new
AddToWatchExpressionsAction
(
AddToWatchExpressionsAction
.
ID
,
AddToWatchExpressionsAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
this
.
contextMenuService
.
showContextMenu
({
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
e
.
anchor
,
getAnchor
:
()
=>
anchor
,
getActions
:
()
=>
actions
,
getActions
:
()
=>
actions
,
getActionsContext
:
()
=>
element
getActionsContext
:
()
=>
element
});
});
...
@@ -193,11 +194,8 @@ class VariablesDelegate implements IListVirtualDelegate<IExpression | IScope> {
...
@@ -193,11 +194,8 @@ class VariablesDelegate implements IListVirtualDelegate<IExpression | IScope> {
if
(
element
instanceof
Scope
)
{
if
(
element
instanceof
Scope
)
{
return
ScopesRenderer
.
ID
;
return
ScopesRenderer
.
ID
;
}
}
if
(
element
instanceof
Variable
)
{
return
VariablesRenderer
.
ID
;
}
return
null
;
return
VariablesRenderer
.
ID
;
}
}
}
}
...
@@ -246,7 +244,7 @@ export class VariablesRenderer extends AbstractExpressionsRenderer {
...
@@ -246,7 +244,7 @@ export class VariablesRenderer extends AbstractExpressionsRenderer {
validation
:
()
=>
variable
.
errorMessage
?
({
content
:
variable
.
errorMessage
})
:
null
validation
:
()
=>
variable
.
errorMessage
?
({
content
:
variable
.
errorMessage
})
:
null
},
},
onFinish
:
(
value
:
string
,
success
:
boolean
)
=>
{
onFinish
:
(
value
:
string
,
success
:
boolean
)
=>
{
variable
.
errorMessage
=
null
;
variable
.
errorMessage
=
undefined
;
if
(
success
&&
variable
.
value
!==
value
)
{
if
(
success
&&
variable
.
value
!==
value
)
{
variable
.
setVariable
(
value
)
variable
.
setVariable
(
value
)
// Need to force watch expressions and variables to update since a variable change can have an effect on both
// Need to force watch expressions and variables to update since a variable change can have an effect on both
...
@@ -258,7 +256,7 @@ export class VariablesRenderer extends AbstractExpressionsRenderer {
...
@@ -258,7 +256,7 @@ export class VariablesRenderer extends AbstractExpressionsRenderer {
}
}
class
VariablesAccessibilityProvider
implements
IAccessibilityProvider
<
IExpression
|
IScope
>
{
class
VariablesAccessibilityProvider
implements
IAccessibilityProvider
<
IExpression
|
IScope
>
{
getAriaLabel
(
element
:
IExpression
|
IScope
):
string
{
getAriaLabel
(
element
:
IExpression
|
IScope
):
string
|
null
{
if
(
element
instanceof
Scope
)
{
if
(
element
instanceof
Scope
)
{
return
nls
.
localize
(
'
variableScopeAriaLabel
'
,
"
Scope {0}, variables, debug
"
,
element
.
name
);
return
nls
.
localize
(
'
variableScopeAriaLabel
'
,
"
Scope {0}, variables, debug
"
,
element
.
name
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录