Skip to content

C# Cleanup and refactoring #5131

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

Merged
merged 12 commits into from
Feb 15, 2021
Merged

C# Cleanup and refactoring #5131

merged 12 commits into from
Feb 15, 2021

Conversation

tamasvajk
Copy link
Contributor

@tamasvajk tamasvajk commented Feb 10, 2021

This PR is the first in multiple steps to remove nullability warnings. Currently when the context is created for CIL extraction, null is passed as scope and compilation, which results in two nullability warnings. To overcome this, I think the best approach would be to have dedicated source and CIL extraction context classes. This PR only moves around functionalities. Most importantly, the static Location factories are moved to instance methods on the Context, which will later allow us to override them.

Differences job

@tamasvajk tamasvajk added the C# label Feb 10, 2021
@tamasvajk tamasvajk marked this pull request as ready for review February 10, 2021 15:15
@tamasvajk tamasvajk requested a review from a team as a code owner February 10, 2021 15:15
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Two questions, otherwise LGTM.


namespace Semmle.Extraction.CSharp.Populators
{
internal class AstLineCounter : CSharpSyntaxVisitor<LineCounts>
Copy link
Contributor

Choose a reason for hiding this comment

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

Now Method no longer needs to be partial.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, good point. Sorry...

hvitved
hvitved previously approved these changes Feb 15, 2021
@tamasvajk
Copy link
Contributor Author

@hvitved I rebased this, and fixed the build issue after the rebase. Let's see if the tests pass, and if so, then it's ready to be merged.

@tamasvajk tamasvajk merged commit d1fe542 into github:main Feb 15, 2021
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.

2 participants