Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cda7b564
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,发现更多精彩内容 >>
提交
cda7b564
编写于
11月 25, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #111191
上级
182fe687
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
16 deletion
+16
-16
src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts
src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts
+6
-6
src/vs/workbench/contrib/debug/browser/replViewer.ts
src/vs/workbench/contrib/debug/browser/replViewer.ts
+6
-6
src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts
...rib/debug/test/electron-browser/debugANSIHandling.test.ts
+4
-4
未找到文件。
src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts
浏览文件 @
cda7b564
...
...
@@ -7,13 +7,13 @@ import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
import
{
RGBA
,
Color
}
from
'
vs/base/common/color
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ansiColorIdentifiers
}
from
'
vs/workbench/contrib/terminal/common/terminalColorRegistry
'
;
import
{
I
DebugSession
}
from
'
vs/workbench/contrib/debug/common/debug
'
;
import
{
I
WorkspaceFolder
}
from
'
vs/platform/workspace/common/workspace
'
;
/**
* @param text The content to stylize.
* @returns An {@link HTMLSpanElement} that contains the potentially stylized text.
*/
export
function
handleANSIOutput
(
text
:
string
,
linkDetector
:
LinkDetector
,
themeService
:
IThemeService
,
debugSession
:
IDebugSession
):
HTMLSpanElement
{
export
function
handleANSIOutput
(
text
:
string
,
linkDetector
:
LinkDetector
,
themeService
:
IThemeService
,
workspaceFolder
:
IWorkspaceFolder
|
undefined
):
HTMLSpanElement
{
const
root
:
HTMLSpanElement
=
document
.
createElement
(
'
span
'
);
const
textLength
:
number
=
text
.
length
;
...
...
@@ -54,7 +54,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
if
(
sequenceFound
)
{
// Flush buffer with previous styles.
appendStylizedStringToContainer
(
root
,
buffer
,
styleNames
,
linkDetector
,
debugSession
,
customFgColor
,
customBgColor
);
appendStylizedStringToContainer
(
root
,
buffer
,
styleNames
,
linkDetector
,
workspaceFolder
,
customFgColor
,
customBgColor
);
buffer
=
''
;
...
...
@@ -100,7 +100,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
// Flush remaining text buffer if not empty.
if
(
buffer
)
{
appendStylizedStringToContainer
(
root
,
buffer
,
styleNames
,
linkDetector
,
debugSession
,
customFgColor
,
customBgColor
);
appendStylizedStringToContainer
(
root
,
buffer
,
styleNames
,
linkDetector
,
workspaceFolder
,
customFgColor
,
customBgColor
);
}
return
root
;
...
...
@@ -268,7 +268,7 @@ export function appendStylizedStringToContainer(
stringContent
:
string
,
cssClasses
:
string
[],
linkDetector
:
LinkDetector
,
debugSession
:
IDebugSession
,
workspaceFolder
:
IWorkspaceFolder
|
undefined
,
customTextColor
?:
RGBA
,
customBackgroundColor
?:
RGBA
):
void
{
...
...
@@ -276,7 +276,7 @@ export function appendStylizedStringToContainer(
return
;
}
const
container
=
linkDetector
.
linkify
(
stringContent
,
true
,
debugSession
.
root
);
const
container
=
linkDetector
.
linkify
(
stringContent
,
true
,
workspaceFolder
);
container
.
className
=
cssClasses
.
join
(
'
'
);
if
(
customTextColor
)
{
...
...
src/vs/workbench/contrib/debug/browser/replViewer.ts
浏览文件 @
cda7b564
...
...
@@ -107,7 +107,7 @@ export class ReplGroupRenderer implements ITreeRenderer<ReplGroup, FuzzyScore, I
}
}
export
class
ReplEvaluationResultsRenderer
implements
ITreeRenderer
<
ReplEvaluationResult
,
FuzzyScore
,
IReplEvaluationResultTemplateData
>
{
export
class
ReplEvaluationResultsRenderer
implements
ITreeRenderer
<
ReplEvaluationResult
|
Variable
,
FuzzyScore
,
IReplEvaluationResultTemplateData
>
{
static
readonly
ID
=
'
replEvaluationResult
'
;
get
templateId
():
string
{
...
...
@@ -123,7 +123,7 @@ export class ReplEvaluationResultsRenderer implements ITreeRenderer<ReplEvaluati
return
{
value
};
}
renderElement
(
element
:
ITreeNode
<
ReplEvaluationResult
,
FuzzyScore
>
,
index
:
number
,
templateData
:
IReplEvaluationResultTemplateData
):
void
{
renderElement
(
element
:
ITreeNode
<
ReplEvaluationResult
|
Variable
,
FuzzyScore
>
,
index
:
number
,
templateData
:
IReplEvaluationResultTemplateData
):
void
{
const
expression
=
element
.
element
;
renderExpressionValue
(
expression
,
templateData
.
value
,
{
showHover
:
false
,
...
...
@@ -187,7 +187,7 @@ export class ReplSimpleElementsRenderer implements ITreeRenderer<SimpleReplEleme
dom
.
clearNode
(
templateData
.
value
);
// Reset classes to clear ansi decorations since templates are reused
templateData
.
value
.
className
=
'
value
'
;
const
result
=
handleANSIOutput
(
element
.
value
,
this
.
linkDetector
,
this
.
themeService
,
element
.
session
);
const
result
=
handleANSIOutput
(
element
.
value
,
this
.
linkDetector
,
this
.
themeService
,
element
.
session
.
root
);
templateData
.
value
.
appendChild
(
result
);
templateData
.
value
.
classList
.
add
((
element
.
severity
===
severity
.
Warning
)
?
'
warn
'
:
(
element
.
severity
===
severity
.
Error
)
?
'
error
'
:
(
element
.
severity
===
severity
.
Ignore
)
?
'
ignore
'
:
'
info
'
);
...
...
@@ -320,14 +320,14 @@ export class ReplDelegate extends CachedListVirtualDelegate<IReplElement> {
if
(
element
instanceof
Variable
&&
element
.
name
)
{
return
ReplVariablesRenderer
.
ID
;
}
if
(
element
instanceof
ReplEvaluationResult
)
{
if
(
element
instanceof
ReplEvaluationResult
||
(
element
instanceof
Variable
&&
!
element
.
name
))
{
// Variable with no name is a top level variable which should be rendered like a repl element #17404
return
ReplEvaluationResultsRenderer
.
ID
;
}
if
(
element
instanceof
ReplEvaluationInput
)
{
return
ReplEvaluationInputsRenderer
.
ID
;
}
if
(
element
instanceof
SimpleReplElement
||
(
element
instanceof
Variable
&&
!
element
.
name
))
{
// Variable with no name is a top level variable which should be rendered like a repl element #17404
if
(
element
instanceof
SimpleReplElement
)
{
return
ReplSimpleElementsRenderer
.
ID
;
}
if
(
element
instanceof
ReplGroup
)
{
...
...
src/vs/workbench/contrib/debug/test/electron-browser/debugANSIHandling.test.ts
浏览文件 @
cda7b564
...
...
@@ -49,8 +49,8 @@ suite('Debug - ANSI Handling', () => {
assert
.
equal
(
0
,
root
.
children
.
length
);
appendStylizedStringToContainer
(
root
,
'
content1
'
,
[
'
class1
'
,
'
class2
'
],
linkDetector
,
session
);
appendStylizedStringToContainer
(
root
,
'
content2
'
,
[
'
class2
'
,
'
class3
'
],
linkDetector
,
session
);
appendStylizedStringToContainer
(
root
,
'
content1
'
,
[
'
class1
'
,
'
class2
'
],
linkDetector
,
session
.
root
);
appendStylizedStringToContainer
(
root
,
'
content2
'
,
[
'
class2
'
,
'
class3
'
],
linkDetector
,
session
.
root
);
assert
.
equal
(
2
,
root
.
children
.
length
);
...
...
@@ -80,7 +80,7 @@ suite('Debug - ANSI Handling', () => {
* @returns An {@link HTMLSpanElement} that contains the stylized text.
*/
function
getSequenceOutput
(
sequence
:
string
):
HTMLSpanElement
{
const
root
:
HTMLSpanElement
=
handleANSIOutput
(
sequence
,
linkDetector
,
themeService
,
session
);
const
root
:
HTMLSpanElement
=
handleANSIOutput
(
sequence
,
linkDetector
,
themeService
,
session
.
root
);
assert
.
equal
(
1
,
root
.
children
.
length
);
const
child
:
Node
=
root
.
lastChild
!
;
if
(
child
instanceof
HTMLSpanElement
)
{
...
...
@@ -320,7 +320,7 @@ suite('Debug - ANSI Handling', () => {
if
(
elementsExpected
===
undefined
)
{
elementsExpected
=
assertions
.
length
;
}
const
root
:
HTMLSpanElement
=
handleANSIOutput
(
sequence
,
linkDetector
,
themeService
,
session
);
const
root
:
HTMLSpanElement
=
handleANSIOutput
(
sequence
,
linkDetector
,
themeService
,
session
.
root
);
assert
.
equal
(
elementsExpected
,
root
.
children
.
length
);
for
(
let
i
=
0
;
i
<
elementsExpected
;
i
++
)
{
const
child
:
Node
=
root
.
children
[
i
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录