提交 e914514d 编写于 作者: J Jan Finkenzeller

removed most of the last commit (handling declarators) since they aren't...

removed most of the last commit (handling declarators) since they aren't discards from the compilers view. Kept the tests around and tweaked them so they now check that nothing is classified in these cases.
上级 b948f057
......@@ -3614,7 +3614,7 @@ void N()
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
public async Task DiscardVariableDeclaration()
public async Task NonDiscardVariableDeclaration()
{
await TestAsync(@"
class X
......@@ -3625,13 +3625,12 @@ void N()
}
}",
Keyword("var"),
Keyword("_"),
Method("Parse"),
Static("Parse"));
Static("Parse"),
Method("Parse"));
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
public async Task DiscardVariableDeclarationMultipleDeclarators()
public async Task NonDiscardVariableDeclarationMultipleDeclarators()
{
await TestAsync(@"
class X
......@@ -3641,9 +3640,7 @@ void N()
int i = 1, _ = 1;
int _ = 2, j = 1;
}
}",
Keyword("_"),
Keyword("_"));
}");
}
[Fact, Trait(Traits.Feature, Traits.Features.Classification)]
......
......@@ -18,7 +18,6 @@ internal class DiscardSyntaxClassifier : AbstractSyntaxClassifier
public override ImmutableArray<Type> SyntaxNodeTypes { get; } = ImmutableArray.Create(
typeof(DiscardDesignationSyntax),
typeof(DiscardPatternSyntax),
typeof(VariableDeclaratorSyntax),
typeof(ParameterSyntax),
typeof(IdentifierNameSyntax));
......@@ -37,10 +36,6 @@ internal class DiscardSyntaxClassifier : AbstractSyntaxClassifier
switch (syntax)
{
case VariableDeclaratorSyntax declarator when declarator.Identifier.Text == "_":
result.Add(new ClassifiedSpan(declarator.Identifier.Span, ClassificationTypeNames.Keyword));
break;
case ParameterSyntax parameter when parameter.Identifier.Text == "_":
var symbol = semanticModel.GetDeclaredSymbol(parameter, cancellationToken);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册