Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
128e9b50
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,发现更多精彩内容 >>
提交
128e9b50
编写于
3月 04, 2021
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add frameId to InlineValueContext
上级
cb7ad05c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
23 addition
and
17 deletion
+23
-17
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+2
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+8
-6
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-0
src/vs/workbench/api/common/extHostTypeConverters.ts
src/vs/workbench/api/common/extHostTypeConverters.ts
+2
-1
src/vs/workbench/api/common/extHostTypes.ts
src/vs/workbench/api/common/extHostTypes.ts
+3
-1
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
...orkbench/contrib/debug/browser/debugEditorContribution.ts
+7
-7
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
128e9b50
...
...
@@ -297,11 +297,11 @@ export interface EvaluatableExpressionProvider {
}
/**
* An open ended information bag passed to the inline value provider.
* A minimal context containes just the document location where the debugger has stopped.
* A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.
* @internal
*/
export
interface
InlineValueContext
{
frameId
:
number
;
stoppedLocation
:
Range
;
}
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
128e9b50
...
...
@@ -695,18 +695,20 @@ declare module 'vscode' {
}
/**
* A value-object that contains additional information when requesting inline values from a InlineValuesProvider.
* A minimal context containes just the document location where the debugger has stopped.
* Additional optional information might be scope information or variables and their values.
* A value-object that contains contextual information when requesting inline values from a InlineValuesProvider.
*/
export
interface
InlineValueContext
{
/**
* Debug Adapter Protocol ID of the the stack frame.
*/
readonly
frameId
:
number
;
/**
* The document range where execution has stopped.
* Typically the end position of the range denotes the line where the inline values are shown.
*/
stoppedLocation
:
Range
;
// ... more to come, e.g. Scope information or variable/value candidate information
readonly
stoppedLocation
:
Range
;
}
/**
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
128e9b50
...
...
@@ -1474,6 +1474,7 @@ export interface ILinkedEditingRangesDto {
}
export
interface
IInlineValueContextDto
{
frameId
:
number
;
stoppedLocation
:
IRange
;
}
...
...
src/vs/workbench/api/common/extHostTypeConverters.ts
浏览文件 @
128e9b50
...
...
@@ -901,12 +901,13 @@ export namespace InlineValue {
export
namespace
InlineValueContext
{
export
function
from
(
inlineValueContext
:
vscode
.
InlineValueContext
):
extHostProtocol
.
IInlineValueContextDto
{
return
<
extHostProtocol
.
IInlineValueContextDto
>
{
frameId
:
inlineValueContext
.
frameId
,
stoppedLocation
:
Range
.
from
(
inlineValueContext
.
stoppedLocation
)
};
}
export
function
to
(
inlineValueContext
:
extHostProtocol
.
IInlineValueContextDto
):
types
.
InlineValueContext
{
return
new
types
.
InlineValueContext
(
Range
.
to
(
inlineValueContext
.
stoppedLocation
));
return
new
types
.
InlineValueContext
(
inlineValueContext
.
frameId
,
Range
.
to
(
inlineValueContext
.
stoppedLocation
));
}
}
...
...
src/vs/workbench/api/common/extHostTypes.ts
浏览文件 @
128e9b50
...
...
@@ -2476,9 +2476,11 @@ export class InlineValueEvaluatableExpression implements vscode.InlineValueEvalu
@
es5ClassCompat
export
class
InlineValueContext
implements
vscode
.
InlineValueContext
{
readonly
frameId
:
number
;
readonly
stoppedLocation
:
vscode
.
Range
;
constructor
(
range
:
vscode
.
Range
)
{
constructor
(
frameId
:
number
,
range
:
vscode
.
Range
)
{
this
.
frameId
=
frameId
;
this
.
stoppedLocation
=
range
;
}
}
...
...
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
浏览文件 @
128e9b50
...
...
@@ -12,7 +12,7 @@ import { setProperty } from 'vs/base/common/jsonEdit';
import
{
Constants
}
from
'
vs/base/common/uint
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
IKeyboardEvent
,
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
InlineValuesProviderRegistry
,
StandardTokenType
}
from
'
vs/editor/common/modes
'
;
import
{
InlineValue
Context
,
InlineValue
sProviderRegistry
,
StandardTokenType
}
from
'
vs/editor/common/modes
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
flatten
}
from
'
vs/base/common/arrays
'
;
import
{
onUnexpectedExternalError
}
from
'
vs/base/common/errors
'
;
...
...
@@ -603,15 +603,16 @@ export class DebugEditorContribution implements IDebugEditorContribution {
return
undefined
;
};
const
ranges
=
this
.
editor
.
getVisibleRangesPlusViewportAboveBelow
();
const
ctx
=
{
stoppedLocation
:
new
Range
(
stackFrame
.
range
.
startLineNumber
,
stackFrame
.
range
.
startColumn
+
1
,
stackFrame
.
range
.
endLineNumber
,
stackFrame
.
range
.
endColumn
+
1
)
};
const
ctx
:
InlineValueContext
=
{
frameId
:
stackFrame
.
frameId
,
stoppedLocation
:
new
Range
(
stackFrame
.
range
.
startLineNumber
,
stackFrame
.
range
.
startColumn
+
1
,
stackFrame
.
range
.
endLineNumber
,
stackFrame
.
range
.
endColumn
+
1
)
};
const
token
=
new
CancellationTokenSource
().
token
;
const
ranges
=
this
.
editor
.
getVisibleRangesPlusViewportAboveBelow
();
const
providers
=
InlineValuesProviderRegistry
.
ordered
(
model
).
reverse
();
allDecorations
=
[];
const
lineDecorations
=
new
Map
<
number
,
InlineSegment
[]
>
();
const
promises
=
flatten
(
providers
.
map
(
provider
=>
ranges
.
map
(
range
=>
Promise
.
resolve
(
provider
.
provideInlineValues
(
model
,
range
,
ctx
,
token
)).
then
(
async
(
result
)
=>
{
...
...
@@ -641,9 +642,8 @@ export class DebugEditorContribution implements IDebugEditorContribution {
expr
=
lineContent
.
substring
(
iv
.
range
.
startColumn
-
1
,
iv
.
range
.
endColumn
-
1
);
}
if
(
expr
)
{
const
viewModel
=
this
.
debugService
.
getViewModel
();
const
expression
=
new
Expression
(
expr
);
await
expression
.
evaluate
(
viewModel
.
focusedSession
,
viewModel
.
focusedS
tackFrame
,
'
watch
'
);
await
expression
.
evaluate
(
stackFrame
.
thread
.
session
,
s
tackFrame
,
'
watch
'
);
if
(
expression
.
available
)
{
text
=
strings
.
format
(
var_value_format
,
expr
,
expression
.
value
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录