未验证 提交 90895f90 编写于 作者: I Ivan Basov 提交者: GitHub

Completion gets in the way attempting to line up arguments

......@@ -63,6 +63,12 @@ internal CompletionSource(ITextView textView, IThreadingContext threadingContext
// We would like to be sure that nobody changes buffers at the same time.
AssertIsForeground();
if (_textView.Selection.Mode == TextSelectionMode.Box)
{
// No completion with multiple selection
return AsyncCompletionData.CompletionStartData.DoesNotParticipateInCompletion;
}
var document = triggerLocation.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
if (document == null)
{
......@@ -109,6 +115,12 @@ internal CompletionSource(ITextView textView, IThreadingContext threadingContext
return true;
}
// Enter does not trigger completion.
if (trigger.Reason == AsyncCompletionData.CompletionTriggerReason.Insertion && trigger.Character == '\n')
{
return false;
}
//The user may be trying to invoke snippets through question-tab.
// We may provide a completion after that.
// Otherwise, tab should not be a completion trigger.
......
......@@ -119,6 +119,29 @@ class C
End Using
End Function
<MemberData(NameOf(AllCompletionImplementations))>
<WpfTheory, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function TestEnterDoesNotTriggerCompletion(completionImplementation As CompletionImplementation) As Task
Using state = TestStateFactory.CreateCSharpTestState(completionImplementation,
<Document>
using System;
class C
{
void M()
{
String.Equals("foo", "bar", $$StringComparison.CurrentCulture)
}
}
</Document>)
state.SendReturn()
Await state.WaitForAsynchronousOperationsAsync()
Await state.AssertNoCompletionSession()
End Using
End Function
<MemberData(NameOf(AllCompletionImplementations))>
<WpfTheory, Trait(Traits.Feature, Traits.Features.Completion)>
Public Async Function TestNotAtStartOfExistingWord(completionImplementation As CompletionImplementation) As Task
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册