Clean up mac completion broker.
This commit is contained in:
parent
6b2b47a8e6
commit
9fc6b8fcf5
|
|
@ -10,6 +10,8 @@ namespace Microsoft.VisualStudio.Mac.LanguageServices.Razor.Editor
|
||||||
{
|
{
|
||||||
internal class DefaultVisualStudioCompletionBroker : VisualStudioCompletionBroker
|
internal class DefaultVisualStudioCompletionBroker : VisualStudioCompletionBroker
|
||||||
{
|
{
|
||||||
|
private const string IsCompletionActiveKey = "RoslynCompletionPresenterSession.IsCompletionActive";
|
||||||
|
|
||||||
public override bool IsCompletionActive(ITextView textView)
|
public override bool IsCompletionActive(ITextView textView)
|
||||||
{
|
{
|
||||||
if (textView == null)
|
if (textView == null)
|
||||||
|
|
@ -17,14 +19,22 @@ namespace Microsoft.VisualStudio.Mac.LanguageServices.Razor.Editor
|
||||||
throw new ArgumentNullException(nameof(textView));
|
throw new ArgumentNullException(nameof(textView));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textView.HasAggregateFocus)
|
if (!textView.HasAggregateFocus)
|
||||||
{
|
{
|
||||||
return CompletionWindowManager.IsVisible ||
|
// Text view does not have focus, if the completion window is visible it's for a different text view.
|
||||||
(textView.Properties.TryGetProperty<bool>("RoslynCompletionPresenterSession.IsCompletionActive", out var visible)
|
return false;
|
||||||
&& visible);
|
}
|
||||||
|
|
||||||
|
if (CompletionWindowManager.IsVisible)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (textView.Properties.TryGetProperty<bool>(IsCompletionActiveKey, out var visible))
|
||||||
|
{
|
||||||
|
return visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text view does not have focus, if the completion window is visible it's for a different text view.
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue