Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
129df995
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,发现更多精彩内容 >>
提交
129df995
编写于
5月 12, 2016
作者:
T
Tanner Gooding
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Responding to PR feedback.
上级
a7dc3b60
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
10 deletion
+60
-10
src/VisualStudio/IntegrationTests/CSharp/CSharpAutomaticBraceCompletion.cs
...IntegrationTests/CSharp/CSharpAutomaticBraceCompletion.cs
+11
-6
src/VisualStudio/TestUtilities/IntegrationHelper.cs
src/VisualStudio/TestUtilities/IntegrationHelper.cs
+2
-2
src/VisualStudio/TestUtilities/Interop/Kernel32.cs
src/VisualStudio/TestUtilities/Interop/Kernel32.cs
+1
-2
src/VisualStudio/TestUtilities/Window/EditorWindow.cs
src/VisualStudio/TestUtilities/Window/EditorWindow.cs
+46
-0
未找到文件。
src/VisualStudio/IntegrationTests/CSharp/CSharpAutomaticBraceCompletion.cs
浏览文件 @
129df995
...
...
@@ -52,7 +52,7 @@ public async Task BracesInsertionAndTabCompleting()
Assert
.
Equal
(
" if (true) { "
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
"}"
,
_editorWindow
.
CurrentLineTextAfterCursor
);
await
_editorWindow
.
TypeTextAsync
(
"\t
"
);
await
_editorWindow
.
TypeTextAsync
(
$"
{
EditorWindow
.
TAB
}
"
);
Assert
.
Equal
(
" if (true) { }"
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
string
.
Empty
,
_editorWindow
.
CurrentLineTextAfterCursor
);
...
...
@@ -88,7 +88,8 @@ public async Task BracesOnReturnNoFormattingOnlyIndentationBeforeCloseBrace()
_editorWindow
.
PlaceCursor
(
"// Marker"
);
await
_editorWindow
.
TypeTextAsync
(
"if (true) {"
);
await
_editorWindow
.
TypeTextAsync
(
"\nvar a = 1;"
);
await
_editorWindow
.
TypeTextAsync
(
$"
{
EditorWindow
.
ENTER
}
"
);
await
_editorWindow
.
TypeTextAsync
(
"var a = 1;"
);
Assert
.
Equal
(
" var a = 1;"
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
string
.
Empty
,
_editorWindow
.
CurrentLineTextAfterCursor
);
...
...
@@ -106,7 +107,8 @@ public async Task BracesOnReturnOvertypingTheClosingBrace()
_editorWindow
.
PlaceCursor
(
"// Marker"
);
await
_editorWindow
.
TypeTextAsync
(
"if (true) {"
);
await
_editorWindow
.
TypeTextAsync
(
"\nvar a = 1;}"
);
await
_editorWindow
.
TypeTextAsync
(
$"
{
EditorWindow
.
ENTER
}
"
);
await
_editorWindow
.
TypeTextAsync
(
"var a = 1;}"
);
Assert
.
Equal
(
" }"
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
string
.
Empty
,
_editorWindow
.
CurrentLineTextAfterCursor
);
...
...
@@ -123,7 +125,9 @@ public async Task BracesOnReturnOvertypingTheClosingBrace()
public
async
Task
BracesOnReturnWithNonWhitespaceSpanInside
()
{
_editorWindow
.
Text
=
string
.
Empty
;
await
_editorWindow
.
TypeTextAsync
(
"class A { int i;\n"
);
await
_editorWindow
.
TypeTextAsync
(
"class A { int i;"
);
await
_editorWindow
.
TypeTextAsync
(
$"
{
EditorWindow
.
ENTER
}
"
);
Assert
.
Equal
(
string
.
Empty
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
"}"
,
_editorWindow
.
CurrentLineTextAfterCursor
);
...
...
@@ -146,7 +150,8 @@ public async Task ParenInsertionAndTabCompleting()
Assert
.
Equal
(
" void Foo("
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
")"
,
_editorWindow
.
CurrentLineTextAfterCursor
);
await
_editorWindow
.
TypeTextAsync
(
"int x\t"
);
await
_editorWindow
.
TypeTextAsync
(
"int x"
);
await
_editorWindow
.
TypeTextAsync
(
$"
{
EditorWindow
.
TAB
}
"
);
Assert
.
Equal
(
" void Foo(int x)"
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
Assert
.
Equal
(
string
.
Empty
,
_editorWindow
.
CurrentLineTextAfterCursor
);
...
...
@@ -162,7 +167,7 @@ public async Task ParenOvertyping()
_editorWindow
.
PlaceCursor
(
"// Marker"
);
await
_editorWindow
.
TypeTextAsync
(
"void Foo("
);
await
_editorWindow
.
TypeTextAsync
(
"\u001B"
);
// ESC
await
_editorWindow
.
TypeTextAsync
(
$"
{
EditorWindow
.
ESC
}
"
);
await
_editorWindow
.
TypeTextAsync
(
")"
);
Assert
.
Equal
(
" void Foo()"
,
_editorWindow
.
CurrentLineTextBeforeCursor
);
...
...
src/VisualStudio/TestUtilities/IntegrationHelper.cs
浏览文件 @
129df995
...
...
@@ -44,7 +44,7 @@ public static bool BlockInput()
{
var
hresult
=
Marshal
.
GetHRForLastWin32Error
();
if
(
hresult
==
-
2147024891
)
// E_ACCESS_DENIED
if
(
hresult
==
VSConstants
.
E_ACCESSDENIED
)
{
Debug
.
WriteLine
(
"Input cannot be blocked because the system requires Administrative privileges."
);
}
...
...
@@ -140,7 +140,7 @@ public static object GetRegistryKeyValue(RegistryKey baseKey, string subKeyName,
{
if
(
registryKey
==
null
)
{
throw
new
Exception
(
$
"The specified registry key could not be found. Registry Key: '
{
registryKey
}
'"
);
throw
new
Exception
(
$
@"The specified registry key could not be found. Registry Key: '
{
baseKey
}
\
{
subKeyName
}
'"
);
}
return
registryKey
.
GetValue
(
valueName
);
...
...
src/VisualStudio/TestUtilities/Interop/Kernel32.cs
浏览文件 @
129df995
...
...
@@ -7,7 +7,6 @@ namespace Roslyn.VisualStudio.Test.Utilities.Interop
internal
static
class
Kernel32
{
[
DllImport
(
"Kernel32.dll"
,
CallingConvention
=
CallingConvention
.
Winapi
,
EntryPoint
=
"GetCurrentThreadId"
,
PreserveSig
=
true
,
SetLastError
=
false
)]
public
static
extern
uint
GetCurrentThreadId
(
);
public
static
extern
uint
GetCurrentThreadId
();
}
}
src/VisualStudio/TestUtilities/Window/EditorWindow.cs
浏览文件 @
129df995
...
...
@@ -12,6 +12,52 @@ namespace Roslyn.VisualStudio.Test.Utilities
/// <summary>Provides a means of interacting with the active editor window in the Visual Studio host.</summary>
public
class
EditorWindow
{
public
const
char
ENTER
=
'\
u000D
'
;
public
const
char
TAB
=
'\
u0009
'
;
public
const
char
ESC
=
'\
u001B
'
;
public
const
char
ESCAPE
=
'\
u001B
'
;
public
const
char
HOME
=
'\
u0024
'
;
public
const
char
END
=
'\
u0023
'
;
public
const
char
LEFT
=
'\
u0025
'
;
public
const
char
RIGHT
=
'\
u0027
'
;
public
const
char
UP
=
'\
u0026
'
;
public
const
char
DOWN
=
'\
u0028
'
;
public
const
char
PGUP
=
'\
u0021
'
;
public
const
char
PGDN
=
'\
u0022
'
;
public
const
char
NUMLOCK
=
'\
u0090
'
;
public
const
char
SCROLLLOCK
=
'\
u0091
'
;
public
const
char
PRTSC
=
'\
u002C
'
;
public
const
char
BREAK
=
'\
u0003
'
;
public
const
char
BACKSPACE
=
'\
u0008
'
;
public
const
char
BKSP
=
'\
u0008
'
;
public
const
char
BS
=
'\
u0008
'
;
public
const
char
CLEAR
=
'\
u000C
'
;
public
const
char
CAPSLOCK
=
'\
u0014
'
;
public
const
char
INSERT
=
'\
u002D
'
;
public
const
char
DEL
=
'\
u002E
'
;
public
const
char
DELETE
=
'\
u002E
'
;
public
const
char
HELP
=
'\
u002F
'
;
public
const
char
F1
=
'\
u0070
'
;
public
const
char
F2
=
'\
u0071
'
;
public
const
char
F3
=
'\
u0072
'
;
public
const
char
F4
=
'\
u0073
'
;
public
const
char
F5
=
'\
u0074
'
;
public
const
char
F6
=
'\
u0075
'
;
public
const
char
F7
=
'\
u0076
'
;
public
const
char
F8
=
'\
u0077
'
;
public
const
char
F9
=
'\
u0078
'
;
public
const
char
F10
=
'\
u0079
'
;
public
const
char
F11
=
'\
u007A
'
;
public
const
char
F12
=
'\
u007B
'
;
public
const
char
F13
=
'\
u007C
'
;
public
const
char
F14
=
'\
u007D
'
;
public
const
char
F15
=
'\
u007E
'
;
public
const
char
F16
=
'\
u007F
'
;
public
const
char
MULTIPLY
=
'\
u006A
'
;
public
const
char
ADD
=
'\
u006B
'
;
public
const
char
SUBTRACT
=
'\
u006D
'
;
public
const
char
DIVIDE
=
'\
u006F
'
;
private
readonly
VisualStudioInstance
_visualStudioInstance
;
private
readonly
EditorWindowWrapper
_editorWindowWrapper
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录