40 references to Feature
Microsoft.CodeAnalysis.CSharp.Features (15)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
18
public CSharpAnalyzer(ISyntaxFacts syntaxFacts,
Feature
features)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.cs (9)
37
var
features =
38
(version >= LanguageVersion.CSharp7 ?
Feature
.SourcePattern |
Feature
.IsTypePattern |
Feature
.CaseGuard : 0) |
39
(version >= LanguageVersion.CSharp8 ?
Feature
.SwitchExpression : 0) |
40
(version >= LanguageVersion.CSharp9 ?
Feature
.RelationalPattern |
Feature
.OrPattern |
Feature
.AndPattern |
Feature
.TypePattern : 0);
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (5)
30
public override SyntaxNode CreateSwitchExpressionStatement(SyntaxNode target, ImmutableArray<AnalyzedSwitchSection> sections,
Feature
feature)
38
private static SwitchExpressionArmSyntax AsSwitchExpressionArmSyntax(AnalyzedSwitchSection section,
Feature
feature)
89
public override SyntaxNode AsSwitchLabelSyntax(AnalyzedSwitchLabel label,
Feature
feature)
95
private static PatternSyntax AsPatternSyntax(AnalyzedPattern pattern,
Feature
feature)
101
AnalyzedPattern.Type p when feature.HasFlag(
Feature
.TypePattern) => TypePattern((TypeSyntax)p.IsExpressionSyntax.Right),
Microsoft.CodeAnalysis.Features (19)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (12)
67
protected Analyzer(ISyntaxFacts syntaxFacts,
Feature
features)
73
public
Feature
Features { get; }
75
public bool Supports(
Feature
feature)
274
when Supports(
Feature
.RangePattern) && GetRangeBounds(op) is (TExpressionSyntax lower, TExpressionSyntax higher):
288
when Supports(
Feature
.InequalityPattern):
292
when Supports(
Feature
.RelationalPattern) && IsRelationalOperator(op.OperatorKind):
298
when Supports(
Feature
.AndPattern |
Feature
.CaseGuard):
304
if (Supports(
Feature
.AndPattern))
315
if (Supports(
Feature
.CaseGuard) && op.RightOperand.Syntax is TExpressionSyntax node)
325
when Supports(
Feature
.IsTypePattern) && CheckTargetExpression(op.ValueOperand) && op.Syntax is TIsExpressionSyntax node:
329
when Supports(
Feature
.SourcePattern) && CheckTargetExpression(op.Value) && op.Pattern.Syntax is TPatternSyntax pattern:
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (3)
58
if (analyzer.Supports(
Feature
.SwitchExpression) &&
59
CanConvertToSwitchExpression(analyzer.Supports(
Feature
.OrPattern), sections))
254
if (convertToSwitchExpression && !CanConvertToSwitchExpression(analyzer.Supports(
Feature
.OrPattern), sections))
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (4)
22
public abstract SyntaxNode CreateSwitchExpressionStatement(SyntaxNode target, ImmutableArray<AnalyzedSwitchSection> sections,
Feature
feature);
25
public abstract SyntaxNode AsSwitchLabelSyntax(AnalyzedSwitchLabel label,
Feature
feature);
33
Feature
feature,
60
private SyntaxNode AsSwitchSectionSyntax(AnalyzedSwitchSection section, SyntaxGenerator generator,
Feature
feature)
Microsoft.CodeAnalysis.VisualBasic.Features (6)
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Analyzer.vb (1)
14
Public Sub New(syntaxFacts As ISyntaxFacts, features As
Feature
)
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Rewriting.vb (2)
22
Public Overrides Function CreateSwitchExpressionStatement(target As SyntaxNode, sections As ImmutableArray(Of AnalyzedSwitchSection), feature As
Feature
) As SyntaxNode
35
Public Overrides Function AsSwitchLabelSyntax(label As AnalyzedSwitchLabel, feature As
Feature
) As SyntaxNode
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.vb (3)
28
Return New VisualBasicAnalyzer(syntaxFacts,
Feature
.RangePattern Or
Feature
.RelationalPattern Or
Feature
.InequalityPattern)