Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a063b60f
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,发现更多精彩内容 >>
提交
a063b60f
编写于
9月 08, 2015
作者:
R
Ravi Chande
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a test for when the caret cannot be mapped into completion's subject buffer.
上级
9979aacb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
46 addition
and
0 deletion
+46
-0
src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
...Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
+46
-0
未找到文件。
src/EditorFeatures/Test2/IntelliSense/CSharpCompletionCommandHandlerTests.vb
浏览文件 @
a063b60f
...
...
@@ -3,10 +3,17 @@
Imports
System.Threading
Imports
System.Threading.Tasks
Imports
Microsoft.CodeAnalysis.Completion
Imports
Microsoft.CodeAnalysis.Editor.Commands
Imports
Microsoft.CodeAnalysis.Editor.CSharp.Formatting
Imports
Microsoft.CodeAnalysis.Editor.UnitTests.Extensions
Imports
Microsoft.CodeAnalysis.Options
Imports
Microsoft.CodeAnalysis.Text
Imports
Microsoft.VisualStudio.Text
Imports
Microsoft.VisualStudio.Text.Differencing
Imports
Microsoft.VisualStudio.Text.Editor
Imports
Microsoft.VisualStudio.Text.Operations
Imports
Microsoft.VisualStudio.Text.Projection
Imports
Microsoft.VisualStudio.Utilities
Namespace
Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Public
Class
CSharpCompletionCommandHandlerTests
...
...
@@ -1507,5 +1514,44 @@ $$]]></Document>, extraExportedTypes:={GetType(CSharpEditorFormattingService)}.T
state
.
AssertMatchesTextStartingAtLine
(
6
,
"doo;"
)
End
Using
End
Sub
<
WorkItem
(
588
,
"https://github.com/dotnet/roslyn/issues/588"
)
>
<
Fact
,
Trait
(
Traits
.
Feature
,
Traits
.
Features
.
Completion
)
>
Public
Sub
DiffView
()
Using
state
=
TestState
.
CreateCSharpTestState
(
<
Document
><
!
[
CDATA
[
class
C
{
void
foo
(
int
x
)
{
$$
/********/
int
doodle
;
}
}
]]
></
Document
>
,
extraExportedTypes
:
=
{
GetType
(
CSharpEditorFormattingService
)}.
ToList
())
Dim
differenceBufferService
=
state
.
GetExportedValue
(
Of
IDifferenceBufferFactoryService
)
Dim
textBufferFactoryService
=
state
.
GetExportedValue
(
Of
ITextBufferFactoryService
)()
Dim
contentTypeService
=
state
.
GetExportedValue
(
Of
IContentTypeRegistryService
)()
Dim
contentType
=
contentTypeService
.
GetContentType
(
ContentTypeNames
.
CSharpContentType
)
Dim
textViewFactory
=
state
.
GetExportedValue
(
Of
ITextEditorFactoryService
)()
Dim
editorOperationsFactory
=
state
.
GetExportedValue
(
Of
IEditorOperationsFactoryService
)()
Dim
otherBuffer
=
textBufferFactoryService
.
CreateTextBuffer
(
"text"
,
contentType
)
Dim
otherExposedSpan
=
otherBuffer
.
CurrentSnapshot
.
CreateTrackingSpan
(
0
,
4
,
SpanTrackingMode
.
EdgeExclusive
,
TrackingFidelityMode
.
Forward
)
Dim
subjectBufferExposedSpan
=
state
.
SubjectBuffer
.
CurrentSnapshot
.
CreateTrackingSpan
(
0
,
state
.
SubjectBuffer
.
CurrentSnapshot
.
Length
,
SpanTrackingMode
.
EdgeExclusive
,
TrackingFidelityMode
.
Forward
)
Dim
projectionBufferFactory
=
state
.
GetExportedValue
(
Of
IProjectionBufferFactoryService
)()
Dim
projection
=
projectionBufferFactory
.
CreateProjectionBuffer
(
Nothing
,
New
Object
()
{
otherExposedSpan
,
subjectBufferExposedSpan
}.
ToList
(),
ProjectionBufferOptions
.
None
)
Dim
view
=
textViewFactory
.
CreateTextView
(
projection
)
view
.
Caret
.
MoveTo
(
New
SnapshotPoint
(
view
.
TextBuffer
.
CurrentSnapshot
,
0
))
Dim
editorOperations
=
editorOperationsFactory
.
GetEditorOperations
(
view
)
state
.
CompletionCommandHandler
.
ExecuteCommand
(
New
DeleteKeyCommandArgs
(
view
,
state
.
SubjectBuffer
),
Sub
()
editorOperations
.
Delete
())
state
.
AssertNoCompletionSession
()
End
Using
End
Sub
End
Class
End
Namespace
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录