Skip to content

Added support for pattern matching syntax to smart variable completion provider#23498

Merged
sharwell merged 4 commits intodotnet:dev15.6.xfrom
zaytsev-victor:Fixed23497
Jan 23, 2018
Merged

Added support for pattern matching syntax to smart variable completion provider#23498
sharwell merged 4 commits intodotnet:dev15.6.xfrom
zaytsev-victor:Fixed23497

Conversation

@zaytsev-victor
Copy link
Copy Markdown
Contributor

@zaytsev-victor zaytsev-victor commented Nov 30, 2017

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.

@zaytsev-victor zaytsev-victor requested a review from a team as a code owner November 30, 2017 19:57
@sharwell sharwell self-assigned this Nov 30, 2017
@sharwell sharwell added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Nov 30, 2017
@sharwell sharwell added this to the 15.6 milestone Nov 30, 2017
token, semanticModel,
b => b.Right,
_ => default(SyntaxTokenList),
_ => ImmutableArray.Create(SymbolKind.Parameter),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Consider caching this ImmutableArray<SymbolKind> instance as a static field.

@sharwell sharwell requested a review from a team November 30, 2017 21:23
result = IsLastTokenOfType<BinaryExpressionSyntax>(
token, semanticModel,
b => b.Right,
_ => default(SyntaxTokenList),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be able to simplify this to _ => default

@chborl
Copy link
Copy Markdown
Contributor

chborl commented Dec 5, 2017

@dotnet-bot retest ubuntu_14_debug_prtest please

@sharwell sharwell changed the base branch from master to dev15.6.x January 23, 2018 01:36
{
internal struct NameDeclarationInfo
{
private static readonly ImmutableArray<SymbolKind> parameterSyntaxKind = ImmutableArray.Create(SymbolKind.Parameter);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❕ This should be ParameterSyntaxKind or s_parameterSyntaxKind (I'll get this fixed)

@sharwell
Copy link
Copy Markdown
Contributor

@Pilchie for ask mode

@Pilchie
Copy link
Copy Markdown
Member

Pilchie commented Jan 23, 2018

Approved for 15.6 Preview 4.

@sharwell sharwell merged commit a0e6b56 into dotnet:dev15.6.x Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved to merge Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants