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

MessagePackCodeFixProvider crash on code fixit #833

Closed
gfs opened this issue Mar 1, 2020 · 2 comments · Fixed by #956
Closed

MessagePackCodeFixProvider crash on code fixit #833

gfs opened this issue Mar 1, 2020 · 2 comments · Fixed by #956
Assignees
Labels

Comments

@gfs
Copy link
Contributor

gfs commented Mar 1, 2020

Bug description

MessagePackCodeFixProvider crashes when uses code fix it to insert keys on an inherited class if the base class hasn't yet been annotated and is in a separate file.

Repro steps

Have MessagePackAnalyzers installed.

Put this code in one file:

namespace AttackSurfaceAnalyzer.Objects
{
    public abstract class CollectObject
    {
        public abstract string Identity { get; }
    }
}

Put this code in a separate file (it doesn't crash if they are in the same file):

using MessagePack;

namespace AttackSurfaceAnalyzer.Objects
{
    [MessagePackObject]
    public class CertificateObject : CollectObject
    {
        public string StoreLocation { get; set; }
        public string StoreName { get; set; }
        public string CertificateHashString { get; set; }
        public string Subject { get; set; }
        public string Pkcs7 { get; set; }

        public override string Identity
        {
            get
            {
                return $"{StoreLocation}{StoreName}{CertificateHashString}";
            }
        }
    }
}

Right click to perform the fix-it to add the keys on any of the fields in CertificateObject and the extension will crash.

Expected behavior

Add keys appropriately.

Actual behavior

What happened instead of what you expected.

  • Version used: 2.1.90
  • Runtime: .NET Core 3.1

Additional context

Add any other context about the problem here.

@AArnott AArnott added the bug label Mar 2, 2020
@github-actions
Copy link

github-actions bot commented Jun 1, 2020

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@gfs
Copy link
Contributor Author

gfs commented Jun 1, 2020

Bump.

@AArnott AArnott self-assigned this Jun 18, 2020
AArnott added a commit to AArnott/MessagePack-CSharp that referenced this issue Jun 19, 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 a pull request may close this issue.

2 participants