Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Jul 7, 2020
1 parent a45a4bf commit b299be7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ private static bool IsAfterCompleteExpressionOrPatternInCaseLabel(CSharpSyntaxCo
return false;
}

// Never show `when` after `var` in a pattern. It's virtually always going to be unhelpful as the user is
// far more likely to be writing `case var someName...` rather than typing `cae var when...` (in the case
// that `var` is a constant). In other words, it's fine to make that rare case have to manually type out
// `when` rather than risk having `when` pop up when it's not desired.
if (context.TargetToken.Text == "var")
return false;

Expand Down

0 comments on commit b299be7

Please sign in to comment.