Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8e293fdf
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,发现更多精彩内容 >>
提交
8e293fdf
编写于
3月 21, 2017
作者:
M
Michel Kaporin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added exception condition message. Moved exceptionInfo query logic to debugEditor.
上级
b3048512
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
23 deletion
+36
-23
src/vs/workbench/parts/debug/browser/exceptionWidget.ts
src/vs/workbench/parts/debug/browser/exceptionWidget.ts
+30
-19
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+5
-3
未找到文件。
src/vs/workbench/parts/debug/browser/exceptionWidget.ts
浏览文件 @
8e293fdf
...
...
@@ -11,14 +11,11 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IDebugService
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
const
$
=
dom
.
$
;
export
class
ExceptionWidget
extends
ZoneWidget
{
private
exceptionInfo
:
TPromise
<
DebugProtocol
.
ExceptionInfoResponse
>
;
constructor
(
editor
:
ICodeEditor
,
private
lineNumber
:
number
,
constructor
(
editor
:
ICodeEditor
,
private
exceptionInfo
:
DebugProtocol
.
ExceptionInfoResponse
,
private
lineNumber
:
number
,
@
IContextViewService
private
contextViewService
:
IContextViewService
,
@
IDebugService
private
debugService
:
IDebugService
)
{
...
...
@@ -42,16 +39,32 @@ export class ExceptionWidget extends ZoneWidget {
let
title
=
$
(
'
.title
'
);
let
msg
=
$
(
'
.message
'
);
this
.
exceptionInfo
=
thread
.
exceptionInfo
;
this
.
exceptionInfo
.
then
((
exceptionInfo
)
=>
{
if
(
exceptionInfo
)
{
title
.
textContent
=
exceptionInfo
.
body
.
description
;
msg
.
textContent
=
exceptionInfo
.
body
.
details
.
stackTrace
;
}
else
{
title
.
textContent
=
nls
.
localize
(
'
exceptionThrown
'
,
'
Exception occurred
'
);
msg
.
textContent
=
thread
.
stoppedDetails
.
text
;
if
(
this
.
exceptionInfo
)
{
let
conditionMessage
;
switch
(
this
.
exceptionInfo
.
body
.
breakMode
)
{
case
'
never
'
:
conditionMessage
=
nls
.
localize
(
'
neverException
'
,
'
User-handled exception has occurred.
'
);
break
;
case
'
always
'
:
conditionMessage
=
nls
.
localize
(
'
alwaysException
'
,
'
Always-breaking exception has occurred.
'
);
break
;
case
'
unhandled
'
:
conditionMessage
=
nls
.
localize
(
'
unhandledException
'
,
'
Unhandled exception has occurred.
'
);
break
;
case
'
userUnhandled
'
:
conditionMessage
=
nls
.
localize
(
'
userUnhandledException
'
,
'
User-unhandled exception has occurred.
'
);
break
;
default
:
conditionMessage
=
''
;
break
;
}
});
title
.
textContent
=
`
${
conditionMessage
}
${
this
.
exceptionInfo
.
body
.
description
}
`
;
msg
.
textContent
=
this
.
exceptionInfo
.
body
.
details
.
stackTrace
;
}
else
{
title
.
textContent
=
nls
.
localize
(
'
exceptionThrown
'
,
'
Exception occurred
'
);
msg
.
textContent
=
thread
.
stoppedDetails
.
text
;
}
dom
.
append
(
container
,
title
);
dom
.
append
(
container
,
msg
);
...
...
@@ -59,12 +72,10 @@ export class ExceptionWidget extends ZoneWidget {
}
protected
_doLayout
(
heightInPixel
:
number
,
widthInPixel
:
number
):
void
{
this
.
exceptionInfo
.
then
(()
=>
{
// Reload the height with respect to the exception text content and relayout it to match the line count.
this
.
container
.
style
.
height
=
'
initial
'
;
// Reload the height with respect to the exception text content and relayout it to match the line count.
this
.
container
.
style
.
height
=
'
initial
'
;
const
computedLinesNumber
=
Math
.
ceil
(
this
.
container
.
offsetHeight
/
this
.
editor
.
getConfiguration
().
fontInfo
.
lineHeight
);
this
.
_relayout
(
computedLinesNumber
);
});
const
computedLinesNumber
=
Math
.
ceil
(
this
.
container
.
offsetHeight
/
this
.
editor
.
getConfiguration
().
fontInfo
.
lineHeight
);
this
.
_relayout
(
computedLinesNumber
);
}
}
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
8e293fdf
...
...
@@ -135,7 +135,7 @@ export interface IThread extends ITreeElement {
stoppedDetails
:
IRawStoppedDetails
;
/**
* Information about the exception if an 'exception' stopped event raised and DA supports the
exceptionInfo
request, otherwise null.
* Information about the exception if an 'exception' stopped event raised and DA supports the
'exceptionInfo'
request, otherwise null.
*/
exceptionInfo
:
TPromise
<
DebugProtocol
.
ExceptionInfoResponse
>
;
...
...
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
8e293fdf
...
...
@@ -361,16 +361,18 @@ export class DebugEditorContribution implements IDebugEditorContribution {
if
(
this
.
exceptionWidget
&&
!
sameUri
)
{
this
.
closeExceptionWidget
();
}
else
if
(
sameUri
&&
focusedSf
.
thread
.
stoppedDetails
&&
focusedSf
.
thread
.
stoppedDetails
.
reason
===
'
exception
'
)
{
this
.
showExceptionWidget
(
exceptionSf
.
lineNumber
,
exceptionSf
.
column
);
focusedSf
.
thread
.
exceptionInfo
.
then
((
exceptionInfo
)
=>
{
this
.
showExceptionWidget
(
null
,
exceptionSf
.
lineNumber
,
exceptionSf
.
column
);
});
}
}
private
showExceptionWidget
(
lineNumber
:
number
,
column
:
number
):
void
{
private
showExceptionWidget
(
exceptionInfo
:
DebugProtocol
.
ExceptionInfoResponse
,
lineNumber
:
number
,
column
:
number
):
void
{
if
(
this
.
exceptionWidget
)
{
this
.
exceptionWidget
.
dispose
();
}
this
.
exceptionWidget
=
this
.
instantiationService
.
createInstance
(
ExceptionWidget
,
this
.
editor
,
lineNumber
);
this
.
exceptionWidget
=
this
.
instantiationService
.
createInstance
(
ExceptionWidget
,
this
.
editor
,
exceptionInfo
,
lineNumber
);
this
.
exceptionWidget
.
show
({
lineNumber
,
column
},
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录