Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
cfa2d9e3
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,发现更多精彩内容 >>
提交
cfa2d9e3
编写于
6月 24, 2019
作者:
C
Cyrus Najmabadi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused method from sighelp
上级
1d4a8a99
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
7 addition
and
15 deletion
+7
-15
src/EditorFeatures/Core/Implementation/IntelliSense/IDocumentProvider.cs
...res/Core/Implementation/IntelliSense/IDocumentProvider.cs
+3
-10
src/EditorFeatures/Core/Implementation/IntelliSense/SignatureHelp/Controller.Session_ComputeModel.cs
...lliSense/SignatureHelp/Controller.Session_ComputeModel.cs
+1
-1
src/EditorFeatures/Test2/IntelliSense/SignatureHelpControllerTests.vb
...atures/Test2/IntelliSense/SignatureHelpControllerTests.vb
+3
-4
未找到文件。
src/EditorFeatures/Core/Implementation/IntelliSense/IDocumentProvider.cs
浏览文件 @
cfa2d9e3
...
@@ -10,8 +10,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense
...
@@ -10,8 +10,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense
{
{
internal
interface
IDocumentProvider
internal
interface
IDocumentProvider
{
{
Task
<
Document
>
GetDocumentAsync
(
ITextSnapshot
snapshot
,
CancellationToken
cancellationToken
);
Document
GetDocument
(
ITextSnapshot
snapshot
,
CancellationToken
cancellationToken
);
Document
GetOpenDocumentInCurrentContextWithChanges
(
ITextSnapshot
snapshot
);
}
}
internal
class
DocumentProvider
:
ForegroundThreadAffinitizedObject
,
IDocumentProvider
internal
class
DocumentProvider
:
ForegroundThreadAffinitizedObject
,
IDocumentProvider
...
@@ -21,16 +20,10 @@ public DocumentProvider(IThreadingContext threadingContext)
...
@@ -21,16 +20,10 @@ public DocumentProvider(IThreadingContext threadingContext)
{
{
}
}
public
Task
<
Document
>
GetDocumentAsync
(
ITextSnapshot
snapshot
,
CancellationToken
cancellationToken
)
public
Document
GetDocument
(
ITextSnapshot
snapshot
,
CancellationToken
cancellationToken
)
{
{
AssertIsBackground
();
AssertIsBackground
();
return
Task
.
FromResult
(
snapshot
.
AsText
().
GetDocumentWithFrozenPartialSemantics
(
cancellationToken
));
return
snapshot
.
AsText
().
GetDocumentWithFrozenPartialSemantics
(
cancellationToken
);
}
public
Document
GetOpenDocumentInCurrentContextWithChanges
(
ITextSnapshot
snapshot
)
{
var
text
=
snapshot
.
AsText
();
return
text
.
GetOpenDocumentInCurrentContextWithChanges
();
}
}
}
}
}
}
src/EditorFeatures/Core/Implementation/IntelliSense/SignatureHelp/Controller.Session_ComputeModel.cs
浏览文件 @
cfa2d9e3
...
@@ -55,7 +55,7 @@ internal partial class Session
...
@@ -55,7 +55,7 @@ internal partial class Session
AssertIsBackground
();
AssertIsBackground
();
cancellationToken
.
ThrowIfCancellationRequested
();
cancellationToken
.
ThrowIfCancellationRequested
();
var
document
=
await
Controller
.
DocumentProvider
.
GetDocumentAsync
(
caretPosition
.
Snapshot
,
cancellationToken
).
ConfigureAwait
(
false
);
var
document
=
Controller
.
DocumentProvider
.
GetDocument
(
caretPosition
.
Snapshot
,
cancellationToken
);
if
(
document
==
null
)
if
(
document
==
null
)
{
{
return
currentModel
;
return
currentModel
;
...
...
src/EditorFeatures/Test2/IntelliSense/SignatureHelpControllerTests.vb
浏览文件 @
cfa2d9e3
...
@@ -25,7 +25,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
...
@@ -25,7 +25,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
<
WpfFact
>
<
WpfFact
>
Public
Sub
InvokeSignatureHelpWithoutDocumentShouldNotStartNewSession
()
Public
Sub
InvokeSignatureHelpWithoutDocumentShouldNotStartNewSession
()
Dim
emptyProvider
=
New
Mock
(
Of
IDocumentProvider
)
Dim
emptyProvider
=
New
Mock
(
Of
IDocumentProvider
)
emptyProvider
.
Setup
(
Function
(
p
)
p
.
GetDocument
Async
(
It
.
IsAny
(
Of
ITextSnapshot
),
It
.
IsAny
(
Of
CancellationToken
))).
Returns
(
Task
.
FromResult
(
DirectCast
(
Nothing
,
Document
)
))
emptyProvider
.
Setup
(
Function
(
p
)
p
.
GetDocument
(
It
.
IsAny
(
Of
ITextSnapshot
),
It
.
IsAny
(
Of
CancellationToken
))).
Returns
(
DirectCast
(
Nothing
,
Document
))
Dim
controller
As
Controller
=
CreateController
(
documentProvider
:
=
emptyProvider
)
Dim
controller
As
Controller
=
CreateController
(
documentProvider
:
=
emptyProvider
)
controller
.
WaitForController
()
controller
.
WaitForController
()
...
@@ -217,7 +217,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
...
@@ -217,7 +217,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
New
TypeCharCommandArgs
(
CreateMock
(
Of
ITextView
),
CreateMock
(
Of
ITextBuffer
),
"a"
c
),
New
TypeCharCommandArgs
(
CreateMock
(
Of
ITextView
),
CreateMock
(
Of
ITextBuffer
),
"a"
c
),
Sub
()
GetMocks
(
controller
).
Buffer
.
Insert
(
0
,
"a"
),
TestCommandExecutionContext
.
Create
())
Sub
()
GetMocks
(
controller
).
Buffer
.
Insert
(
0
,
"a"
),
TestCommandExecutionContext
.
Create
())
GetMocks
(
controller
).
DocumentProvider
.
Verify
(
Function
(
p
)
p
.
GetDocument
Async
(
It
.
IsAny
(
Of
ITextSnapshot
),
It
.
IsAny
(
Of
CancellationToken
)),
Times
.
Never
)
GetMocks
(
controller
).
DocumentProvider
.
Verify
(
Function
(
p
)
p
.
GetDocument
(
It
.
IsAny
(
Of
ITextSnapshot
),
It
.
IsAny
(
Of
CancellationToken
)),
Times
.
Never
)
End
Sub
End
Sub
Private
Shared
ReadOnly
s_controllerMocksMap
As
New
ConditionalWeakTable
(
Of
Controller
,
ControllerMocks
)
Private
Shared
ReadOnly
s_controllerMocksMap
As
New
ConditionalWeakTable
(
Of
Controller
,
ControllerMocks
)
...
@@ -251,8 +251,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
...
@@ -251,8 +251,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Dim
asyncListener
=
New
Mock
(
Of
IAsynchronousOperationListener
)
Dim
asyncListener
=
New
Mock
(
Of
IAsynchronousOperationListener
)
If
documentProvider
Is
Nothing
Then
If
documentProvider
Is
Nothing
Then
documentProvider
=
New
Mock
(
Of
IDocumentProvider
)
documentProvider
=
New
Mock
(
Of
IDocumentProvider
)
documentProvider
.
Setup
(
Function
(
p
)
p
.
GetDocumentAsync
(
It
.
IsAny
(
Of
ITextSnapshot
),
It
.
IsAny
(
Of
CancellationToken
))).
Returns
(
Task
.
FromResult
(
document
))
documentProvider
.
Setup
(
Function
(
p
)
p
.
GetDocument
(
It
.
IsAny
(
Of
ITextSnapshot
),
It
.
IsAny
(
Of
CancellationToken
))).
Returns
(
document
)
documentProvider
.
Setup
(
Function
(
p
)
p
.
GetOpenDocumentInCurrentContextWithChanges
(
It
.
IsAny
(
Of
ITextSnapshot
))).
Returns
(
document
)
End
If
End
If
If
provider
Is
Nothing
Then
If
provider
Is
Nothing
Then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录