Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port UseThrowExpression analyzer/fixer to shared layer #42264

Merged
merged 2 commits into from
Mar 11, 2020

Conversation

mavasani
Copy link
Contributor

@mavasani mavasani commented Mar 8, 2020

First commit has source changes. Second commit has xlf file changes

@mavasani mavasani added this to the 16.6.P1 milestone Mar 8, 2020
@mavasani mavasani requested review from CyrusNajmabadi and a team March 8, 2020 09:29
@@ -23,7 +29,7 @@ protected override bool IsSupported(ParseOptions options)
return csOptions.LanguageVersion >= LanguageVersion.CSharp7;
}

protected override ISemanticFactsService GetSemanticFactsService()
=> CSharpSemanticFactsService.Instance;
protected override bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol expressionTypeOpt, CancellationToken cancellationToken)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can consider moving ISemanticFactsService down to shared analyzer layer, but it seems IsInExpressionTree is the only API from that service used in the IDE analyzers, so I have instead switched to directly invoking the extension method.

Copy link
Member

Choose a reason for hiding this comment

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

can you add this to the lit of work. one of the primary reasons for ISyntax/SemanticFacts is so that we can take the direct questions like this out of the features and use a common mechanism.

I'm fine with this for now, but would def like to see it cleaned back up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added porting ISemanticFactsService to shared analyzer layer to the follow-up work list in #41462 (comment)

@mavasani mavasani mentioned this pull request Mar 11, 2020
23 tasks
@mavasani mavasani merged commit 9bfcf96 into dotnet:master Mar 11, 2020
@ghost ghost modified the milestones: 16.6.P1, Next Mar 11, 2020
@mavasani mavasani deleted the PortUseThrowExpression branch March 11, 2020 14:21
@sharwell sharwell modified the milestones: Next, 16.6.P2 Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants