diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2018-12-04 15:36:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 15:36:47 +0300 |
commit | ff47fedf7f798a3ed28e9867e92c69df82496bbd (patch) | |
tree | 9753b0a3bd341338f0be34ff7998782ea286192f | |
parent | 8eb8380a43a3ae99d5a44b2b8f3c72662672e9b6 (diff) | |
parent | e2a6d0a3c8f43ab1cb4b6cdf814fa5d182905c68 (diff) |
Merge pull request #6707 from mono/backport-pr-6368-to-release-7.7
[release-7.7] Fixes VSTS Bug 705110: Code suggestion does wrong thing when enter is
2 files changed, 11 insertions, 0 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs index b5db7b24a2..496eb8f112 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs @@ -508,6 +508,8 @@ namespace MonoDevelop.CSharp.Completion } if (triggerInfo.TriggerCharacter == '_' && triggerWordLength == 1) result.AutoSelect = false; + if (triggerInfo.TriggerCharacter == ' ') + result.AutoCompleteEmptyMatch = true; return result; } diff --git a/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding/CSharpCompletionTextEditorTests.cs b/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding/CSharpCompletionTextEditorTests.cs index 36fafaf78b..74f3a98bd6 100644 --- a/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding/CSharpCompletionTextEditorTests.cs +++ b/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding/CSharpCompletionTextEditorTests.cs @@ -391,5 +391,14 @@ namespace MyLibrary ", (doc, list) => Assert.AreEqual (0, list.Count), new CompletionTriggerInfo (CompletionTriggerReason.CharTyped, '{')); } + /// <summary> + /// Bug 705110: Code suggestion does wrong thing when enter is pressed by default + /// </summary> + [Test] + public async Task TestVSTSBug705110 () + { + await TestCompletion (@"new $", (doc, list) => Assert.IsTrue (list.AutoCompleteEmptyMatch)); + } + } } |