Soft select the item with longest common prefix#45576
Merged
genlu merged 1 commit intodotnet:masterfrom Jul 1, 2020
Merged
Conversation
Member
Author
|
@CyrusNajmabadi I don't know if dropping the old behavior was a deliberate decision, but I like it so I'm bringing it back. |
| bestOrFirstMatchResult = itemsInList.FirstOrDefault(); | ||
| // We do not have matches: pick the one with longest common prefix or the first item from the list. | ||
| selectedItemIndex = 0; | ||
| bestOrFirstMatchResult = itemsInList[0]; |
Contributor
There was a problem hiding this comment.
do we know at thsi point that itemsInList is non-empty?
Member
Author
There was a problem hiding this comment.
yes, it was checked in the caller
| If e.Items.Items.Select(Function(i) i.FilterText).Skip(1).Any() Then | ||
| ' If there is 0 or more than one item left, then it means this was the filter operation that resulted and we're done. | ||
| ' Otherwise we know a Dismiss operation is coming so we should wait for it. | ||
| If e.Items.Items.Count() <> 1 Then |
Contributor
There was a problem hiding this comment.
this is scary. why change this?
Member
Author
There was a problem hiding this comment.
we have a special case which is when we return an empty list instead of directly dismiss the session. W/o this change the test would hang.
http://sourceroslyn.io/#Microsoft.CodeAnalysis.EditorFeatures/Implementation/IntelliSense/AsyncCompletion/ItemManager.cs,475
CyrusNajmabadi
approved these changes
Jul 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
instead of the first item, when there's no item matches filter text. This seems to be the behavior of old C# completion in VS 2013 (prior to Roslyn)
Fix https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1128749
@CyrusNajmabadi @dotnet/roslyn-ide