From f9a3ae70b90cb903495785034032807b7233febb Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Fri, 20 Dec 2019 16:11:57 -0800 Subject: [PATCH] Add comment --- .../SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Features/CSharp/Portable/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs b/src/Features/CSharp/Portable/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs index af5475ef1ea..89b18dec080 100644 --- a/src/Features/CSharp/Portable/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs @@ -43,6 +43,10 @@ protected override string GetTitle(string diagnosticId, string nodeText) protected override SyntaxNode AddSimplificationAnnotationTo(SyntaxNode expressionSyntax) { + // Add the DoNotAllowVarAnnotation annotation. All the code fixer + // does is pass the tagged node to the simplifier. And we do *not* + // ever want the simplifier to produce 'var' in the 'Simplify type + // names' fixer. only the 'Use var' fixer should produce 'var'. var annotatedexpressionSyntax = expressionSyntax.WithAdditionalAnnotations( Simplifier.Annotation, Formatter.Annotation, DoNotAllowVarAnnotation.Annotation); -- GitLab