Added support for pattern matching syntax to smart variable completion provider#23498
Merged
sharwell merged 4 commits intodotnet:dev15.6.xfrom Jan 23, 2018
Merged
Added support for pattern matching syntax to smart variable completion provider#23498sharwell merged 4 commits intodotnet:dev15.6.xfrom
sharwell merged 4 commits intodotnet:dev15.6.xfrom
Conversation
sharwell
approved these changes
Nov 30, 2017
| token, semanticModel, | ||
| b => b.Right, | ||
| _ => default(SyntaxTokenList), | ||
| _ => ImmutableArray.Create(SymbolKind.Parameter), |
Contributor
There was a problem hiding this comment.
💡 Consider caching this ImmutableArray<SymbolKind> instance as a static field.
| result = IsLastTokenOfType<BinaryExpressionSyntax>( | ||
| token, semanticModel, | ||
| b => b.Right, | ||
| _ => default(SyntaxTokenList), |
Contributor
There was a problem hiding this comment.
might be able to simplify this to _ => default
CyrusNajmabadi
approved these changes
Dec 1, 2017
Contributor
|
@dotnet-bot retest ubuntu_14_debug_prtest please |
sharwell
reviewed
Jan 23, 2018
| { | ||
| internal struct NameDeclarationInfo | ||
| { | ||
| private static readonly ImmutableArray<SymbolKind> parameterSyntaxKind = ImmutableArray.Create(SymbolKind.Parameter); |
Contributor
There was a problem hiding this comment.
❕ This should be ParameterSyntaxKind or s_parameterSyntaxKind (I'll get this fixed)
Contributor
|
@Pilchie for ask mode |
Member
|
Approved for 15.6 Preview 4. |
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.
Customer scenario
The pattern matching syntax is used with an explicit type name, but code completion does not assist the user in typing the name of the new variable.
Bugs this fixes
Fixes #23497
Workarounds, if any
Type the variable name.
Risk
Low. The new code has many tests and only applies to pattern matching cases.
Performance impact
Negligible. The algorithm used for pattern matching syntax is the same as the one used for other declaration locations.
Is this a regression from a previous update?
No.
Root cause analysis
Lack of testing for this case of declaring variables. Tests are now in place.
How was the bug found?
Reported by external user.
Test documentation updated?
No.