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

Missing nodes in SyntaxNodeComparer need better reporting. #160

Closed
belav opened this issue May 2, 2021 · 0 comments · Fixed by #231
Closed

Missing nodes in SyntaxNodeComparer need better reporting. #160

belav opened this issue May 2, 2021 · 0 comments · Fixed by #231
Labels
type:bug Something isn't working
Milestone

Comments

@belav
Copy link
Owner

belav commented May 2, 2021

When SyntaxNodeComparer compares the following

public class ConstructorWithBase
{
    public ConstructorWithBase(string value)
        : base(value)
    {
        return;
    }
}
public class ConstructorWithBase
{
    public ConstructorWithBase(string value)
    {
        return;
    }
}

It ends up with the following message. Which isn't as helpful as it could be.

Original: Around Line 3
{
    public ConstructorWithBase(string value)
        : base(value)
    {
        return;
    }
}
    Formatted: Missing

The problem is because the root Compare method is comparing null to a node, which means they are not equal. But it has no context for where the null node is.
SyntaxNodeComparer probably needs to be modified to keep track of parents in the stack, and passing them to the compare methods.
See the ignored unit test.

@belav belav added this to the 0.9.1 milestone May 2, 2021
@belav belav added the type:bug Something isn't working label May 2, 2021
@belav belav modified the milestones: 0.9.1, 0.9.2 May 3, 2021
@belav belav added this to To do in CSharpier May 6, 2021
@belav belav added this to Selected For Dev in Bug Triage May 6, 2021
@belav belav modified the milestones: 0.9.3, 0.9.4, 0.9.5 May 17, 2021
belav added a commit that referenced this issue May 24, 2021
belav added a commit that referenced this issue May 24, 2021
CSharpier automation moved this from To do to Done May 30, 2021
Bug Triage automation moved this from Selected For Dev to Closed May 30, 2021
belav added a commit that referenced this issue May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
No open projects
1 participant