Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
d4743d78
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d4743d78
编写于
4月 18, 2018
作者:
I
Ivan Basov
提交者:
GitHub
4月 18, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix for ValidateBreakpointLocationWorker NFW
上级
8db96423
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
25 deletion
+57
-25
src/EditorFeatures/Test/Extensions/ITextSnapshotExtensionsTests.cs
...rFeatures/Test/Extensions/ITextSnapshotExtensionsTests.cs
+9
-2
src/EditorFeatures/Text/Shared/Extensions/ITextSnapshotExtensions.cs
...eatures/Text/Shared/Extensions/ITextSnapshotExtensions.cs
+12
-2
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
...eService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
+36
-21
未找到文件。
src/EditorFeatures/Test/Extensions/ITextSnapshotExtensionsTests.cs
浏览文件 @
d4743d78
...
...
@@ -159,10 +159,17 @@ public void TryGetPositionTest()
}
[
Fact
]
public
void
GetPoint
Test
()
public
void
TryGetPointValue
Test
()
{
var
snapshot
=
GetSampleCodeSnapshot
();
Assert
.
Equal
(
new
SnapshotPoint
(
snapshot
,
15
),
snapshot
.
GetPoint
(
3
,
0
));
Assert
.
Equal
(
new
SnapshotPoint
(
snapshot
,
15
),
snapshot
.
TryGetPoint
(
3
,
0
).
Value
);
}
[
Fact
]
public
void
TryGetPointNullTest
()
{
var
snapshot
=
GetSampleCodeSnapshot
();
Assert
.
Null
(
snapshot
.
TryGetPoint
(
3000
,
0
));
}
[
Fact
]
...
...
src/EditorFeatures/Text/Shared/Extensions/ITextSnapshotExtensions.cs
浏览文件 @
d4743d78
...
...
@@ -11,8 +11,18 @@ internal static partial class ITextSnapshotExtensions
public
static
SnapshotPoint
GetPoint
(
this
ITextSnapshot
snapshot
,
int
position
)
=>
new
SnapshotPoint
(
snapshot
,
position
);
public
static
SnapshotPoint
GetPoint
(
this
ITextSnapshot
snapshot
,
int
lineNumber
,
int
columnIndex
)
=>
new
SnapshotPoint
(
snapshot
,
snapshot
.
GetPosition
(
lineNumber
,
columnIndex
));
public
static
SnapshotPoint
?
TryGetPoint
(
this
ITextSnapshot
snapshot
,
int
lineNumber
,
int
columnIndex
)
{
var
position
=
snapshot
.
TryGetPosition
(
lineNumber
,
columnIndex
);
if
(
position
.
HasValue
)
{
return
new
SnapshotPoint
(
snapshot
,
position
.
Value
);
}
else
{
return
null
;
}
}
/// <summary>
/// Convert a <see cref="LinePositionSpan"/> to <see cref="TextSpan"/>.
...
...
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
浏览文件 @
d4743d78
...
...
@@ -92,21 +92,25 @@ public int GetNameOfLocation(IVsTextBuffer pBuffer, int iLine, int iCol, out str
var
textBuffer
=
_languageService
.
EditorAdaptersFactoryService
.
GetDataBuffer
(
pBuffer
);
if
(
textBuffer
!=
null
)
{
var
point
=
textBuffer
.
CurrentSnapshot
.
GetPoint
(
iLine
,
iCol
);
var
document
=
point
.
Snapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
if
(
document
!=
null
)
var
nullablePoint
=
textBuffer
.
CurrentSnapshot
.
TryGetPoint
(
iLine
,
iCol
);
if
(
nullablePoint
.
HasValue
)
{
// NOTE(cyrusn): We have to wait here because the debuggers'
// GetNameOfLocation is a blocking call. In the future, it
// would be nice if they could make it async.
var
debugLocationInfo
=
_languageDebugInfo
.
GetLocationInfoAsync
(
document
,
point
,
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
var
point
=
nullablePoint
.
Value
;
var
document
=
point
.
Snapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
if
(
!
debugLocationInfo
.
IsDefault
)
if
(
document
!=
null
)
{
succeeded
=
true
;
name
=
debugLocationInfo
.
Name
;
lineOffset
=
debugLocationInfo
.
LineOffset
;
// NOTE(cyrusn): We have to wait here because the debuggers'
// GetNameOfLocation is a blocking call. In the future, it
// would be nice if they could make it async.
var
debugLocationInfo
=
_languageDebugInfo
.
GetLocationInfoAsync
(
document
,
point
,
cancellationToken
).
WaitAndGetResult
(
cancellationToken
);
if
(!
debugLocationInfo
.
IsDefault
)
{
succeeded
=
true
;
name
=
debugLocationInfo
.
Name
;
lineOffset
=
debugLocationInfo
.
LineOffset
;
}
}
}
}
...
...
@@ -146,16 +150,20 @@ public int GetProximityExpressions(IVsTextBuffer pBuffer, int iLine, int iCol, i
if
(
textBuffer
!=
null
)
{
var
snapshot
=
textBuffer
.
CurrentSnapshot
;
Document
document
=
snapshot
.
GetOpenDocumentInCurrentContextWithChanges
(
);
if
(
document
!=
null
)
var
nullablePoint
=
snapshot
.
TryGetPoint
(
iLine
,
iCol
);
if
(
nullablePoint
.
HasValue
)
{
var
point
=
snapshot
.
GetPoint
(
iLine
,
iCol
);
var
proximityExpressions
=
_proximityExpressionsService
.
GetProximityExpressionsAsync
(
document
,
point
.
Position
,
waitContext
.
CancellationToken
).
WaitAndGetResult
(
waitContext
.
CancellationToken
);
if
(
proximityExpressions
!=
null
)
Document
document
=
snapshot
.
GetOpenDocumentInCurrentContextWithChanges
();
if
(
document
!=
null
)
{
enumBSTR
=
new
VsEnumBSTR
(
proximityExpressions
);
succeeded
=
true
;
var
point
=
nullablePoint
.
Value
;
var
proximityExpressions
=
_proximityExpressionsService
.
GetProximityExpressionsAsync
(
document
,
point
.
Position
,
waitContext
.
CancellationToken
).
WaitAndGetResult
(
waitContext
.
CancellationToken
);
if
(
proximityExpressions
!=
null
)
{
enumBSTR
=
new
VsEnumBSTR
(
proximityExpressions
);
succeeded
=
true
;
}
}
}
}
...
...
@@ -278,10 +286,17 @@ public int ValidateBreakpointLocation(IVsTextBuffer pBuffer, int iLine, int iCol
if
(
textBuffer
!=
null
)
{
var
snapshot
=
textBuffer
.
CurrentSnapshot
;
var
nullablePoint
=
snapshot
.
TryGetPoint
(
iLine
,
iCol
);
if
(
nullablePoint
==
null
)
{
// The point disappeared between sessions. Do not allow a breakpoint here.
return
VSConstants
.
E_FAIL
;
}
Document
document
=
snapshot
.
AsText
().
GetDocumentWithFrozenPartialSemantics
(
cancellationToken
);
if
(
document
!=
null
)
{
var
point
=
snapshot
.
GetPoint
(
iLine
,
iCol
)
;
var
point
=
nullablePoint
.
Value
;
var
length
=
0
;
if
(
pCodeSpan
!=
null
&&
pCodeSpan
.
Length
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录