Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
13a68a82
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,发现更多精彩内容 >>
提交
13a68a82
编写于
6月 07, 2019
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IsCompletionActive returns false when no text view is active
上级
d61a6352
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
10 deletion
+38
-10
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs
.../IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs
+25
-9
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/InteractiveWindow_InProc.cs
...nTest/TestUtilities/InProcess/InteractiveWindow_InProc.cs
+3
-0
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/TextViewWindow_InProc.cs
...tionTest/TestUtilities/InProcess/TextViewWindow_InProc.cs
+10
-1
未找到文件。
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs
浏览文件 @
13a68a82
...
...
@@ -52,31 +52,47 @@ private Editor_InProc()
public
static
Editor_InProc
Create
()
=>
new
Editor_InProc
();
protected
override
bool
HasActiveTextView
()
=>
ErrorHandler
.
Succeeded
(
TryGetActiveTextViewHost
().
hr
);
protected
override
IWpfTextView
GetActiveTextView
()
=>
GetActiveTextViewHost
().
TextView
;
private
static
IVsTextView
GetActiveVsTextView
()
{
var
vsTextManager
=
GetGlobalService
<
SVsTextManager
,
IVsTextManager
>();
var
(
textView
,
hr
)
=
TryGetActiveVsTextView
();
Marshal
.
ThrowExceptionForHR
(
hr
);
return
textView
;
}
private
static
(
IVsTextView
textView
,
int
hr
)
TryGetActiveVsTextView
()
{
var
vsTextManager
=
GetGlobalService
<
SVsTextManager
,
IVsTextManager
>();
var
hresult
=
vsTextManager
.
GetActiveView
(
fMustHaveFocus
:
1
,
pBuffer
:
null
,
ppView
:
out
var
vsTextView
);
Marshal
.
ThrowExceptionForHR
(
hresult
);
return
vsTextView
;
return
(
vsTextView
,
hresult
);
}
private
static
IWpfTextViewHost
GetActiveTextViewHost
()
{
var
(
textViewHost
,
hr
)
=
TryGetActiveTextViewHost
();
Marshal
.
ThrowExceptionForHR
(
hr
);
return
textViewHost
;
}
private
static
(
IWpfTextViewHost
textViewHost
,
int
hr
)
TryGetActiveTextViewHost
()
{
// The active text view might not have finished composing yet, waiting for the application to 'idle'
// means that it is done pumping messages (including WM_PAINT) and the window should return the correct text view
WaitForApplicationIdle
(
Helper
.
HangMitigatingTimeout
);
var
activeVsTextView
=
(
IVsUserData
)
GetActiveVsTextView
();
var
hresult
=
activeVsTextView
.
GetData
(
IWpfTextViewId
,
out
var
wpfTextViewHost
);
Marshal
.
ThrowExceptionForHR
(
hresult
);
var
(
activeVsTextView
,
hr
)
=
TryGetActiveVsTextView
();
if
(!
ErrorHandler
.
Succeeded
(
hr
))
{
return
(
null
,
hr
);
}
return
(
IWpfTextViewHost
)
wpfTextViewHost
;
var
hresult
=
((
IVsUserData
)
activeVsTextView
).
GetData
(
IWpfTextViewId
,
out
var
wpfTextViewHost
);
return
((
IWpfTextViewHost
)
wpfTextViewHost
,
hresult
);
}
public
bool
IsUseSuggestionModeOn
()
...
...
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/InteractiveWindow_InProc.cs
浏览文件 @
13a68a82
...
...
@@ -61,6 +61,9 @@ public bool IsInitializing
public
string
GetReplText
()
=>
_interactiveWindow
.
TextView
.
TextBuffer
.
CurrentSnapshot
.
GetText
();
protected
override
bool
HasActiveTextView
()
=>
_interactiveWindow
.
TextView
is
object
;
protected
override
IWpfTextView
GetActiveTextView
()
=>
_interactiveWindow
.
TextView
;
...
...
src/VisualStudio/IntegrationTest/TestUtilities/InProcess/TextViewWindow_InProc.cs
浏览文件 @
13a68a82
...
...
@@ -94,11 +94,18 @@ public void WaitForLightBulbSession()
/// querying the editor
/// </remarks>
public
bool
IsCompletionActive
()
=>
ExecuteOnActiveView
(
view
=>
{
if
(!
HasActiveTextView
())
{
return
false
;
}
return
ExecuteOnActiveView
(
view
=>
{
var
broker
=
GetComponentModelService
<
ICompletionBroker
>();
return
broker
.
IsCompletionActive
(
view
);
});
}
protected
abstract
ITextBuffer
GetBufferContainingCaret
(
IWpfTextView
view
);
...
...
@@ -478,6 +485,8 @@ public void DismissLightBulbSession()
broker
.
DismissSession
(
view
);
});
protected
abstract
bool
HasActiveTextView
();
protected
abstract
IWpfTextView
GetActiveTextView
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录