未验证 提交 f5118cca 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #43612 from sharwell/dismiss-completion

Dismiss completion in SetUpEditor
...@@ -68,6 +68,8 @@ protected void SetUpEditor(string markupCode) ...@@ -68,6 +68,8 @@ protected void SetUpEditor(string markupCode)
{ {
MarkupTestFile.GetPosition(markupCode, out string code, out int caretPosition); MarkupTestFile.GetPosition(markupCode, out string code, out int caretPosition);
VisualStudio.Editor.DismissCompletionSessions();
var originalValue = VisualStudio.Workspace.IsPrettyListingOn(LanguageName); var originalValue = VisualStudio.Workspace.IsPrettyListingOn(LanguageName);
VisualStudio.Workspace.SetPrettyListing(LanguageName, false); VisualStudio.Workspace.SetPrettyListing(LanguageName, false);
......
...@@ -487,6 +487,13 @@ public void DismissLightBulbSession() ...@@ -487,6 +487,13 @@ public void DismissLightBulbSession()
broker.DismissSession(view); broker.DismissSession(view);
}); });
public void DismissCompletionSessions()
=> ExecuteOnActiveView(view =>
{
var broker = GetComponentModel().GetService<ICompletionBroker>();
broker.DismissAllSessions(view);
});
protected abstract bool HasActiveTextView(); protected abstract bool HasActiveTextView();
protected abstract IWpfTextView GetActiveTextView(); protected abstract IWpfTextView GetActiveTextView();
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
using Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess; using Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess;
using Microsoft.VisualStudio.IntegrationTest.Utilities.Input; using Microsoft.VisualStudio.IntegrationTest.Utilities.Input;
using UIAutomationClient; using UIAutomationClient;
using Xunit;
namespace Microsoft.VisualStudio.IntegrationTest.Utilities.OutOfProcess namespace Microsoft.VisualStudio.IntegrationTest.Utilities.OutOfProcess
{ {
...@@ -233,7 +234,10 @@ public bool IsUseSuggestionModeOn() ...@@ -233,7 +234,10 @@ public bool IsUseSuggestionModeOn()
=> _editorInProc.IsUseSuggestionModeOn(); => _editorInProc.IsUseSuggestionModeOn();
public void SetUseSuggestionMode(bool value) public void SetUseSuggestionMode(bool value)
=> _editorInProc.SetUseSuggestionMode(value); {
Assert.False(IsCompletionActive());
_editorInProc.SetUseSuggestionMode(value);
}
public void WaitForActiveView(string viewName) public void WaitForActiveView(string viewName)
=> _editorInProc.WaitForActiveView(viewName); => _editorInProc.WaitForActiveView(viewName);
......
...@@ -77,6 +77,12 @@ public bool IsLightBulbSessionExpanded() ...@@ -77,6 +77,12 @@ public bool IsLightBulbSessionExpanded()
public void DismissLightBulbSession() public void DismissLightBulbSession()
=> _textViewWindowInProc.DismissLightBulbSession(); => _textViewWindowInProc.DismissLightBulbSession();
public void DismissCompletionSessions()
{
WaitForCompletionSet();
_textViewWindowInProc.DismissCompletionSessions();
}
public string[] GetLightBulbActions() public string[] GetLightBulbActions()
=> _textViewWindowInProc.GetLightBulbActions(); => _textViewWindowInProc.GetLightBulbActions();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册